Welcome to TiddlyWiki created by Jeremy Ruston; Copyright © 2004-2007 Jeremy Ruston, Copyright © 2007-2011 UnaMesa Association
/***
|''Name:''|BackstageSidebarPlugin|
|''Description:''|Adds a "new tiddler" option to the backstage|
|''Author''|Yoann Kubera|
|''CodeRepository:''|n/a |
|''Version:''|0.1|
|''Comments:''| |
|''License''|None |
***/
//{{{
if(!version.extensions.BackstageNewtiddlerPlugin) {
version.extensions.BackstageNewtiddlerPlugin= {installed:true};
config.tasks.newTiddler = {
text: 'new tiddler',
tooltip: config.macros.newTiddler.prompt,
action: function(){
var e=createTiddlyElement(document.body,'span');
e.style.display='none';
wikify("<<newTiddler>>",e);
e.getElementsByTagName('a')[0].onclick( );
document.body.removeChild(e);
}
}
config.backstageTasks.push("newTiddler");
} //# end of 'install only once'
//}}}
/***
|''Name:''|BackstageSidebarPlugin|
|''Description:''|Moves the sidebar to the backstage, as suggested at http://www.tiddlywiki.org/wiki/Dev:Backstage#Customization|
|''Author''|JonathanLister|
|''CodeRepository:''|n/a |
|''Version:''|0.1|
|''Comments:''|Please make comments at http://groups.google.co.uk/group/TiddlyWikiDev |
|''License''|[[BSD License|http://www.opensource.org/licenses/bsd-license.php]] |
|''~CoreVersion:''|2.4|
***/
//{{{
if(!version.extensions.BackstageSidebarPlugin) {
version.extensions.BackstageSidebarPlugin = {installed:true};
config.tasks.sidebar = {
text: "sidebar",
tooltip: "sidebar options",
content: "<<tiddler SideBarOptions>><<tiddler SideBarTabs>>"
};
config.backstageTasks.push("sidebar");
config.macros.BackstageSidebarPlugin = {
tiddler:tiddler
};
config.macros.BackstageSidebarPlugin.init = function() {
var tiddler = this.tiddler;
setStylesheet(store.getTiddlerText(tiddler.title+'##Stylesheet'),'BackstageSidebarPlugin');
};
} //# end of 'install only once'
//}}}
/***
!Stylesheet
#sidebar {
display:none;
}
!(end of Stylesheet)
***/
/*{{{*/
config.options.txtUserName='Designer';
config.options.chkSaveBackups=false;
config.options.chkDisableWikiLinks=true;
config.options.chkSinglePageMode=true;
config.options.chkHideTabsBarWhenSingleTab=true;
/*}}}*/
/***
|Name|DisableWikiLinksPlugin|
|Source|http://www.TiddlyTools.com/#DisableWikiLinksPlugin|
|Version|1.6.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|selectively disable TiddlyWiki's automatic ~WikiWord linking behavior|
This plugin allows you to disable TiddlyWiki's automatic ~WikiWord linking behavior, so that WikiWords embedded in tiddler content will be rendered as regular text, instead of being automatically converted to tiddler links. To create a tiddler link when automatic linking is disabled, you must enclose the link text within {{{[[...]]}}}.
!!!!!Usage
<<<
You can block automatic WikiWord linking behavior for any specific tiddler by ''tagging it with<<tag excludeWikiWords>>'' (see configuration below) or, check a plugin option to disable automatic WikiWord links to non-existing tiddler titles, while still linking WikiWords that correspond to existing tiddlers titles or shadow tiddler titles. You can also block specific selected WikiWords from being automatically linked by listing them in [[DisableWikiLinksList]] (see configuration below), separated by whitespace. This tiddler is optional and, when present, causes the listed words to always be excluded, even if automatic linking of other WikiWords is being permitted.
Note: WikiWords contained in default ''shadow'' tiddlers will be automatically linked unless you select an additional checkbox option lets you disable these automatic links as well, though this is not recommended, since it can make it more difficult to access some TiddlyWiki standard default content (such as AdvancedOptions or SideBarTabs)
<<<
!!!!!Configuration
<<<
<<option chkDisableWikiLinks>> Disable ALL automatic WikiWord tiddler links
<<option chkAllowLinksFromShadowTiddlers>> ... except for WikiWords //contained in// shadow tiddlers
<<option chkDisableNonExistingWikiLinks>> Disable automatic WikiWord links for non-existing tiddlers
Disable automatic WikiWord links for words listed in: <<option txtDisableWikiLinksList>>
Disable automatic WikiWord links for tiddlers tagged with: <<option txtDisableWikiLinksTag>>
<<<
!!!!!Revisions
<<<
2008.07.22 [1.6.0] hijack tiddler changed() method to filter disabled wiki words from internal links[] array (so they won't appear in the missing tiddlers list)
2007.06.09 [1.5.0] added configurable txtDisableWikiLinksTag (default value: "excludeWikiWords") to allows selective disabling of automatic WikiWord links for any tiddler tagged with that value.
2006.12.31 [1.4.0] in formatter, test for chkDisableNonExistingWikiLinks
2006.12.09 [1.3.0] in formatter, test for excluded wiki words specified in DisableWikiLinksList
2006.12.09 [1.2.2] fix logic in autoLinkWikiWords() (was allowing links TO shadow tiddlers, even when chkDisableWikiLinks is TRUE).
2006.12.09 [1.2.1] revised logic for handling links in shadow content
2006.12.08 [1.2.0] added hijack of Tiddler.prototype.autoLinkWikiWords so regular (non-bracketed) WikiWords won't be added to the missing list
2006.05.24 [1.1.0] added option to NOT bypass automatic wikiword links when displaying default shadow content (default is to auto-link shadow content)
2006.02.05 [1.0.1] wrapped wikifier hijack in init function to eliminate globals and avoid FireFox 1.5.0.1 crash bug when referencing globals
2005.12.09 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.DisableWikiLinksPlugin= {major: 1, minor: 6, revision: 0, date: new Date(2008,7,22)};
if (config.options.chkDisableNonExistingWikiLinks==undefined) config.options.chkDisableNonExistingWikiLinks= false;
if (config.options.chkDisableWikiLinks==undefined) config.options.chkDisableWikiLinks=false;
if (config.options.txtDisableWikiLinksList==undefined) config.options.txtDisableWikiLinksList="DisableWikiLinksList";
if (config.options.chkAllowLinksFromShadowTiddlers==undefined) config.options.chkAllowLinksFromShadowTiddlers=true;
if (config.options.txtDisableWikiLinksTag==undefined) config.options.txtDisableWikiLinksTag="excludeWikiWords";
// find the formatter for wikiLink and replace handler with 'pass-thru' rendering
initDisableWikiLinksFormatter();
function initDisableWikiLinksFormatter() {
for (var i=0; i<config.formatters.length && config.formatters[i].name!="wikiLink"; i++);
config.formatters[i].coreHandler=config.formatters[i].handler;
config.formatters[i].handler=function(w) {
// supress any leading "~" (if present)
var skip=(w.matchText.substr(0,1)==config.textPrimitives.unWikiLink)?1:0;
var title=w.matchText.substr(skip);
var exists=store.tiddlerExists(title);
var inShadow=w.tiddler && store.isShadowTiddler(w.tiddler.title);
// check for excluded Tiddler
if (w.tiddler && w.tiddler.isTagged(config.options.txtDisableWikiLinksTag))
{ w.outputText(w.output,w.matchStart+skip,w.nextMatch); return; }
// check for specific excluded wiki words
var t=store.getTiddlerText(config.options.txtDisableWikiLinksList);
if (t && t.length && t.indexOf(w.matchText)!=-1)
{ w.outputText(w.output,w.matchStart+skip,w.nextMatch); return; }
// if not disabling links from shadows (default setting)
if (config.options.chkAllowLinksFromShadowTiddlers && inShadow)
return this.coreHandler(w);
// check for non-existing non-shadow tiddler
if (config.options.chkDisableNonExistingWikiLinks && !exists)
{ w.outputText(w.output,w.matchStart+skip,w.nextMatch); return; }
// if not enabled, just do standard WikiWord link formatting
if (!config.options.chkDisableWikiLinks)
return this.coreHandler(w);
// just return text without linking
w.outputText(w.output,w.matchStart+skip,w.nextMatch)
}
}
Tiddler.prototype.coreAutoLinkWikiWords = Tiddler.prototype.autoLinkWikiWords;
Tiddler.prototype.autoLinkWikiWords = function()
{
// if all automatic links are not disabled, just return results from core function
if (!config.options.chkDisableWikiLinks)
return this.coreAutoLinkWikiWords.apply(this,arguments);
return false;
}
Tiddler.prototype.disableWikiLinks_changed = Tiddler.prototype.changed;
Tiddler.prototype.changed = function()
{
this.disableWikiLinks_changed.apply(this,arguments);
// remove excluded wiki words from links array
var t=store.getTiddlerText(config.options.txtDisableWikiLinksList,"").readBracketedList();
if (t.length) for (var i=0; i<t.length; i++)
if (this.links.contains(t[i]))
this.links.splice(this.links.indexOf(t[i]),1);
};
//}}}
/***
|''Name:''|DropDownMenuPlugin|
|''Description:''|Create dropdown menus from unordered lists|
|''Author:''|Saq Imtiaz ( lewcid@gmail.com )|
|''Source:''|http://tw.lewcid.org/#DropDownMenuPlugin|
|''Code Repository:''|http://tw.lewcid.org/svn/plugins|
|''Version:''|2.1|
|''Date:''|11/04/2007|
|''License:''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion:''|2.2.5|
!!Usage:
* create a two-level unordered list using wiki syntax, and place {{{<<dropMenu>>}}} on the line after it.
* to create a vertical menu use {{{<<dropMenu vertical>>}}} instead.
* to assign custom classes to the list, just pass them as parameters to the macro {{{<<dropMenu className1 className2 className3>>}}}
!!Features:
*Supports just a single level of drop-downs, as anything more usually provides a poor experience for the user.
* Very light weight, about 1.5kb of JavaScript and 4kb of CSS.
* Comes with two built in css 'themes', the default horizontal and vertical.
!!Customizing:
* to customize the appearance of the menu's, you can either add a custom class as described above or, you can edit the CSS via the StyleSheetDropDownMenu shadow tiddler.
!!Examples:
* [[DropDownMenuDemo]]
***/
// /%
//!BEGIN-PLUGIN-CODE
config.macros.dropMenu={
dropdownchar: "\u25bc",
handler : function(place,macroName,params,wikifier,paramString,tiddler){
list = findRelated(place.lastChild,"UL","tagName","previousSibling");
if (!list)
return;
addClass(list,"suckerfish");
if (params.length){
addClass(list,paramString);
}
this.fixLinks(list);
},
fixLinks : function(el){
var els = el.getElementsByTagName("li");
for(var i = 0; i < els.length; i++) {
if(els[i].getElementsByTagName("ul").length>0){
var link = findRelated(els[i].firstChild,"A","tagName","nextSibling");
if(!link){
var ih = els[i].firstChild.data;
els[i].removeChild(els[i].firstChild);
var d = createTiddlyElement(null,"a",null,null,ih+this.dropdownchar,{href:"javascript:;"});
els[i].insertBefore(d,els[i].firstChild);
}
else{
link.firstChild.data = link.firstChild.data + this.dropdownchar;
removeClass(link,"tiddlyLinkNonExisting");
}
}
els[i].onmouseover = function() {
addClass(this, "sfhover");
};
els[i].onmouseout = function() {
removeClass(this, "sfhover");
};
}
}
};
config.shadowTiddlers["StyleSheetDropDownMenuPlugin"] =
"/*{{{*/\n"+
"/***** LAYOUT STYLES - DO NOT EDIT! *****/\n"+
"ul.suckerfish, ul.suckerfish ul {\n"+
" margin: 0;\n"+
" padding: 0;\n"+
" list-style: none;\n"+
" line-height:1.4em;\n"+
"}\n\n"+
"ul.suckerfish li {\n"+
" display: inline-block; \n"+
" display: block;\n"+
" float: left; \n"+
"}\n\n"+
"ul.suckerfish li ul {\n"+
" position: absolute;\n"+
" left: -999em;\n"+
"}\n\n"+
"ul.suckerfish li:hover ul, ul.suckerfish li.sfhover ul {\n"+
" left: auto;\n"+
"}\n\n"+
"ul.suckerfish ul li {\n"+
" float: none;\n"+
" border-right: 0;\n"+
" border-left:0;\n"+
"}\n\n"+
"ul.suckerfish a, ul.suckerfish a:hover {\n"+
" display: block;\n"+
"}\n\n"+
"ul.suckerfish li a.tiddlyLink, ul.suckerfish li a, #mainMenu ul.suckerfish li a {font-weight:bold;}\n"+
"/**** END LAYOUT STYLES *****/\n"+
"\n\n"+
"/**** COLORS AND APPEARANCE - DEFAULT *****/\n"+
"ul.suckerfish li a {\n"+
" padding: 0.5em 1.5em;\n"+
" color: #FFF;\n"+
" background: #0066aa;\n"+
" border-bottom: 0;\n"+
" font-weight:bold;\n"+
"}\n\n"+
"ul.suckerfish li:hover a, ul.suckerfish li.sfhover a{\n"+
" background: #00558F;\n"+
"}\n\n"+
"ul.suckerfish li:hover ul a, ul.suckerfish li.sfhover ul a{\n"+
" color: #000;\n"+
" background: #eff3fa;\n"+
" border-top:1px solid #FFF;\n"+
"}\n\n"+
"ul.suckerfish ul li a:hover {\n"+
" background: #e0e8f5;\n"+
"}\n\n"+
"ul.suckerfish li a{\n"+
" width:9em;\n"+
"}\n\n"+
"ul.suckerfish ul li a, ul.suckerfish ul li a:hover{\n"+
" display:inline-block;\n"+
" width:9em;\n"+
"}\n\n"+
"ul.suckerfish li {\n"+
" border-left: 1px solid #00558F;\n"+
"}\n"+
"/***** END COLORS AND APPEARANCE - DEFAULT *****/\n"+
"\n\n"+
"/***** LAYOUT AND APPEARANCE: VERTICAL *****/\n"+
"ul.suckerfish.vertical li{\n"+
" width:10em;\n"+
" border-left: 0px solid #00558f;\n"+
"}\n\n"+
"ul.suckerfish.vertical ul li, ul.suckerfish.vertical li a, ul.suckerfish.vertical li:hover a, ul.suckerfish.vertical li.sfhover a {\n"+
" border-left: 0.8em solid #00558f;\n"+
"}\n\n"+
"ul.suckerfish.vertical li a, ul.suckerfish.vertical li:hover a, ul.suckerfish.vertical li.sfhover a, ul.suckerfish.vertical li.sfhover a:hover{\n"+
" width:8em;\n"+
"}\n\n"+
"ul.suckerfish.vertical {\n"+
" width:10em; text-align:left;\n"+
" float:left;\n"+
"}\n\n"+
"ul.suckerfish.vertical li a {\n"+
" padding: 0.5em 1em 0.5em 1em;\n"+
" border-top:1px solid #fff;\n"+
"}\n\n"+
"ul.suckerfish.vertical, ul.suckerfish.vertical ul {\n"+
" line-height:1.4em;\n"+
"}\n\n"+
"ul.suckerfish.vertical li:hover ul, ul.suckerfish.vertical li.sfhover ul { \n"+
" margin: -2.4em 0 0 10.9em;\n"+
"}\n\n"+
"ul.suckerfish.vertical li:hover ul li a, ul.suckerfish.vertical li.sfhover ul li a {\n"+
" border: 0px solid #FFF;\n"+
"}\n\n"+
"ul.suckerfish.vertical li:hover a, ul.suckerfish.vertical li.sfhover a{\n"+
" padding-right:1.1em;\n"+
"}\n\n"+
"ul.suckerfish.vertical li:hover ul li, ul.suckerfish.vertical li.sfhover ul li {\n"+
" border-bottom:1px solid #fff;\n"+
"}\n\n"+
"/***** END LAYOUT AND APPEARANCE: VERTICAL *****/\n"+
"/*}}}*/";
store.addNotification("StyleSheetDropDownMenuPlugin",refreshStyles);
//!END-PLUGIN-CODE
// %/
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{Abstract class - Decision model}}}
<html><hr class="topSep"/></html>
The extended libraries of the extended kernel of SIMILAR provide the default implementation {{className{[[AbstractAgtDecisionModel|../../api/fr/lgi2a/similar/extendedkernel/libs/abstractimpl/AbstractAgtDecisionModel.html]]}}} to the {{className{[[IAgtDecisionModel|../../api/fr/lgi2a/similar/extendedkernel/agents/IAgtDecisionModel.html]]}}} interface modeling the decision model of an agent from a specific level. This abstract class provides the behavior to the generic and domain-independent methods. Only the following method has still to be specified by the users:
*{{methodName{decide(...)}}} defining how the agent decides to produce influences from a specific level. {{doclink{[[Method API|../../api/fr/lgi2a/similar/extendedkernel/agents/IAgtDecisionModel.html#decide(fr.univ_artois.lgi2a.similar.microkernel.SimulationTimeStamp, fr.univ_artois.lgi2a.similar.microkernel.SimulationTimeStamp, fr.univ_artois.lgi2a.similar.microkernel.agents.IGlobalState, fr.univ_artois.lgi2a.similar.microkernel.agents.ILocalStateOfAgent, fr.univ_artois.lgi2a.similar.microkernel.agents.ILocalStateOfAgent, fr.univ_artois.lgi2a.similar.microkernel.agents.IPerceivedData, fr.univ_artois.lgi2a.similar.microkernel.influences.InfluencesMap)]]}}}
!Implementation instructions
A class extending {{className{[[AbstractAgtDecisionModel|../../api/fr/lgi2a/similar/extendedkernel/libs/abstractimpl/AbstractAgtDecisionModel.html]]}}} has also to be abstract, or to provide the operational code of the abovementionned methods.
In addition, the constructor of the new class should call the ''super-constructor'' having the following signature:
{{{
public AbstractAgtDecisionModel(
LevelIdentifier levelIdentifier
);
}}}
The constructor defines the following argument:
*{{argumentName{levelIdentifier}}} modeling the identifier of the level from which the decision is made in this class.
+++?*[<span class="exbigbtn ">Decision process full example</span>]
{{exsection{
[>img[../images/simulationModel/lowLevel/decisionTree.png]]
This example is a continuation of the example started in the documentation of the <html><a target="_blank" href="../index.html#[[SMD - Perception - Perceived data]]"><strong>perceived data model</strong></a></html>.
In this example, a ''lion'' agent decides to ''eat'' the closest ''gazelle'' agent. If the agent is close enough, it directly eats the gazelle. Otherwise, it ''moves towards'' the gazelle. Note that if two gazelles are at the same distance, then the agent chooses one of them randomly.
The notion of "close engouh" implies the definition of a threshold distance, under which the action is possible. This threshold belongs purely to the decision process of the agent, and therefore has to be included in its <html><a target="_blank" href="../index.html#[[SMD - Global state model]]"><strong>global state</strong></a></html> or in its <html><a target="_blank" href="../index.html#[[SMD - Private local states]]"><strong>private local state</strong></a></html>. In this example, it is added to the private local state of the "Lion" agent in the "Savannah" level.
!Code
We assume that the following influences are defined:
*The ''eat'' influence is implemented as the {{{RISavannahEat}}} class, defining a constructor having the following signature:
{{{
public RISavannahEat(
AgtLionPLSInSavannahLevel predator,
AgtGazellePLSInSavannahLevel prey,
SimulationTimeStamp timeLowerBound,
SimulationTimeStamp timeUpperBound
)
}}}
*The ''move towards'' influence is implemented as the {{{RISavannahMove}}} class, defining a constructor having the following signature:
{{{
public RISavannahMove(
AgtLionPLSInSavannahLevel predator,
double desiredX,
double desiredY,
SimulationTimeStamp timeLowerBound,
SimulationTimeStamp timeUpperBound
)
}}}
We also assume that the <html><a target="_blank" href="../index.html#[[SMD - Tools preparation - Random]]"><strong>random number generation class</strong></a></html> provides the following tool method getting a random element within a list:
{{{
public <T> T randomElement( List<T> list );
}}}
Finally, we assume that the private local state of the agent is implemented as a {{className{AgtLionHLSInSavannahLevel}}} class defining the {{methodName{getEatDistanceThreshold()}}} method, modeling the maximal distance between a lion and a prey to consider them as "close".
!Code
Based on these information, the corresponding ''decision model'' is implemented with the following code. The sources of this class are also available as a [[stand alone|../files/simulationModel/lowLevel/AgtLionDecisionFromSavannah2.java]] file.
<html><pre><object width='100%' height='350px' type='text/plain' data='../files/simulationModel/lowLevel/AgtLionDecisionFromSavannah2.java' border='0' ></pre></object></html>
}}} ===
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{Abstract class - Natural action model}}}
<html><hr class="topSep"/></html>
The extended libraries of the extended kernel of SIMILAR provide the default implementation {{className{[[AbstractEnvNaturalModel|../../api/fr/lgi2a/similar/extendedkernel/libs/abstractimpl/AbstractEnvNaturalModel.html]]}}} to the {{className{[[IEnvNaturalModel|../../api/fr/lgi2a/similar/extendedkernel/environment/IEnvNaturalModel.html]]}}} interface modeling the natural action model of the environment from a specific level. This abstract class provides the behavior to the generic and domain-independent methods. Only the following method has still to be specified by the users:
*{{methodName{natural(...)}}} defining how the environment decides which influences result for its natural action. {{doclink{[[Method API|../../api/fr/lgi2a/similar/extendedkernel/environment/IEnvNaturalModel.html#natural(fr.univ_artois.lgi2a.similar.microkernel.SimulationTimeStamp, fr.univ_artois.lgi2a.similar.microkernel.SimulationTimeStamp, java.util.Map, fr.univ_artois.lgi2a.similar.microkernel.environment.ILocalStateOfEnvironment, fr.univ_artois.lgi2a.similar.microkernel.dynamicstate.IPublicDynamicStateMap, fr.univ_artois.lgi2a.similar.microkernel.influences.InfluencesMap)]]}}}
!Implementation instructions
A class extending {{className{[[AbstractEnvNaturalModel|../../api/fr/lgi2a/similar/extendedkernel/libs/abstractimpl/AbstractEnvNaturalModel.html]]}}} has also to be abstract, or to provide the operational code of the abovementionned methods.
In addition, the constructor of the new class should call the ''super-constructor'' having the following signature:
{{{
public AbstractEnvNaturalModel(
LevelIdentifier levelIdentifier
);
}}}
The constructor defines the following argument:
*{{argumentName{levelIdentifier}}} The identifier of the level from which the natural action is made in this class.
+++?[<span class="exbigbtn">Natural action process full example</span>]
{{exsection{
[>img[../images/simulationModel/lowLevel/naturalTree.png]]
This example illustrates the use of the natural action of the environment in the context of a ''bubble chamber'' simulation.
<<<
//A bubble chamber is a vessel filled with a superheated transparent liquid (most often liquid hydrogen) used to detect electrically charged particles moving through it.
[...]
As particles enter the chamber, a piston suddenly decreases its pressure, and the liquid enters into a superheated, metastable phase. Charged particles create an ionisation track, around which the liquid vaporises, forming microscopic bubbles.//
@@display:block;text-align:right;__Source:__ http://en.wikipedia.org/wiki/Bubble_chamber@@
<<<
In this simulation, agents from the ''particle canon'' category fire ''particles'' in the ''bubble chamber'' level. The behavior of the ''particle'' agents only consists in moving. The environment (//i.e.// the superheated transparent liquid) generates the ''bubbles'' along the path of the ''particles'' with its natural action.
In this example, we focus on the definition of the natural action of the environment from the ''bubble chamber'' level. It creates a bubble at the same location than the ''particle'' agents.
{{clearright{}}}
!Code
This example assumes that:
*The levels identifier list of the simulation is implemented as the {{className{[[BubbleChamberLevelList|../files/simulationModel/lowLevel/BubbleChamberLevelList.java]]}}} class;
*The agent categories list of the simulation is implemented as the {{className{[[BubbleChamberAgentCategoriesList|../files/simulationModel/lowLevel/BubbleChamberAgentCategoriesList.java]]}}} class;
*The public local state of the particle agents is implemented as the {{className{AgtParticlePLSInChamber}}} class, containing:
**a {{methodName{getLocation()}}} method returning a {{className{Point2D}}} object modeling the location of the particle.
*The factory creating new agents from the ''bubble'' category is implemented as the {{className{AgtBubbleFactory}}} class and defines the following static method:
**{{methodName{generate(double,double)}}} returning an instance of the {{className{IAgent4Engine}}} interface. Its parameters are the x and y coordinate of the bubble.
Based on these information, the corresponding ''natural action model'' is implemented with the following code. The sources of this class are also available as a [[stand alone|../files/simulationModel/lowLevel/EnvNaturalInChamber2.java]] file:
<html><pre><object width='100%' height='350px' type='text/plain' data='../files/simulationModel/lowLevel/EnvNaturalInChamber2.java' border='0' ></pre></object></html>
}}} ===
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{Abstract class - Simulation parameters}}}
<html><hr class="topSep"/></html>
The extended libraries of the extended kernel of SIMILAR provide the default implementation {{className{[[AbstractSimulationParameters|../../api/fr/lgi2a/similar/extendedkernel/libs/abstractimpl/AbstractSimulationParameters.html]]}}} to the {{className{[[ISimulationParameters|../../api/fr/lgi2a/similar/extendedkernel/simulationmodel/ISimulationParameters.html]]}}} interface modeling the parameters of a simulation. This class provides the behavior to all the generic methods defined in the parent interface.
!Implementation instructions
A class extending {{className{[[AbstractSimulationParameters|../../api/fr/lgi2a/similar/extendedkernel/libs/abstractimpl/AbstractSimulationParameters.html]]}}} has to call the ''super-constructor'' having the following signature:
{{{
protected AbstractSimulationParameters(
SimulationTimeStamp initialTime
);
}}}
The constructor defines the following argument:
*{{argumentName{initialTime}}} The initial time of the simulation.
+++?*[<span class="exbigbtn ">Parameters class example</span>]
{{exsection{
[>img[../images/simulationModel/preparation/parametersTree.png]]
We consider in this example a simulation relying on the following parameters:
*''Initial number of agents'' (default value: 350)
*''Agent initial speed'' (default value: 25)
{{clearright{}}}<html><h1>
Code</h1></html>
Based on these information, the corresponding ''simulation parameters'' class is implemented with the following code. The sources of this class are also available as a [[stand alone|../files/simulationModel/preparation/MyParametersClass2.java]] file.
<html><pre><object width='100%' height='350px' type='text/plain' data='../files/simulationModel/preparation/MyParametersClass2.java' border='0' ></pre></object></html>
}}} ===
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{Abstract class - Perception model}}}
<html><hr class="topSep"/></html>
The extended libraries of the extended kernel of SIMILAR provide the default implementation {{className{[[AbstractAgtPerceptionModel|../../api/fr/lgi2a/similar/extendedkernel/libs/abstractimpl/AbstractAgtPerceptionModel.html]]}}} to the {{className{[[IAgtPerceptionModel|../../api/fr/lgi2a/similar/extendedkernel/agents/IAgtPerceptionModel.html]]}}} interface modeling the perception model of an agent from a specific level. This abstract class provides the behavior to the generic and domain-independent methods. Only the following method has still to be specified by the users:
*{{methodName{perceive(...)}}} defining how the agent perceives information from the simulation for a specific level. {{doclink{[[Method API|../../api/fr/lgi2a/similar/extendedkernel/agents/IAgtPerceptionModel.html#perceive(fr.univ_artois.lgi2a.similar.microkernel.SimulationTimeStamp, fr.univ_artois.lgi2a.similar.microkernel.SimulationTimeStamp, java.util.Map, fr.univ_artois.lgi2a.similar.microkernel.agents.ILocalStateOfAgent, fr.univ_artois.lgi2a.similar.microkernel.dynamicstate.IPublicDynamicStateMap)]]}}}
!Implementation instructions
A class extending {{className{[[AbstractAgtPerceptionModel|../../api/fr/lgi2a/similar/extendedkernel/libs/abstractimpl/AbstractAgtPerceptionModel.html]]}}} has also to be abstract, or to provide the operational code of the abovementionned methods.
In addition, the constructor of the new class should call the ''super-constructor'' having the following signature:
{{{
public AbstractAgtPerceptionModel(
LevelIdentifier levelIdentifier
);
}}}
The constructor defines the following argument:
*{{argumentName{levelIdentifier}}} modeling the identifier of the level from which the perception is made in this class.
+++?*[<span class="exbigbtn ">Perception process full example</span>]
{{exsection{
[>img[../images/simulationModel/lowLevel/perceptionTree.png]]
This example is a continuation of the example started in the documentation of the <html><a target="_blank" href="../index.html#[[SMD - Perception - Perceived data]]"><strong>perceived data model</strong></a></html>.
We illustrate the implementation of the perception process of a ''lion'' agent, assuming that:
*The ''Sky'' and ''Savannah'' levels use a 2D grid topology (see <html><a target="_blank" href="../index.html#[[SMD - Public local states]]"><strong>this page</strong></a></html>);
*The ''Lion'' agent defines a 2D coordinate in the ''Savannah'' level (see <html><a target="_blank" href="../index.html#[[SMD - Public local states]]"><strong>this page</strong></a></html>);
*The ''Gazelle'' agents define a public local state in the ''Savannah'' level named {{className{AgtGazellePLSInSavannahLevel}}}, where their age can be read using the {{methodName{getAge()}}} method;
The perception process of a ''Lion'' consists in listing the young gazelles (younger than 3 years) agents in a 300 meters square centered on the location of the lion. This implies that the private local state of the "Lion" agent in the "Savannah" level contains two information:
*The ''perception radius'' where the gazelles can be seen (here 300 meters)
*The ''age threshold'' under which gazelles are preyed on (here 3 years).
The {{className{[[AgtLionHLSInSavannahLevel|../files/simulationModel/lowLevel/AgtLionHLSInSavannahLevel.java]]}}} class implements such a private local state.
{{clearright{}}}<html><h1>
Code</h1></html>
Based on these information, the corresponding ''perception model'' is implemented with the following code. The sources of this class are also available as a [[stand alone|../files/simulationModel/lowLevel/AgtLionPerceptionFromSavannah2.java]] file.
<html><pre><object width='100%' height='350px' type='text/plain' data='../files/simulationModel/lowLevel/AgtLionPerceptionFromSavannah2.java' border='0' ></pre></object></html>
}}} ===
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{Abstract classes}}}
<html><hr class="topSep"/></html>
The extended libraries of SIMILAR define ''abstract classes'' providing a default implementation to the generic methods of the following elements of the extended-kernel:
*[[Simulation parameters|EL - Abstract - Parameters]];
*A [[perception model|EL - Abstract - Perception]] of an agent from a level;
*A [[decision model|EL - Abstract - Decision]] of an agent from a level;
*A [[natural action model|EL - Abstract - Natural]] of the environment from a level.
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{Simulation end critera}}}
<html><hr class="topSep"/></html>
The extended libraries of SIMILAR define the following ''simulation end critera'':
*{{className{[[TimeBasedEndCriterion|EL - End critera - Time based]]}}}, telling that the simulation ends if its current half-consistent time is greater or equal to a specific final time stamp;
*{{className{[[EndCriterionConjunction|EL - End critera - Conjunction]]}}}, modeling an ending criterion as the conjunction of other ending criteria models;
*{{className{[[EndCriterionDisjunction|EL - End critera - Disjunction]]}}}, modeling an ending criterion as the disjunction of other ending criteria models;
*{{className{[[EndCriterionNegation|EL - End critera - Negation]]}}}, modeling an ending criterion as the negation of another ending criterion model.
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{End critera - Conjunction}}}
<html><hr class="topSep"/></html>
The extended libraries of the extended-kernel of SIMILAR provide a default implementation to the simulation end criterion model class where:
*The criterion is the composition of a set of other criteria;
*The simulation ends when it reaches an half consistent state meeting all the criterion of the composition.
This class is called {{className{[[EndCriterionConjunction|../../api/fr/lgi2a/similar/extendedkernel/libs/endcriterion/EndCriterionConjunction.html]]}}} and defines the following constructor:
{{{
public EndCriterionConjunction(
IEndCriterionModel... criterionModels
);
}}}
This constructor defines the following argument:
*{{argumentName{criterionModels}}} modeling the various ending criteria used in the conjunction.
+++?[<span class="exbigbtn">Usage example</span>]
{{exsection{
In the context of a simulation that has to be stopped if three different end criteria {{{endCriterion1}}}, {{{endCriterion2}}} and {{{endCriterion3}}} are met, the corresponding end criterion conjunction is created with the following code:
{{{
IEndCriterionModel endCriterion1 = ...;
IEndCriterionModel endCriterion2 = ...;
IEndCriterionModel endCriterion3 = ...;
IEndCriterionModel endModel = new EndCriterionConjunction(
endCriterion1,
endCriterion2,
endCriterion3
);
}}}
}}} ===
!Notice
The conjunction is made using a lazy operator. Therefore, the declaration order of the criteria has an influence on the performances of the simulation.
If no criteria are defined as a parameter of the conjunction, the criterion always returns {{{true}}}.
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{End critera - Disjunction}}}
<html><hr class="topSep"/></html>
The extended libraries of the extended-kernel of SIMILAR provide a default implementation to the simulation end criterion model class where:
*The criterion is the composition of a set of other criteria;
*The simulation ends when it reaches an half consistent state meeting at least one criterion of the composition.
This class is called {{className{[[EndCriterionDisjunction|../../api/fr/lgi2a/similar/extendedkernel/libs/endcriterion/EndCriterionDisjunction.html]]}}} and defines the following constructor:
{{{
public EndCriterionDisjunction(
IEndCriterionModel... criterionModels
);
}}}
This constructor defines the following argument:
*{{argumentName{criterionModels}}} modeling the various ending criteria used in the disjunction.
+++?[<span class="exbigbtn">Usage example</span>]
{{exsection{
In the context of a simulation that has to be stopped if at least one out of three different end criteria {{{endCriterion1}}}, {{{endCriterion2}}} and {{{endCriterion3}}} are met, the corresponding end criterion disjunction is created with the following code:
{{{
IEndCriterionModel endCriterion1 = ...;
IEndCriterionModel endCriterion2 = ...;
IEndCriterionModel endCriterion3 = ...;
IEndCriterionModel endModel = new EndCriterionDisjunction(
endCriterion1,
endCriterion2,
endCriterion3
);
}}}
}}} ===
!Notice
The disjunction is made using a lazy operator. Therefore, the declaration order of the criteria has an influence on the performances of the simulation.
If no criteria are defined as a parameter of the disjunction, the criterion always returns {{{false}}}.
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{End critera - Negation}}}
<html><hr class="topSep"/></html>
The extended libraries of the extended-kernel of SIMILAR provide a default implementation to the simulation end criterion model class where:
*The criterion decorates another criterion;
*The simulation ends when it reaches an half consistent state meeting the negation of the decorated criterion.
This class is called {{className{[[EndCriterionNegation|../../api/fr/lgi2a/similar/extendedkernel/libs/endcriterion/EndCriterionNegation.html]]}}} and defines the following constructor:
{{{
public EndCriterionNegation(
IEndCriterionModel criterionModel
);
}}}
This constructor defines the following argument:
*{{argumentName{criterionModel}}} modeling the decorated criterion of the negation.
+++?[<span class="exbigbtn">Usage example</span>]
{{exsection{
In the context of a simulation that has to be stopped if the negation of a criterion {{{endCriterion1}}} is met, the corresponding end criterion is created with the following code:
{{{
IEndCriterionModel endCriterion1 = ...;
IEndCriterionModel endModel = new EndCriterionNegation(
endCriterion1
);
}}}
}}} ===
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{End critera - Time based}}}
<html><hr class="topSep"/></html>
The extended libraries of the extended-kernel of SIMILAR provide a default implementation to the ''simulation end criterion model'' class where:
*The simulation ends if it reaches an half consistent time greater or equal to a specific final time.
This class is called {{className{[[TimeBasedEndCriterion|../../api/fr/lgi2a/similar/extendedkernel/libs/endcriterion/TimeBasedEndCriterion.html]]}}} and defines the following constructor:
{{{
public TimeBasedEndCriterion(
SimulationTimeStamp finalTimeStamp
);
}}}
This constructor defines the following argument:
*{{argumentName{finalTimeStamp}}} modeling the final time of the simulation.
+++?[<span class="exbigbtn">Usage example</span>]
{{exsection{
In the context of a simulation that has to end at the time stamp having the identifier {{{15}}}, the corresponding end criterion is created with the following code:
{{{
IEndCriterionModel endModel = new TimeBasedEndCriterion(
new SimulationTimeStamp( 15 )
);
}}}
}}} ===
!Important notice
If the specified final time does not represent a time stamp of the time model of the simulation (see the image 1 below), then the simulation will end when it reaches the smallest time stamp of its time model greater than the final time (see the image 2 below).
[img(100%,)[images/endCritera/timeBased1.png]]
{{caption{Image 1: Situation where the final time of the end criterion is not a time stamp of the time model of the simulation.}}}
[img(100%,)[images/endCritera/timeBased2.png]]
{{caption{Image 2: Actual time model of the simulation when a time based end criterion is used.}}}
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{Generic class - Empty decision}}}
<html><hr class="topSep"/></html>
The extended libraries of the extended kernel of SIMILAR provide a default implementation to the ''decision model'' of an agent, in the case where no influences are produced by the decision process of the agent. This class is called {{className{[[EmptyAgtDecisionModel|../../api/fr/lgi2a/similar/extendedkernel/libs/generic/EmptyAgtDecisionModel.html]]}}} and defines the following constructor:
{{{
public EmptyAgtDecisionModel(
LevelIdentifier levelIdentifier
);
}}}
This constructor defines the following arguments:
*{{className{levelIdentifier}}} modeling the identifier of the level from which the decision is made.
+++?[<span class="exbigbtn">Usage example</span>]
{{exsection{
If we consider a wildlife simulation where the identifier of a "Savannah" level is declared in the field {{fieldName{SAVANNAH}}} of the class {{className{WildlifeLevelsList}}}, then the creation of an empty decision model of an agent from the "Savannah" level is made with the following code:
{{{
IAgtDecisonModel savannahDecisionMdl = new EmptyAgtDecisionModel(
WildlifeLevelsList.SAVANNAH
);
}}}
}}} ===
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{Generic class - Empty natural}}}
<html><hr class="topSep"/></html>
The extended libraries of the extended kernel of SIMILAR provide a default implementation to the ''natural action model'' of the environment, in the case where no influences are produced by the decision process of the environment from a level. This class is called {{className{[[EmptyEnvNaturalModel|../../api/fr/lgi2a/similar/extendedkernel/libs/generic/EmptyEnvNaturalModel.html]]}}} and defines the following constructor:
{{{
public EmptyEnvNaturalModel(
LevelIdentifier levelIdentifier
);
}}}
This constructor defines the following arguments:
*{{className{levelIdentifier}}} modeling the identifier of the level from which the natural action is made.
+++?[<span class="exbigbtn">Usage example</span>]
{{exsection{
If we consider a wildlife simulation where the identifier of a "Savannah" level is declared in the field {{fieldName{SAVANNAH}}} of the class {{className{WildlifeLevelsList}}}, then the creation of an empty natural action model of the environment from the "Savannah" level is made with the following code:
{{{
IEnvNaturalModel savannahNaturalMdl = new EmptyEnvNaturalModel(
WildlifeLevelsList.SAVANNAH
);
}}}
}}} ===
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{Generic class - Empty perception}}}
<html><hr class="topSep"/></html>
The extended libraries of the extended kernel of SIMILAR provide a default implementation to the ''perception model'' of an agent, in the case where no perceived data are required by the decision process of the agent. The perception process of that perception model class therefore returns empty perceived data. This class is called {{className{[[EmptyAgtPerceptionModel|../../api/fr/lgi2a/similar/extendedkernel/libs/generic/EmptyAgtPerceptionModel.html]]}}} and defines the following constructor:
{{{
public EmptyAgtPerceptionModel(
LevelIdentifier levelIdentifier
);
}}}
This constructor defines the following arguments:
*{{className{levelIdentifier}}} modeling the identifier of the level from which the perception is made.
+++?[<span class="exbigbtn">Usage example</span>]
{{exsection{
If we consider a wildlife simulation where the identifier of a "Savannah" level is declared in the field {{fieldName{SAVANNAH}}} of the class {{className{WildlifeLevelsList}}}, then the creation of an empty perception model of an agent from the "Savannah" level is made with the following code:
{{{
IAgtPerceptionModel savannahPerceptionMdl = new EmptyAgtPerceptionModel(
WildlifeLevelsList.SAVANNAH
);
}}}
}}} ===
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{Generic class - Empty reaction}}}
<html><hr class="topSep"/></html>
The extended libraries of the extended kernel of SIMILAR provide a default implementation to the ''reaction model'' of a level, in the case where the user-defined reaction to the system and regular influences does nothing. This class is called {{className{[[EmptyAgtPerceptionModel|../../api/fr/lgi2a/similar/extendedkernel/libs/generic/EmptyLevelReactionModel.html]]}}} and defines the following constructor:
{{{
public EmptyLevelReactionModel( );
}}}
+++?[<span class="exbigbtn">Usage example</span>]
{{exsection{
The creation of an empty reaction model for any level is made with the following code:
{{{
ILevelReactionModel reactionMdl = new EmptyLevelReactionModel( );
}}}
}}} ===
!Important notice
This reaction model makes sure that no influences persists in the new consistent state of the level.
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{Generic class - Still global state}}}
<html><hr class="topSep"/></html>
The extended libraries of the extended kernel of SIMILAR provide a default implementation to the ''global state revision model'' of an agent, in the case where no modifications are performed in the global state of the agent. The global state revision process of that model class therefore returns the plain global state. This class is called {{className{[[IdentityAgtGlobalStateRevisionModel|../../api/fr/lgi2a/similar/extendedkernel/libs/generic/IdentityAgtGlobalStateRevisionModel.html]]}}} and defines the following constructor:
{{{
public IdentityAgtGlobalStateRevisionModel( );
}}}
+++?[<span class="exbigbtn">Usage example</span>]
{{exsection{
The creation of an //"empty"// global state revision model of an agent is made with the following code:
{{{
IAgtGlobalStateRevisionModel revisionMdl = new IdentityAgtGlobalStateRevisionModel( );
}}}
}}} ===
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{Generic class - Simple parameters}}}
<html><hr class="topSep"/></html>
The extended libraries of the extended kernel of SIMILAR provide a default implementation to the ''parameters class'' of asimulation, in the case where no additionnal parameters are declared. The parameters class therefore contains only the initial time stamp of the simulation. This class is called {{className{[[SimpleSimulationParameters|../../api/fr/lgi2a/similar/extendedkernel/libs/generic/SimpleSimulationParameters.html]]}}} and defines the following constructor:
{{{
public SimpleSimulationParameters(
SimulationTimeStamp initialTime
);
}}}
This constructor defines the following arguments:
*{{className{initialTime}}} modeling the initial time of the simulation.
+++?[<span class="exbigbtn">Usage example</span>]
{{exsection{
If we consider a simulation where the initial time has the identifier {{{15}}}, then the creation of a simple parameters class of a simulation is made with the following code:
{{{
ISimulationParameters parameters = new SimpleSimulationParameters(
new SimulationTimeStamp( 15 )
);
}}}
}}} ===
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{Generic classes}}}
<html><hr class="topSep"/></html>
The extended libraries of SIMILAR define the ''generic and reusable'' implementations of the following elements of the extended-kernel:
*An agent [[perception model|EL - Generic - Empty perception]] //"doing nothing"// (//i.e.// returning empty perceived data);
*An agent [[decision model|EL - Generic - Empty decision]] //"doing nothing"// (//i.e.// generating no influences);
*An environment [[natural action model|EL - Generic - Empty natural]] //"doing nothing"// (//i.e.// generating no influences);
*A level [[reaction model|EL - Generic - Empty reaction]] //"doing nothing"// (//i.e.// performing no user reaction to the influences);
*An agent [[global state revision model|EL - Generic - Identity revision]] //"doing nothing"// (//i.e.// performing no modifications in the global state of the agent);
*An //"empty"// [[simulation parameters class|EL - Generic - Simple parameters]] (//i.e.// containing only the bare minimal parameters).
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{Time models}}}
<html><hr class="topSep"/></html>
The extended libraries of SIMILAR define the following ''time models'':
*{{className{[[PeriodicTimeModel|EL - Time models - Periodic]]}}}, where the identifiers of the time stamps are periodic;
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{Time models - Periodic}}}
<html><hr class="topSep"/></html>
The extended libraries of the extended-kernel of SIMILAR provide a default implementation to the ''time model'' class where:
*The identifier of the time stamps are periodic;
*A phase shift is applied between the initial time stamp and the first value returned by the time model.
[img(100%,)[images/timeModels/periodic.png]]
{{caption{Illustration of a periodic time model.}}}
This class is called {{className{[[PeriodicTimeModel|../../api/fr/lgi2a/similar/extendedkernel/libs/timemodel/PeriodicTimeModel.html]]}}} and defines the following constructor:
{{{
public PeriodicTimeModel(
long period,
long phaseShift,
SimulationTimeStamp initialTime
);
}}}
This constructor defines the following argument:
*{{argumentName{period}}} modeling the period of the time model (see the image above);
*{{argumentName{phaseShift}}} modeling the phase shift of the time model (see the image above);
*{{argumentName{initialTime}}} modeling the initial time of the simulation.
+++?[<span class="exbigbtn">Usage example</span>]
{{exsection{
In the context of a simulation using a {{{2}}} period and {{{0}}} as a phase shift, if we assume that the initial time of the simulation is declared in a variable {{argumentName{initialTimeOfSimulation}}}, then such a time model is created using the following code:
{{{
SimulationTimeStamp initialTimeOfSimulation = ... ;
ITimeModel timeModel = new PeriodicTimeModel(
2,
0,
initialTimeOfSimulation
);
}}}
}}} ===
*[[|Home]]
*[[Abstract implementations|EL - Abstract implementations]]
**[[Simulation parameters|EL - Abstract - Parameters]]
**[[Agent perception|EL - Abstract - Perception]]
**[[Agent decision|EL - Abstract - Decision]]
**[[Natural action|EL - Abstract - Natural]]
*[[Generic implementations|EL - Generic implementations]]
**[[Empty perception|EL - Generic - Empty perception]]
**[[Empty decision|EL - Generic - Empty decision]]
**[[Empty natural action|EL - Generic - Empty natural]]
**[[Empty reaction|EL - Generic - Empty reaction]]
**[[Still global state revision|EL - Generic - Identity revision]]
**[[Simple parameters|EL - Generic - Simple parameters]]
*[[Simulation end critera|EL - End critera]]
**[[Time based|EL - End critera - Time based]]
**[[Conjunction|EL - End critera - Conjunction]]
**[[Disjunction|EL - End critera - Disjunction]]
**[[Negation|EL - End critera - Negation]]
*[[Simulation time models|EL - Time models]]
**[[Periodic|EL - Time models - Periodic]]
<<dropMenu>>
[[StyleSheetCustomization]]
To get started with this blank TiddlyWiki, you'll need to modify the following tiddlers:
* [[SiteTitle]] & [[SiteSubtitle]]: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* [[MainMenu]]: The menu (usually on the left)
* [[DefaultTiddlers]]: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
*Documentation inline test +++?[<span class="docsmallbtn ">Documentation</span>]{{docsection{
This is the content of the documentation.
!A title inside the documentation
Another text.
{{javadoctitle{Javadoc:}}}
{{javadocsection{
A javadoc !
}}}
}}}
===
*Implementation inline test +++?[<span class="implsmallbtn">Implementation</span>]{{implsection{
This is the content of an implementation.
!A title inside the implementation
Another text
{{{
A source code.
}}}
}}}
===
*Example inline test +++?[<span class="exsmallbtn">Example</span>]{{exsection{
This is the content of an example.
!A title inside the example
Another text
}}}
===
+++?[<span class="docbigbtn ">Documentation</span>]{{docsection{
This is the content of the documentation.
!A title inside the documentation
Another text.
{{javadoctitle{Javadoc:}}}
{{javadocsection{
A javadoc !
}}}
}}}
===
+++?[<span class="implbigbtn">Implementation</span>]{{implsection{
This is the content of an implementation.
!A title inside the implementation
Another text
{{{
A source code.
}}}
}}}
===
+++?[<span class="exbigbtn">Example</span>]{{exsection{
This is the content of an example.
!A title inside the example
Another text
}}}
===
A normal paragraph having a word with a +++^34em^*@[tooltip]
The text of the tooltip.
===.
{{bigemphasisblock{
A block putting a big emphasis on a text.
}}}
+++?*[<span class="docbigbtn" style="width:100px;">Test 1</span>]{{docsection{
Tabulation content 1.
}}}
=== +++?*[<span class="docbigbtn" style="width:100px;">Test 2</span>]{{docsection{
Tabulation content 2.
}}}
===
[<img(10%,)[file:///C:/Users/yoakubera/Desktop/similarDoc/images/completeStructure.png]]
{{linkbigbtn center{[[Big link button | MainMenu]]}}}
<<tiddler [[Extended libs - Navigation menu]]>>{{stepMainTitle{Extended kernel - Extended libraries}}}
<html><hr class="topSep"/></html>
[>img(45%,)[images/structure_extendedlibs.png]]
The ''extended libraries'' of the extended kernel, containing generic implementations of simulation algorithms and results exporting features. These libraries ''facilitate the design of simulations with the extended kernel'', owing to:
*Concrete [[end criteria|EL - End critera]];
*Concrete [[time models|EL - Time models]] for the levels;
*[[Abstract implementations|EL - Abstract implementations]] of the interfaces of the extended kernel;
*[[Generic implementations|EL - Generic implementations]] of behaviors and parameters.
{{linkbigbtn center{[[Documentation content]]}}}
/***
|Name|ImageSizePlugin|
|Source|http://www.TiddlyTools.com/#ImageSizePlugin|
|Version|1.2.3|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|adds support for resizing images|
This plugin adds optional syntax to scale an image to a specified width and height and/or interactively resize the image with the mouse.
!!!!!Usage
<<<
The extended image syntax is:
{{{
[img(w+,h+)[...][...]]
}}}
where ''(w,h)'' indicates the desired width and height (in CSS units, e.g., px, em, cm, in, or %). Use ''auto'' (or a blank value) for either dimension to scale that dimension proportionally (i.e., maintain the aspect ratio). You can also calculate a CSS value 'on-the-fly' by using a //javascript expression// enclosed between """{{""" and """}}""". Appending a plus sign (+) to a dimension enables interactive resizing in that dimension (by dragging the mouse inside the image). Use ~SHIFT-click to show the full-sized (un-scaled) image. Use ~CTRL-click to restore the starting size (either scaled or full-sized).
<<<
!!!!!Examples
<<<
{{{
[img(100px+,75px+)[images/meow2.jpg]]
}}}
[img(100px+,75px+)[images/meow2.jpg]]
{{{
[<img(34%+,+)[images/meow.gif]]
[<img(21% ,+)[images/meow.gif]]
[<img(13%+, )[images/meow.gif]]
[<img( 8%+, )[images/meow.gif]]
[<img( 5% , )[images/meow.gif]]
[<img( 3% , )[images/meow.gif]]
[<img( 2% , )[images/meow.gif]]
[img( 1%+,+)[images/meow.gif]]
}}}
[<img(34%+,+)[images/meow.gif]]
[<img(21% ,+)[images/meow.gif]]
[<img(13%+, )[images/meow.gif]]
[<img( 8%+, )[images/meow.gif]]
[<img( 5% , )[images/meow.gif]]
[<img( 3% , )[images/meow.gif]]
[<img( 2% , )[images/meow.gif]]
[img( 1%+,+)[images/meow.gif]]
{{tagClear{
}}}
<<<
!!!!!Revisions
<<<
2011.09.03 [1.2.3] bypass addStretchHandlers() if no '+' suffix is used (i.e., not resizable)
2010.07.24 [1.2.2] moved tip/dragtip text to config.formatterHelpers.imageSize object to enable customization
2009.02.24 [1.2.1] cleanup width/height regexp, use '+' suffix for resizing
2009.02.22 [1.2.0] added stretchable images
2008.01.19 [1.1.0] added evaluated width/height values
2008.01.18 [1.0.1] regexp for "(width,height)" now passes all CSS values to browser for validation
2008.01.17 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.ImageSizePlugin= {major: 1, minor: 2, revision: 3, date: new Date(2011,9,3)};
//}}}
//{{{
var f=config.formatters[config.formatters.findByField("name","image")];
f.match="\\[[<>]?[Ii][Mm][Gg](?:\\([^,]*,[^\\)]*\\))?\\[";
f.lookaheadRegExp=/\[([<]?)(>?)[Ii][Mm][Gg](?:\(([^,]*),([^\)]*)\))?\[(?:([^\|\]]+)\|)?([^\[\]\|]+)\](?:\[([^\]]*)\])?\]/mg;
f.handler=function(w) {
this.lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var floatLeft=lookaheadMatch[1];
var floatRight=lookaheadMatch[2];
var width=lookaheadMatch[3];
var height=lookaheadMatch[4];
var tooltip=lookaheadMatch[5];
var src=lookaheadMatch[6];
var link=lookaheadMatch[7];
// Simple bracketted link
var e = w.output;
if(link) { // LINKED IMAGE
if (config.formatterHelpers.isExternalLink(link)) {
if (config.macros.attach && config.macros.attach.isAttachment(link)) {
// see [[AttachFilePluginFormatters]]
e = createExternalLink(w.output,link);
e.href=config.macros.attach.getAttachment(link);
e.title = config.macros.attach.linkTooltip + link;
} else
e = createExternalLink(w.output,link);
} else
e = createTiddlyLink(w.output,link,false,null,w.isStatic);
addClass(e,"imageLink");
}
var img = createTiddlyElement(e,"img");
if(floatLeft) img.align="left"; else if(floatRight) img.align="right";
if(width||height) {
var x=width.trim(); var y=height.trim();
var stretchW=(x.substr(x.length-1,1)=='+'); if (stretchW) x=x.substr(0,x.length-1);
var stretchH=(y.substr(y.length-1,1)=='+'); if (stretchH) y=y.substr(0,y.length-1);
if (x.substr(0,2)=="{{")
{ try{x=eval(x.substr(2,x.length-4))} catch(e){displayMessage(e.description||e.toString())} }
if (y.substr(0,2)=="{{")
{ try{y=eval(y.substr(2,y.length-4))} catch(e){displayMessage(e.description||e.toString())} }
img.style.width=x.trim(); img.style.height=y.trim();
if (stretchW||stretchH) config.formatterHelpers.addStretchHandlers(img,stretchW,stretchH);
}
if(tooltip) img.title = tooltip;
// GET IMAGE SOURCE
if (config.macros.attach && config.macros.attach.isAttachment(src))
src=config.macros.attach.getAttachment(src); // see [[AttachFilePluginFormatters]]
else if (config.formatterHelpers.resolvePath) { // see [[ImagePathPlugin]]
if (config.browser.isIE || config.browser.isSafari) {
img.onerror=(function(){
this.src=config.formatterHelpers.resolvePath(this.src,false);
return false;
});
} else
src=config.formatterHelpers.resolvePath(src,true);
}
img.src=src;
w.nextMatch = this.lookaheadRegExp.lastIndex;
}
}
config.formatterHelpers.imageSize={
tip: 'SHIFT-CLICK=show full size, CTRL-CLICK=restore initial size',
dragtip: 'DRAG=stretch/shrink, '
}
config.formatterHelpers.addStretchHandlers=function(e,stretchW,stretchH) {
e.title=((stretchW||stretchH)?this.imageSize.dragtip:'')+this.imageSize.tip;
e.statusMsg='width=%0, height=%1';
e.style.cursor='move';
e.originalW=e.style.width;
e.originalH=e.style.height;
e.minW=Math.max(e.offsetWidth/20,10);
e.minH=Math.max(e.offsetHeight/20,10);
e.stretchW=stretchW;
e.stretchH=stretchH;
e.onmousedown=function(ev) { var ev=ev||window.event;
this.sizing=true;
this.startX=!config.browser.isIE?ev.pageX:(ev.clientX+findScrollX());
this.startY=!config.browser.isIE?ev.pageY:(ev.clientY+findScrollY());
this.startW=this.offsetWidth;
this.startH=this.offsetHeight;
return false;
};
e.onmousemove=function(ev) { var ev=ev||window.event;
if (this.sizing) {
var s=this.style;
var currX=!config.browser.isIE?ev.pageX:(ev.clientX+findScrollX());
var currY=!config.browser.isIE?ev.pageY:(ev.clientY+findScrollY());
var newW=(currX-this.offsetLeft)/(this.startX-this.offsetLeft)*this.startW;
var newH=(currY-this.offsetTop )/(this.startY-this.offsetTop )*this.startH;
if (this.stretchW) s.width =Math.floor(Math.max(newW,this.minW))+'px';
if (this.stretchH) s.height=Math.floor(Math.max(newH,this.minH))+'px';
clearMessage(); displayMessage(this.statusMsg.format([s.width,s.height]));
}
return false;
};
e.onmouseup=function(ev) { var ev=ev||window.event;
if (ev.shiftKey) { this.style.width=this.style.height=''; }
if (ev.ctrlKey) { this.style.width=this.originalW; this.style.height=this.originalH; }
this.sizing=false;
clearMessage();
return false;
};
e.onmouseout=function(ev) { var ev=ev||window.event;
this.sizing=false;
clearMessage();
return false;
};
}
//}}}
!Dependency Information
!!Apache Maven
{{{
<dependency>
<groupId>fr.univ_artois.lgi2a</groupId>
<artifactId>similar-microKernel</artifactId>
<version>0.0.1</version>
</dependency>
}}}
!!Apache Buildr
{{{
'fr.univ_artois.lgi2a:similar-microKernel:jar:0.0.1'
}}}
!!Apache Ant
{{{
<dependency org="fr.univ_artois.lgi2a" name="similar-microKernel" rev="0.0.1">
<artifact name="similar-microKernel" type="jar" />
</dependency>
}}}
!!Groovy Grape
{{{
@Grapes(
@Grab(group='fr.univ_artois.lgi2a', module='similar-microKernel', version='0.0.1')
)
}}}
!!Grails
{{{
compile 'fr.univ_artois.lgi2a:similar-microKernel:0.0.1'
}}}
!!Leiningen
{{{
[fr.univ_artois.lgi2a/similar-microKernel "0.0.1"]
}}}
!!SBT
{{{
libraryDependencies += "fr.univ_artois.lgi2a" %% "similar-microKernel" % "0.0.1"
}}}
/***
|Name|InlineJavascriptPlugin|
|Source|http://www.TiddlyTools.com/#InlineJavascriptPlugin|
|Documentation|http://www.TiddlyTools.com/#InlineJavascriptPluginInfo|
|Version|1.9.6|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|Insert Javascript executable code directly into your tiddler content.|
''Call directly into TW core utility routines, define new functions, calculate values, add dynamically-generated TiddlyWiki-formatted output'' into tiddler content, or perform any other programmatic actions each time the tiddler is rendered.
!!!!!Documentation
>see [[InlineJavascriptPluginInfo]]
!!!!!Revisions
<<<
2010.12.15 1.9.6 allow (but ignore) type="..." syntax
|please see [[InlineJavascriptPluginInfo]] for additional revision details|
2005.11.08 1.0.0 initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.InlineJavascriptPlugin= {major: 1, minor: 9, revision: 6, date: new Date(2010,12,15)};
config.formatters.push( {
name: "inlineJavascript",
match: "\\<script",
lookahead: "\\<script(?: type=\\\"[^\\\"]*\\\")?(?: src=\\\"([^\\\"]*)\\\")?(?: label=\\\"([^\\\"]*)\\\")?(?: title=\\\"([^\\\"]*)\\\")?(?: key=\\\"([^\\\"]*)\\\")?( show)?\\>((?:.|\\n)*?)\\</script\\>",
handler: function(w) {
var lookaheadRegExp = new RegExp(this.lookahead,"mg");
lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var src=lookaheadMatch[1];
var label=lookaheadMatch[2];
var tip=lookaheadMatch[3];
var key=lookaheadMatch[4];
var show=lookaheadMatch[5];
var code=lookaheadMatch[6];
if (src) { // external script library
var script = document.createElement("script"); script.src = src;
document.body.appendChild(script); document.body.removeChild(script);
}
if (code) { // inline code
if (show) // display source in tiddler
wikify("{{{\n"+lookaheadMatch[0]+"\n}}}\n",w.output);
if (label) { // create 'onclick' command link
var link=createTiddlyElement(w.output,"a",null,"tiddlyLinkExisting",wikifyPlainText(label));
var fixup=code.replace(/document.write\s*\(/gi,'place.bufferedHTML+=(');
link.code="function _out(place,tiddler){"+fixup+"\n};_out(this,this.tiddler);"
link.tiddler=w.tiddler;
link.onclick=function(){
this.bufferedHTML="";
try{ var r=eval(this.code);
if(this.bufferedHTML.length || (typeof(r)==="string")&&r.length)
var s=this.parentNode.insertBefore(document.createElement("span"),this.nextSibling);
if(this.bufferedHTML.length)
s.innerHTML=this.bufferedHTML;
if((typeof(r)==="string")&&r.length) {
wikify(r,s,null,this.tiddler);
return false;
} else return r!==undefined?r:false;
} catch(e){alert(e.description||e.toString());return false;}
};
link.setAttribute("title",tip||"");
var URIcode='javascript:void(eval(decodeURIComponent(%22(function(){try{';
URIcode+=encodeURIComponent(encodeURIComponent(code.replace(/\n/g,' ')));
URIcode+='}catch(e){alert(e.description||e.toString())}})()%22)))';
link.setAttribute("href",URIcode);
link.style.cursor="pointer";
if (key) link.accessKey=key.substr(0,1); // single character only
}
else { // run script immediately
var fixup=code.replace(/document.write\s*\(/gi,'place.innerHTML+=(');
var c="function _out(place,tiddler){"+fixup+"\n};_out(w.output,w.tiddler);";
try { var out=eval(c); }
catch(e) { out=e.description?e.description:e.toString(); }
if (out && out.length) wikify(out,w.output,w.highlightRegExp,w.tiddler);
}
}
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
}
}
} )
//}}}
// // Backward-compatibility for TW2.1.x and earlier
//{{{
if (typeof(wikifyPlainText)=="undefined") window.wikifyPlainText=function(text,limit,tiddler) {
if(limit > 0) text = text.substr(0,limit);
var wikifier = new Wikifier(text,formatter,null,tiddler);
return wikifier.wikifyPlain();
}
//}}}
// // GLOBAL FUNCTION: $(...) -- 'shorthand' convenience syntax for document.getElementById()
//{{{
if (typeof($)=='undefined') { function $(id) { return document.getElementById(id.replace(/^#/,'')); } }
//}}}
/***
|Name|InlineJavascriptPluginInfo|
|Source|http://www.TiddlyTools.com/#InlineJavascriptPlugin|
|Documentation|http://www.TiddlyTools.com/#InlineJavascriptPluginInfo|
|Version|1.9.6|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|documentation|
|Description|Documentation for InlineJavascriptPlugin|
''Call directly into TW core utility routines, define new functions, calculate values, add dynamically-generated TiddlyWiki-formatted output'' into tiddler content, or perform any other programmatic actions each time the tiddler is rendered.
!!!!!Usage
<<<
This plugin adds wiki syntax for surrounding tiddler content with {{{<script>}}} and {{{</script>}}} markers, so that it can be recognized as embedded javascript code. When a tiddler is rendered, the plugin automatically invokes any embedded scripts, which can be used to construct and return dynamically-generated output that is inserted into the tiddler content.
{{{
<script type="..." src="..." label="..." title="..." key="..." show>
/* javascript code goes here... */
</script>
}}}
All parameters are //optional//. When the ''show'' keyword is used, the plugin will also include the script source code in the output that it displays in the tiddler. This is helpful when creating examples for documentation purposes (such as used in this tiddler!)
__''Deferred execution from an 'onClick' link''__
<script label="click here" title="mouseover tooltip text" key="X" show>
/* javascript code goes here... */
alert('you clicked on the link!');
</script>
By including a {{{label="..."}}} parameter in the initial {{{<script>}}} marker, the plugin will create a link to an 'onclick' script that will only be executed when that specific link is clicked, rather than running the script each time the tiddler is rendered. You may also include a {{{title="..."}}} parameter to specify the 'tooltip' text that will appear whenever the mouse is moved over the onClick link text, and a {{{key="X"}}} parameter to specify an //access key// (which must be a //single// letter or numeric digit only).
__''Loading scripts from external source files''__
<script src="URL" show>
/* optional javascript code goes here... */
</script>You can also load javascript directly from an external source URL, by including a src="..." parameter in the initial {{{<script>}}} marker (e.g., {{{<script src="demo.js"></script>}}}). This is particularly useful when incorporating third-party javascript libraries for use in custom extensions and plugins. The 'foreign' javascript code remains isolated in a separate file that can be easily replaced whenever an updated library file becomes available.
In addition to loading the javascript from the external file, you can also use this feature to invoke javascript code contained within the {{{<script>...</script>}}} markers. This code is invoked //after// the external script file has been processed, and can make immediate use of the functions and/or global variables defined by the external script file.
>Note: To ensure that your javascript functions are always available when needed, you should load the libraries from a tiddler that is rendered as soon as your TiddlyWiki document is opened, such as MainMenu. For example: put your {{{<script src="..."></script>}}} syntax into a separate 'library' tiddler (e.g., LoadScripts), and then add {{{<<tiddler LoadScripts>>}}} to MainMenu so that the library is loaded before any other tiddlers that rely upon the functions it defines.
>
>Normally, loading external javascript in this way does not produce any direct output, and should not have any impact on the appearance of your MainMenu. However, if your LoadScripts tiddler contains notes or other visible content, you can suppress this output by using 'inline CSS' in the MainMenu, like this: {{{@@display:none;<<tiddler LoadScripts>>@@}}}
<<<
!!!!!Creating dynamic tiddler content and accessing the ~TiddlyWiki DOM
<<<
An important difference between TiddlyWiki inline scripting and conventional embedded javascript techniques for web pages is the method used to produce output that is dynamically inserted into the document: in a typical web document, you use the {{{document.write()}}} (or {{{document.writeln()}}}) function to output text sequences (often containing HTML tags) that are then rendered when the entire document is first loaded into the browser window.
However, in a ~TiddlyWiki document, tiddlers (and other DOM elements) are created, deleted, and rendered "on-the-fly", so writing directly to the global 'document' object does not produce the results you want (i.e., replacing the embedded script within the tiddler content), and instead will //completely replace the entire ~TiddlyWiki document in your browser window (which is clearly not a good thing!)//. In order to allow scripts to use {{{document.write()}}}, the plugin automatically converts and buffers all HTML output so it can be safely inserted into your tiddler content, immediately following the script.
''Note that {{{document.write()}}} can only be used to output "pure HTML" syntax. To produce //wiki-formatted// output, your script should instead return a text value containing the desired wiki-syntax content'', which will then be automatically rendered immediately following the script. If returning a text value is not sufficient for your needs, the plugin also provides an automatically-defined variable, 'place', that gives the script code ''direct access to the //containing DOM element//'' into which the tiddler output is being rendered. You can use this variable to ''perform direct DOM manipulations'' that can, for example:
* generate wiki-formatted output using {{{wikify("...content...",place)}}}
* vary the script's actions based upon the DOM element in which it is embedded
* access 'tiddler-relative' DOM information using {{{story.findContainingTiddler(place)}}}
Note:
''When using an 'onclick' script, the 'place' element actually refers to the onclick //link text// itself, instead of the containing DOM element.'' This permits you to directly reference or modify the link text to reflect any 'stateful' conditions that might set by the script. To refer to the containing DOM element from within an 'onclick' script, you can use "place.parentNode" instead.
<<<
!!!!!Instant "bookmarklets"
<<<
You can also use an 'onclick' link to define a "bookmarklet": a small piece of javascript that can be ''invoked directly from the browser without having to be defined within the current document.'' This allows you to create 'stand-alone' commands that can be applied to virtually ANY TiddlyWiki document... even remotely-hosted documents that have been written by others!! To create a bookmarklet, simply define an 'onclick' script and then grab the resulting link text and drag-and-drop it onto your browser's toolbar (or right-click and use the 'bookmark this link' command to add it to the browser's menu).
Notes:
*When writing scripts intended for use as bookmarklets, due to the ~URI-encoding required by the browser, ''you cannot not use ANY double-quotes (") within the bookmarklet script code.''
*All comments embedded in the bookmarklet script must ''use the fully-delimited {{{/* ... */}}} comment syntax,'' rather than the shorter {{{//}}} comment syntax.
*Most importantly, because bookmarklets are invoked directly from the browser interface and are not embedded within the TiddlyWiki document, there is NO containing 'place' DOM element surrounding the script. As a result, ''you cannot use a bookmarklet to generate dynamic output in your document,'' and using {{{document.write()}}} or returning wiki-syntax text or making reference to the 'place' DOM element will halt the script and report a "Reference Error" when that bookmarklet is invoked.
Please see [[InstantBookmarklets]] for many examples of 'onclick' scripts that can also be used as bookmarklets.
<<<
!!!!!Special reserved function name
<<<
The plugin 'wraps' all inline javascript code inside a function, {{{_out()}}}, so that any return value you provide can be correctly handled by the plugin and inserted into the tiddler. To avoid unpredictable results (and possibly fatal execution errors), this function should never be redefined or called from ''within'' your script code.
<<<
!!!!!$(...) 'shorthand' function
<<<
As described by Dustin Diaz [[here|http://www.dustindiaz.com/top-ten-javascript/]], the plugin defines a 'shorthand' function that allows you to write:
{{{
$(id)
}}}
in place of the normal standard javascript syntax:
{{{
document.getElementById(id)
}}}
This function is provided merely as a convenience for javascript coders that may be familiar with this abbreviation, in order to allow them to save a few bytes when writing their own inline script code.
<<<
!!!!!Examples
<<<
simple dynamic output:
><script show>
document.write("The current date/time is: "+(new Date())+"<br>");
return "link to current user: [["+config.options.txtUserName+"]]\n";
</script>
dynamic output using 'place' to get size information for current tiddler:
><script show>
if (!window.story) window.story=window;
var title=story.findContainingTiddler(place).getAttribute("tiddler");
var size=store.getTiddlerText(title).length;
return title+" is using "+size+" bytes";
</script>
dynamic output from an 'onclick' script, using {{{document.write()}}} and/or {{{return "..."}}}
><script label="click here" show>
document.write("<br>The current date/time is: "+(new Date())+"<br>");
return "link to current user: [["+config.options.txtUserName+"]]\n";
</script>
creating an 'onclick' button/link that accesses the link text AND the containing tiddler:
><script label="click here" title="clicking this link will show an 'alert' box" key="H" show>
if (!window.story) window.story=window;
var txt=place.firstChild.data;
var tid=story.findContainingTiddler(place).getAttribute('tiddler');
alert('Hello World!\nlinktext='+txt+'\ntiddler='+tid);
</script>
dynamically setting onclick link text based on stateful information:
>{{block{
{{{
<script label="click here">
/* toggle "txtSomething" value */
var on=(config.txtSomething=="ON");
place.innerHTML=on?"enable":"disable";
config.txtSomething=on?"OFF":"ON";
return "\nThe current value is: "+config.txtSomething;
</script><script>
/* initialize onclick link text based on current "txtSomething" value */
var on=(config.txtSomething=="ON");
place.lastChild.previousSibling.innerHTML=on?"disable":"enable";
</script>
}}}
<script label="click here">
/* toggle "txtSomething" value */
var on=(config.txtSomething=="ON");
place.innerHTML=on?"enable":"disable";
config.txtSomething=on?"OFF":"ON";
return "\nThe current value is: "+config.txtSomething;
</script><script>
/* initialize onclick link text based on current "txtSomething" value */
var on=(config.txtSomething=="ON");
place.lastChild.innerHTML=on?"enable":"disable";
</script>
}}}
loading a script from a source url:
>http://www.TiddlyTools.com/demo.js contains:
>>{{{function inlineJavascriptDemo() { alert('Hello from demo.js!!') } }}}
>>{{{displayMessage('InlineJavascriptPlugin: demo.js has been loaded');}}}
>note: When using this example on your local system, you will need to download the external script file from the above URL and install it into the same directory as your document.
>
><script src="demo.js" show>
return "inlineJavascriptDemo() function has been defined"
</script>
><script label="click to invoke inlineJavascriptDemo()" key="D" show>
inlineJavascriptDemo();
</script>
<<<
!!!!!Revisions
<<<
2010.12.15 1.9.6 allow (but ignore) type="..." syntax
2009.04.11 1.9.5 pass current tiddler object into wrapper code so it can be referenced from within 'onclick' scripts
2009.02.26 1.9.4 in $(), handle leading '#' on ID for compatibility with JQuery syntax
2008.06.11 1.9.3 added $(...) function as 'shorthand' for document.getElementById()
2008.03.03 1.9.2 corrected fallback declaration of wikifyPlainText() (fixes Safari "parse error")
2008.02.23 1.9.1 in onclick function, use string instead of array for 'bufferedHTML' (fixes IE errors)
2008.02.21 1.9.0 output from 'onclick' scripts (return value or document.write() calls) are now buffered and rendered into into a span following the script. Also, added default 'return false' handling if no return value provided (prevents HREF from being triggered -- return TRUE to allow HREF to be processed). Thanks to Xavier Verges for suggestion and preliminary code.
2008.02.14 1.8.1 added backward-compatibility for use of wikifyPlainText() in TW2.1.3 and earlier
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info tiddler
2007.12.28 1.8.0 added support for key="X" syntax to specify custom access key definitions
2007.12.15 1.7.0 autogenerate URI encoded HREF on links for onclick scripts. Drag links to browser toolbar to create bookmarklets. IMPORTANT NOTE: place is NOT defined when scripts are used as bookmarklets. In addition, double-quotes will cause syntax errors. Thanks to PaulReiber for debugging and brainstorming.
2007.11.26 1.6.2 when converting "document.write()" function calls in inline code, allow whitespace between "write" and "(" so that "document.write ( foobar )" is properly converted.
2007.11.16 1.6.1 when rendering "onclick scripts", pass label text through wikifyPlainText() to parse any embedded wiki-syntax to enable use of HTML entities or even TW macros to generate dynamic label text.
2007.02.19 1.6.0 added support for title="..." to specify mouseover tooltip when using an onclick (label="...") script
2006.10.16 1.5.2 add newline before closing '}' in 'function out_' wrapper. Fixes error caused when last line of script is a comment.
2006.06.01 1.5.1 when calling wikify() on script return value, pass hightlightRegExp and tiddler params so macros that rely on these values can render properly
2006.04.19 1.5.0 added 'show' parameter to force display of javascript source code in tiddler output
2006.01.05 1.4.0 added support 'onclick' scripts. When label="..." param is present, a button/link is created using the indicated label text, and the script is only executed when the button/link is clicked. 'place' value is set to match the clicked button/link element.
2005.12.13 1.3.1 when catching eval error in IE, e.description contains the error text, instead of e.toString(). Fixed error reporting so IE shows the correct response text. Based on a suggestion by UdoBorkowski
2005.11.09 1.3.0 for 'inline' scripts (i.e., not scripts loaded with src="..."), automatically replace calls to 'document.write()' with 'place.innerHTML+=' so script output is directed into tiddler content. Based on a suggestion by BradleyMeck
2005.11.08 1.2.0 handle loading of javascript from an external URL via src="..." syntax
2005.11.08 1.1.0 pass 'place' param into scripts to provide direct DOM access
2005.11.08 1.0.0 initial release
<<<
{{toparent{[[back to parent|../index.html]]<script>place.lastChild.target="_self";</script>}}}
''General''
----
*[[Index|Home]]
''Extended libs''
----
*[[Abstract classes|EL - Abstract implementations]]
*[[Generic classes|EL - Generic implementations]]
*[[End criteria|EL - End critera]]
*[[Time models|EL - Time models]]
/***
|''Name:''|MathJaxPlugin|
|''Description:''|Enable LaTeX formulas for TiddlyWiki|
|''Version:''|1.0.1|
|''Date:''|Feb 11, 2012|
|''Source:''|http://www.guyrutenberg.com/2011/06/25/latex-for-tiddlywiki-a-mathjax-plugin|
|''Author:''|Guy Rutenberg|
|''License:''|[[BSD open source license]]|
|''~CoreVersion:''|2.5.0|
!! Changelog
!!! 1.0.1 Feb 11, 2012
* Fixed interoperability with TiddlerBarPlugin
!! How to Use
Currently the plugin supports the following delemiters:
* """\(""".."""\)""" - Inline equations
* """$$""".."""$$""" - Displayed equations
* """\[""".."""\]""" - Displayed equations
!! Demo
This is an inline equation \(P(E) = {n \choose k} p^k (1-p)^{ n-k}\) and this is a displayed equation:
\[J_\alpha(x) = \sum_{m=0}^\infty \frac{(-1)^m}{m! \, \Gamma(m + \alpha + 1)}{\left({\frac{x}{2}}\right)}^{2 m + \alpha}\]
This is another displayed equation $$e=mc^2$$
!! Code
***/
//{{{
config.extensions.MathJax = {
mathJaxScript : "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML",
// uncomment the following line if you want to access MathJax using SSL
// mathJaxScript : "https://d3eoax9i5htok0.cloudfront.net/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML",
displayTiddler: function(TiddlerName) {
config.extensions.MathJax.displayTiddler_old.apply(this, arguments);
MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
}
};
jQuery.getScript(config.extensions.MathJax.mathJaxScript, function(){
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
"HTML-CSS": { scale: 100 }
});
MathJax.Hub.Startup.onload();
config.extensions.MathJax.displayTiddler_old = story.displayTiddler;
story.displayTiddler = config.extensions.MathJax.displayTiddler;
});
config.formatters.push({
name: "mathJaxFormula",
match: "\\\\\\[|\\$\\$|\\\\\\(",
//lookaheadRegExp: /(?:\\\[|\$\$)((?:.|\n)*?)(?:\\\]|$$)/mg,
handler: function(w)
{
switch(w.matchText) {
case "\\[": // displayed equations
this.lookaheadRegExp = /\\\[((?:.|\n)*?)(\\\])/mg;
break;
case "$$": // inline equations
this.lookaheadRegExp = /\$\$((?:.|\n)*?)(\$\$)/mg;
break;
case "\\(": // inline equations
this.lookaheadRegExp = /\\\(((?:.|\n)*?)(\\\))/mg;
break;
default:
break;
}
this.lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
createTiddlyElement(w.output,"span",null,null,lookaheadMatch[0]);
w.nextMatch = this.lookaheadRegExp.lastIndex;
}
}
});
//}}}
/***
|Name|NestedSlidersPlugin2|
|Source|http://www.TiddlyTools.com/#NestedSlidersPlugin|
|Documentation|http://www.TiddlyTools.com/#NestedSlidersPluginInfo|
|Version|2.4.9|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|show content in nest-able sliding/floating panels, without creating separate tiddlers for each panel's content|
!!!!!Documentation
>see [[NestedSlidersPluginInfo]]
!!!!!Configuration
<<<
<<option chkFloatingSlidersAnimate>> allow floating sliders to animate when opening/closing
>Note: This setting can cause 'clipping' problems in some versions of InternetExplorer.
>In addition, for floating slider animation to occur you must also allow animation in general (see [[AdvancedOptions]]).
<<<
!!!!!Revisions
<<<
2008.11.15 - 2.4.9 in adjustNestedSlider(), don't make adjustments if panel is marked as 'undocked' (CSS class). In onClickNestedSlider(), SHIFT-CLICK docks panel (see [[MoveablePanelPlugin]])
|please see [[NestedSlidersPluginInfo]] for additional revision details|
2005.11.03 - 1.0.0 initial public release. Thanks to RodneyGomes, GeoffSlocock, and PaulPetterson for suggestions and experiments.
<<<
!!!!!Code
***/
//{{{
version.extensions.NestedSlidersPlugin= {major: 2, minor: 4, revision: 9, date: new Date(2008,11,15)};
// options for deferred rendering of sliders that are not initially displayed
if (config.options.chkFloatingSlidersAnimate===undefined)
config.options.chkFloatingSlidersAnimate=false; // avoid clipping problems in IE
// default styles for 'floating' class
setStylesheet(".floatingPanel { position:absolute; z-index:10; padding:0.5em; margin:0em; \
background-color:#eee; color:#000; border:1px solid #000; text-align:left; }","floatingPanelStylesheet");
// if removeCookie() function is not defined by TW core, define it here.
if (window.removeCookie===undefined) {
window.removeCookie=function(name) {
document.cookie = name+'=; expires=Thu, 01-Jan-1970 00:00:01 UTC; path=/;';
}
}
config.formatters.push( {
name: "nestedSliders",
match: "\\n?\\+{3}",
terminator: "\\s*\\={3}\\n?",
lookahead: "\\n?\\+{3}(\\+)?(\\([^\\)]*\\))?(\\?)?(\\!*)?(\\^(?:[^\\^\\*\\@\\[\\>]*\\^)?)?(\\*)?(\\@)?(?:\\{\\{([\\w]+[\\s\\w]*)\\{)?(\\[[^\\]]*\\])?(\\[[^\\]]*\\])?(?:\\}{3})?(\\#[^:]*\\:)?(\\>)?(\\.\\.\\.)?\\s*",
handler: function(w)
{
lookaheadRegExp = new RegExp(this.lookahead,"mg");
lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart)
{
var defopen=lookaheadMatch[1];
var cookiename=lookaheadMatch[2];
var special=lookaheadMatch[3];
var header=lookaheadMatch[4];
var panelwidth=lookaheadMatch[5];
var transient=lookaheadMatch[6];
var hover=lookaheadMatch[7];
var buttonClass=lookaheadMatch[8];
var label=lookaheadMatch[9];
var openlabel=lookaheadMatch[10];
var panelID=lookaheadMatch[11];
var blockquote=lookaheadMatch[12];
var deferred=lookaheadMatch[13];
// location for rendering button and panel
var place=w.output;
// default to closed, no cookie, no accesskey, no alternate text/tip
var show="none"; var cookie=""; var key="";
var closedtext=">"; var closedtip="";
var openedtext="<"; var openedtip="";
// extra "+", default to open
if (defopen) show="block";
// cookie, use saved open/closed state
if (cookiename) {
cookie=cookiename.trim().slice(1,-1);
cookie="chkSlider"+cookie;
if (config.options[cookie]==undefined)
{ config.options[cookie] = (show=="block") }
show=config.options[cookie]?"block":"none";
}
// parse label/tooltip/accesskey: [label=X|tooltip]
if (label) {
var parts=label.trim().slice(1,-1).split("|");
closedtext=parts.shift();
if (closedtext.substr(closedtext.length-2,1)=="=")
{ key=closedtext.substr(closedtext.length-1,1); closedtext=closedtext.slice(0,-2); }
openedtext=closedtext;
if (parts.length) closedtip=openedtip=parts.join("|");
else { closedtip="show "+closedtext; openedtip="hide "+closedtext; }
} else {
buttonClass='expandbutton';
}
// parse alternate label/tooltip: [label|tooltip]
if (openlabel) {
var parts=openlabel.trim().slice(1,-1).split("|");
openedtext=parts.shift();
if (parts.length) openedtip=parts.join("|");
else openedtip="hide "+openedtext;
}
var title=show=='block'?openedtext:closedtext;
var tooltip=show=='block'?openedtip:closedtip;
// create the button
if (header) { // use "Hn" header format instead of button/link
var lvl=(header.length>5)?5:header.length;
var btn = createTiddlyElement(createTiddlyElement(place,"h"+lvl,null,null,null),"a",null,buttonClass,title);
btn.onclick=onClickNestedSlider;
btn.setAttribute("href","javascript:;");
btn.setAttribute("title",tooltip);
} else if(special) {
var btn = createTiddlyElement(createTiddlyElement(place,"a",null,null,null),"a",null,buttonClass,title);
btn.onclick=onClickNestedSlider;
btn.setAttribute("href","javascript:;");
btn.setAttribute("title",tooltip);
} else {
var btn = createTiddlyButton(place,title,tooltip,onClickNestedSlider,buttonClass);
}
btn.innerHTML=title; // enables use of HTML entities in label
// set extra button attributes
btn.setAttribute("closedtext",closedtext);
btn.setAttribute("closedtip",closedtip);
btn.setAttribute("openedtext",openedtext);
btn.setAttribute("openedtip",openedtip);
btn.sliderCookie = cookie; // save the cookiename (if any) in the button object
btn.defOpen=defopen!=null; // save default open/closed state (boolean)
btn.keyparam=key; // save the access key letter ("" if none)
if (key.length) {
btn.setAttribute("accessKey",key); // init access key
btn.onfocus=function(){this.setAttribute("accessKey",this.keyparam);}; // **reclaim** access key on focus
}
btn.setAttribute("hover",hover?"true":"false");
btn.onmouseover=function(ev) {
// optional 'open on hover' handling
if (this.getAttribute("hover")=="true" && this.sliderPanel.style.display=='none') {
document.onclick.call(document,ev); // close transients
onClickNestedSlider(ev); // open this slider
}
// mouseover on button aligns floater position with button
if (window.adjustSliderPos) window.adjustSliderPos(this.parentNode,this,this.sliderPanel);
}
// create slider panel
var panelClass=panelwidth?"floatingPanel":"sliderPanel";
if (panelID) panelID=panelID.slice(1,-1); // trim off delimiters
var panel=createTiddlyElement(place,"div",panelID,panelClass,null);
panel.button = btn; // so the slider panel know which button it belongs to
btn.sliderPanel=panel; // so the button knows which slider panel it belongs to
panel.defaultPanelWidth=(panelwidth && panelwidth.length>2)?panelwidth.slice(1,-1):"";
panel.setAttribute("transient",transient=="*"?"true":"false");
panel.style.display = show;
panel.style.width=panel.defaultPanelWidth;
panel.onmouseover=function(event) // mouseover on panel aligns floater position with button
{ if (window.adjustSliderPos) window.adjustSliderPos(this.parentNode,this.button,this); }
// render slider (or defer until shown)
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
if ((show=="block")||!deferred) {
// render now if panel is supposed to be shown or NOT deferred rendering
w.subWikify(blockquote?createTiddlyElement(panel,"blockquote"):panel,this.terminator);
// align floater position with button
if (window.adjustSliderPos) window.adjustSliderPos(place,btn,panel);
}
else {
var src = w.source.substr(w.nextMatch);
var endpos=findMatchingDelimiter(src,"+++","===");
panel.setAttribute("raw",src.substr(0,endpos));
panel.setAttribute("blockquote",blockquote?"true":"false");
panel.setAttribute("rendered","false");
w.nextMatch += endpos+3;
if (w.source.substr(w.nextMatch,1)=="\n") w.nextMatch++;
}
}
}
}
)
function findMatchingDelimiter(src,starttext,endtext) {
var startpos = 0;
var endpos = src.indexOf(endtext);
// check for nested delimiters
while (src.substring(startpos,endpos-1).indexOf(starttext)!=-1) {
// count number of nested 'starts'
var startcount=0;
var temp = src.substring(startpos,endpos-1);
var pos=temp.indexOf(starttext);
while (pos!=-1) { startcount++; pos=temp.indexOf(starttext,pos+starttext.length); }
// set up to check for additional 'starts' after adjusting endpos
startpos=endpos+endtext.length;
// find endpos for corresponding number of matching 'ends'
while (startcount && endpos!=-1) {
endpos = src.indexOf(endtext,endpos+endtext.length);
startcount--;
}
}
return (endpos==-1)?src.length:endpos;
}
//}}}
//{{{
window.onClickNestedSlider=function(e)
{
if (!e) var e = window.event;
var theTarget = resolveTarget(e);
while (theTarget && theTarget.sliderPanel==undefined) theTarget=theTarget.parentNode;
if (!theTarget) return false;
var theSlider = theTarget.sliderPanel;
var isOpen = theSlider.style.display!="none";
// if SHIFT-CLICK, dock panel first (see [[MoveablePanelPlugin]])
if (e.shiftKey && config.macros.moveablePanel) config.macros.moveablePanel.dock(theSlider,e);
// toggle label
theTarget.innerHTML=isOpen?theTarget.getAttribute("closedText"):theTarget.getAttribute("openedText");
// toggle tooltip
theTarget.setAttribute("title",isOpen?theTarget.getAttribute("closedTip"):theTarget.getAttribute("openedTip"));
// deferred rendering (if needed)
if (theSlider.getAttribute("rendered")=="false") {
var place=theSlider;
if (theSlider.getAttribute("blockquote")=="true")
place=createTiddlyElement(place,"blockquote");
wikify(theSlider.getAttribute("raw"),place);
theSlider.setAttribute("rendered","true");
}
// show/hide the slider
if(config.options.chkAnimate && (!hasClass(theSlider,'floatingPanel') || config.options.chkFloatingSlidersAnimate))
anim.startAnimating(new Slider(theSlider,!isOpen,e.shiftKey || e.altKey,"none"));
else
theSlider.style.display = isOpen ? "none" : "block";
// reset to default width (might have been changed via plugin code)
theSlider.style.width=theSlider.defaultPanelWidth;
// align floater panel position with target button
if (!isOpen && window.adjustSliderPos) window.adjustSliderPos(theSlider.parentNode,theTarget,theSlider);
// if showing panel, set focus to first 'focus-able' element in panel
if (theSlider.style.display!="none") {
var ctrls=theSlider.getElementsByTagName("*");
for (var c=0; c<ctrls.length; c++) {
var t=ctrls[c].tagName.toLowerCase();
if ((t=="input" && ctrls[c].type!="hidden") || t=="textarea" || t=="select")
{ try{ ctrls[c].focus(); } catch(err){;} break; }
}
}
var cookie=theTarget.sliderCookie;
if (cookie && cookie.length) {
config.options[cookie]=!isOpen;
if (config.options[cookie]!=theTarget.defOpen) window.saveOptionCookie(cookie);
else window.removeCookie(cookie); // remove cookie if slider is in default display state
}
// prevent SHIFT-CLICK from being processed by browser (opens blank window... yuck!)
// prevent clicks *within* a slider button from being processed by browser
// but allow plain click to bubble up to page background (to close transients, if any)
if (e.shiftKey || theTarget!=resolveTarget(e))
{ e.cancelBubble=true; if (e.stopPropagation) e.stopPropagation(); }
Popup.remove(); // close open popup (if any)
return false;
}
//}}}
//{{{
// click in document background closes transient panels
document.nestedSliders_savedOnClick=document.onclick;
document.onclick=function(ev) { if (!ev) var ev=window.event; var target=resolveTarget(ev);
if (document.nestedSliders_savedOnClick)
var retval=document.nestedSliders_savedOnClick.apply(this,arguments);
// if click was inside a popup... leave transient panels alone
var p=target; while (p) if (hasClass(p,"popup")) break; else p=p.parentNode;
if (p) return retval;
// if click was inside transient panel (or something contained by a transient panel), leave it alone
var p=target; while (p) {
if ((hasClass(p,"floatingPanel")||hasClass(p,"sliderPanel"))&&p.getAttribute("transient")=="true") break;
p=p.parentNode;
}
if (p) return retval;
// otherwise, find and close all transient panels...
var all=document.all?document.all:document.getElementsByTagName("DIV");
for (var i=0; i<all.length; i++) {
// if it is not a transient panel, or the click was on the button that opened this panel, don't close it.
if (all[i].getAttribute("transient")!="true" || all[i].button==target) continue;
// otherwise, if the panel is currently visible, close it by clicking it's button
if (all[i].style.display!="none") window.onClickNestedSlider({target:all[i].button})
if (!hasClass(all[i],"floatingPanel")&&!hasClass(all[i],"sliderPanel")) all[i].style.display="none";
}
return retval;
};
//}}}
//{{{
// adjust floating panel position based on button position
if (window.adjustSliderPos==undefined) window.adjustSliderPos=function(place,btn,panel) {
if (hasClass(panel,"floatingPanel") && !hasClass(panel,"undocked")) {
// see [[MoveablePanelPlugin]] for use of 'undocked'
var rightEdge=document.body.offsetWidth-1;
var panelWidth=panel.offsetWidth;
var left=0;
var top=btn.offsetHeight;
if (place.style.position=="relative" && findPosX(btn)+panelWidth>rightEdge) {
left-=findPosX(btn)+panelWidth-rightEdge; // shift panel relative to button
if (findPosX(btn)+left<0) left=-findPosX(btn); // stay within left edge
}
if (place.style.position!="relative") {
var left=findPosX(btn);
var top=findPosY(btn)+btn.offsetHeight;
var p=place; while (p && !hasClass(p,'floatingPanel')) p=p.parentNode;
if (p) { left-=findPosX(p); top-=findPosY(p); }
if (left+panelWidth>rightEdge) left=rightEdge-panelWidth;
if (left<0) left=0;
}
panel.style.left=left+"px"; panel.style.top=top+"px";
}
}
//}}}
//{{{
// TW2.1 and earlier:
// hijack Slider stop handler so overflow is visible after animation has completed
Slider.prototype.coreStop = Slider.prototype.stop;
Slider.prototype.stop = function()
{ this.coreStop.apply(this,arguments); this.element.style.overflow = "visible"; }
// TW2.2+
// hijack Morpher stop handler so sliderPanel/floatingPanel overflow is visible after animation has completed
if (version.major+.1*version.minor+.01*version.revision>=2.2) {
Morpher.prototype.coreStop = Morpher.prototype.stop;
Morpher.prototype.stop = function() {
this.coreStop.apply(this,arguments);
var e=this.element;
if (hasClass(e,"sliderPanel")||hasClass(e,"floatingPanel")) {
// adjust panel overflow and position after animation
e.style.overflow = "visible";
if (window.adjustSliderPos) window.adjustSliderPos(e.parentNode,e.button,e);
}
};
}
//}}}
/***
|Name|NestedSlidersPluginInfo|
|Source|http://www.TiddlyTools.com/#NestedSlidersPlugin|
|Documentation|http://www.TiddlyTools.com/#NestedSlidersPluginInfo|
|Version|2.4.9|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|documentation|
|Description|documentation for NestedSlidersPlugin|
This plugin adds new wiki syntax for embedding 'slider' panels directly into tiddler content.
!!!!!Usage
<<<
//{{{
++++(cookiename)!!!!!^width^*@{{class{[label=key|tooltip][altlabel|alttooltip]}}}#panelID:>...
content goes here
===
//}}}
* ''"""+++""" (or """++++""") and """==="""''<br>marks the start and end of the slider definition, respectively. When the extra {{{+}}} is used, the slider will be open when initially displayed.
* ''"""(cookiename)"""''<br>saves the slider opened/closed state, and restores this state whenever the slider is re-rendered.
* ''"""! through !!!!!"""''<br>displays the slider label using a formatted headline (Hn) style instead of a button/link style
* ''"""^width^ (or just ^)"""''<br>makes the slider 'float' on top of other content rather than shifting that content downward. 'width' must be a valid CSS value (e.g., "30em", "180px", "50%", etc.). If omitted, the default width is "auto" (i.e., fit to content)
* ''"""*"""''<br>denotes "transient display": when a click occurs elsewhere in the document, the slider/floating panel will be automatically closed. This is useful for creating 'pulldown menus' that automatically go away after they are used. //Note: using SHIFT-click on a slider label will open/close that slider without triggering the automatic closing of any transient slider panels that are currently displayed, permitting ''temporary'' display of several transient panels at once.//
* ''"""@"""''<br>denotes "open on hover": the slider/floating panel will be automatically opened as soon as the mouse moves over the slider label, without requiring a click.
* ''"""{{class{[label=key|tooltip][altlabel|alttooltip]}}}"""''<br>uses label/tooltip/accesskey. """{{class{...}}}""", """=key""", """|tooltip""" and """[altlabel|alttooltip]""" are optional. 'class' is any valid CSS class name, used to style the slider label text. 'key' must be a ''single letter only''. altlabel/alttooltip specify alternative label/tooltip for use when slider/floating panel is displayed. //Note: you can use HTML syntax within the label text to include HTML entities (e.g., {{{»}}} (») or {{{►}}} (►), or even embedded images (e.g., {{{<img src="images/eric3.gif">}}}).//
* ''"""#panelID:"""''<br>defines a unique DOM element ID that is assigned to the panel element used to display the slider content. This ID can then be used later to reposition the panel using the {{{<<DOM move id>>}}} macro (see [[DOMTweaksPlugin]]), or to access/modify the panel element through use of {{{document.getElementById(...)}}}) javascript code in a plugin or inline script.
* ''""">"""''<br>automatically adds blockquote formatting to slider content
* ''"""..."""''<br>defers rendering of closed sliders until the first time they are opened.
Notes:
*You can 'nest' sliders as deep as you like (see complex nesting example below), so that expandable 'tree-like' hierarchical displays can be created.
*Deferred rendering (...) can be used to offset processing overhead until actually needed. However, this may produce unexpected results in some cases. Use with care.
* To make slider definitions easier to read and recognize when editing a tiddler, newlines immediately following the 'start slider' or preceding the 'end slider' sequences are automatically supressed so that excess whitespace is eliminated from the output.
<<<
!!!!!Examples
<<<
simple in-line slider:
{{{
+++content===
}}}
+++content===
----
use a custom label and tooltip:
{{{
+++[label|tooltip]content===
}}}
+++[label|tooltip]content===
----
content automatically blockquoted:
{{{
+++>content===
}}}
+++>content===
----
all options (except cookie) //(default open, heading, sized floater, transient, open on hover, class, label/tooltip/key, blockquoted, deferred)//
{{{
++++!!!^30em^*@{{big{[label=Z|click or press Alt-Z to open]}}}>...
content
===
}}}
++++!!!^30em^*@{{big{[label=Z|click or press Alt-Z to open]}}}>...
content
===
----
complex nesting example:
{{{
+++[get info...=I|click for information or press Alt-I]
put some general information here,
plus a floating panel with more specific info:
+++^10em^[view details...|click for details]
put some detail here, which could in turn contain a transient panel,
perhaps with a +++^25em^*[glossary definition]explaining technical terms===
===
===
}}}
+++[get info...=I|click for information or press Alt-I]
put some general information here,
plus a floating panel with more specific info:
+++^10em^[view details...|click for details]
put some detail here, which could in turn contain a transient panel,
perhaps with a +++^25em^*[glossary definition]explaining technical terms===
===
===
----
embedded image as slider button
{{{
+++[<img src=images/eric3.gif>|click me!]>
{{big{OUCH!}}}
===
}}}
+++[<img src=images/eric3.gif>|click me!]>
{{big{OUCH!}}}
===
<<<
!!!!!Revisions
<<<
2008.11.15 2.4.9 in adjustNestedSlider(), don't make adjustments if panel is marked as 'undocked' (CSS class). In onClickNestedSlider(), SHIFT-CLICK docks panel (see [[MoveablePanelPlugin]])
2008.11.13 2.4.8 in document.onclick(), if transient panel is not a sliderPanel or floatingPanel, hide it via CSS
2008.10.05 2.4.7 in onClickNestedSlider(), added try/catch around focus() call to prevent IE error if input field being focused on is currently not visible.
2008.09.07 2.4.6 added removeCookie() function for compatibility with [[CookieManagerPlugin]]
2008.06.07 2.4.5 in 'onmouseover' handler for 'open on hover' slider buttons, use call() method when invoking document.onclick function (avoids error in IE)
2008.06.07 2.4.4 changed default for chkFloatingSlidersAnimate to FALSE to avoid clipping problem on some browsers (IE). Updated Morpher hijack (again) to adjust regular sliderPanel styles as well as floatingPanel styles.
2008.05.07 2.4.3 updated Morpher hijack to adjust floatingPanel styles after animation without affecting other animated elements (i.e. popups). Also, updated adjustSliderPos() to account for scrollwidth and use core findWindowWidth().
2008.04.02 2.4.2 in onClickNestedSlider, handle clicks on elements contained //within// slider buttons (e.g., when using HTML to display an image as a slider button).
2008.04.01 2.4.1 open on hover also triggers document.onclick to close other transient sliders
2008.04.01 2.4.0 re-introduced 'open on hover' feature using "@" symbol
2008.03.26 2.3.5 in document.onclick(), if click is in popup, don't dismiss transient panel (if any)
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info tiddler
2007.12.28 2.3.4 added hijack for Animator.prototype.startAnimating(). Previously, the plugin code simply set the overflow to "visible" after animation. This code tweak corrects handling of elements that were styled with overflow=hidden/auto/scroll before animation by saving the overflow style and then restoring it after animation has completed.
2007.12.17 2.3.3 use hasClass() instead of direct comparison to test for "floatingPanel" class. Allows floating panels to have additional classes assigned to them (i.e., by AnimationEffectsPlugin).
2007.11.14 2.3.2 in onClickNestedSlider(), prevent SHIFT-click events from opening a new, empty browser window by setting "cancelBubble=true" and calling "stopPropagation()". Note: SHIFT-click is still processed as a normal click (i.e., it toggles the slider panel display). Also, using SHIFT-click will prevent 'transient' sliders from being automatically closed when another slider is opened, allowing you to *temporarily* display several transient sliders at once.
2007.07.26 2.3.1 in document.onclick(), propagate return value from hijacked core click handler to consume OR bubble up click as needed. Fixes "IE click disease", whereby nearly every mouse click causes a page transition.
2007.07.20 2.3.0 added syntax for setting panel ID (#panelID:). This allows individual slider panels to be repositioned within tiddler content simply by giving them a unique ID and then moving them to the desired location using the {{{<<DOM move id>>}}} macro.
2007.07.19 2.2.0 added syntax for alttext and alttip (button label and tooltip to be displayed when panel is open)
2007.07.14 2.1.2 corrected use of 'transient' attribute in IE to prevent (non-recursive) infinite loop
2007.07.12 2.1.0 replaced use of "*" for 'open/close on rollover' (which didn't work too well). "*" now indicates 'transient' panels that are automatically closed if a click occurs somewhere else in the document. This permits use of nested sliders to create nested "pulldown menus" that automatically disappear after interaction with them has been completed. Also, in onClickNestedSlider(), use "theTarget.sliderCookie", instead of "this.sliderCookie" to correct cookie state tracking when automatically dismissing transient panels.
2007.06.10 2.0.5 add check to ensure that window.adjustSliderPanel() is defined before calling it (prevents error on shutdown when mouse event handlers are still defined)
2007.05.31 2.0.4 add handling to invoke adjustSliderPanel() for onmouseover events on slider button and panel. This allows the panel position to be re-synced when the button position shifts due to changes in unrelated content above it on the page. (thanks to Harsha for bug report)
2007.03.30 2.0.3 added chkFloatingSlidersAnimate (default to FALSE), so that slider animation can be disabled independent of the overall document animation setting (avoids strange rendering and focus problems in floating panels)
2007.03.01 2.0.2 for TW2.2+, hijack Morpher.prototype.stop so that "overflow:hidden" can be reset to "overflow:visible" after animation ends
2007.03.01 2.0.1 in hijack for Slider.prototype.stop, use apply() to pass params to core function
2006.07.28 2.0.0 added custom class syntax around label/tip/key syntax: {{{{{classname{[label=key|tip]}}}}}}
2006.07.25 1.9.3 when parsing slider, save default open/closed state in button element, then in onClickNestedSlider(), if slider state matches saved default, instead of saving cookie, delete it. Significantly reduces the 'cookie overhead' when default slider states are used.
2006.06.29 1.9.2 in onClickNestedSlider(), when setting focus to first control, skip over type="hidden"
2006.06.22 1.9.1 added panel.defaultPanelWidth to save requested panel width, even after resizing has changed the style value
2006.05.11 1.9.0 added optional '^width^' syntax for floating sliders and '=key' syntax for setting an access key on a slider label
2006.05.09 1.8.0 in onClickNestedSlider(), when showing panel, set focus to first child input/textarea/select element
2006.04.24 1.7.8 in adjustSliderPos(), if floating panel is contained inside another floating panel, subtract offset of containing panel to find correct position
2006.02.16 1.7.7 corrected deferred rendering to account for use-case where show/hide state is tracked in a cookie
2006.02.15 1.7.6 in adjustSliderPos(), ensure that floating panel is positioned completely within the browser window (i.e., does not go beyond the right edge of the browser window)
2006.02.04 1.7.5 add 'var' to unintended global variable declarations to avoid FireFox 1.5.0.1 crash bug when assigning to globals
2006.01.18 1.7.4 only define adjustSliderPos() function if it has not already been provided by another plugin. This lets other plugins 'hijack' the function even when they are loaded first.
2006.01.16 1.7.3 added adjustSliderPos(place,btn,panel,panelClass) function to permit specialized logic for placement of floating panels. While it provides improved placement for many uses of floating panels, it exhibits a relative offset positioning error when used within *nested* floating panels. Short-term workaround is to only adjust the position for 'top-level' floaters.
2006.01.16 1.7.2 added button property to slider panel elements so that slider panel can tell which button it belongs to. Also, re-activated and corrected animation handling so that nested sliders aren't clipped by hijacking Slider.prototype.stop so that "overflow:hidden" can be reset to "overflow:visible" after animation ends
2006.01.14 1.7.1 added optional "^" syntax for floating panels. Defines new CSS class, ".floatingPanel", as an alternative for standard in-line ".sliderPanel" styles.
2006.01.14 1.7.0 added optional "*" syntax for rollover handling to show/hide slider without requiring a click (Based on a suggestion by tw4efl)
2006.01.03 1.6.2 When using optional "!" heading style, instead of creating a clickable "Hn" element, create an "A" element inside the "Hn" element. (allows click-through in SlideShowPlugin, which captures nearly all click events, except for hyperlinks)
2005.12.15 1.6.1 added optional "..." syntax to invoke deferred ('lazy') rendering for initially hidden sliders
removed checkbox option for 'global' application of lazy sliders
2005.11.25 1.6.0 added optional handling for 'lazy sliders' (deferred rendering for initially hidden sliders)
2005.11.21 1.5.1 revised regular expressions: if present, a single newline //preceding// and/or //following// a slider definition will be suppressed so start/end syntax can be place on separate lines in the tiddler 'source' for improved readability. Similarly, any whitespace (newlines, tabs, spaces, etc.) trailing the 'start slider' syntax or preceding the 'end slider' syntax is also suppressed.
2005.11.20 1.5.0 added (cookiename) syntax for optional tracking and restoring of slider open/close state
2005.11.11 1.4.0 added !!!!! syntax to render slider label as a header (Hn) style instead of a button/link style
2005.11.07 1.3.0 removed alternative syntax {{{(((}}} and {{{)))}}} (so they can be used by other formatting extensions) and simplified/improved regular expressions to trim multiple excess newlines
2005.11.05 1.2.1 changed name to NestedSlidersPlugin
2005.11.04 1.2.0 added alternative character-mode syntax {{{(((}}} and {{{)))}}}
tweaked "eat newlines" logic for line-mode {{{+++}}} and {{{===}}} syntax
2005.11.03 1.1.1 fixed toggling of default tooltips ("more..." and "less...") when a non-default button label is used. code cleanup, added documentation
2005.11.03 1.1.0 changed delimiter syntax from {{{(((}}} and {{{)))}}} to {{{+++}}} and {{{===}}}. changed name to EasySlidersPlugin
2005.11.03 1.0.0 initial public release
<<<
<!--{{{-->
<div id='header' class='header'>
<div class='headerShadow'>
<span class='searchBar' macro='search'></span>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div id='topMenu' refresh='content'></div>
</div>
<div id='displayArea'>
<div id='leftMenu' refresh='content' tiddler='MainMenu'></div>
<div id='messageArea'></div>
<div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>
<div id='tiddlerDisplay'></div>
</div>
<div id='contentFooter' refresh='content' tiddler='contentFooter'></div>
<!--}}}-->
!Project Dependencies
The following is a list of dependencies for this project. These dependencies are required to compile and use the application.
!!test
The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:
|!GroupId |!ArtifactId |!Version |!Type |!License |
|junit |[[junit|http://junit.org/]] |4.11 |jar |[[Common Public License Version 1.0|http://opensource.org/licenses/cpl1.0.txt]] |
|org.hamcrest |hamcrest-all |1.3 |jar |[[New BSD License|http://opensource.org/licenses/bsd-license.php]] |
!Project Transitive Dependencies
The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.
!!test
The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:
|!GroupId |!ArtifactId |!Version |!Type |!License |
|org.hamcrest |hamcrest-core |1.3 |jar |[[New BSD License|http://opensource.org/licenses/bsd-license.php]] |
!Project Dependency Graph
!!Dependency Tree
*fr.univ_artois.lgi2a:similar-microKernel:jar:0.0.1+++
|>|!SIMILAR - Micro kernel|
|''Description:'' |A micro kernel containing the minimal specification of SIMILAR, supporting the design of efficient simulations. |
|''Project License:'' |[[CeCILL-B Free Software License Agreement|http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt]] |
===
**org.hamcrest:hamcrest-all:jar:1.3 (test)+++
|>|!Hamcrest All |
|''Description:'' |A self-contained hamcrest jar containing all of the sub-modules in a single artifact. |
|''Project License:'' |[[New BSD License|http://opensource.org/licenses/bsd-license.php]] |
===
**junit:junit:jar:4.11 (test)+++
|>|!JUnit |
|''Description:'' |JUnit is a regression testing framework written by Erich Gamma and Kent Beck. It is used by the developer who implements unit tests in Java. |
|''Project License:'' |[[Common Public License Version 1.0|http://opensource.org/licenses/cpl1.0.txt]] |
===
***org.hamcrest:hamcrest-core:jar:1.3 (test)+++
|>|!Hamcrest Core |
|''Description:'' |This is the core API of hamcrest matcher framework to be used by third-party framework providers. This includes the a foundation set of matcher implementations for common operations. |
|''Project License:'' |[[New BSD License|http://opensource.org/licenses/bsd-license.php]] |
===
!Licenses
''New BSD License:'' Hamcrest All, Hamcrest Core
''Common Public License Version 1.0:'' JUnit
''CeCILL-B Free Software License Agreement:'' SIMILAR - Micro kernel
This software is governed by the CeCILL-B license under French law and abiding by the rules of distribution of free software. You can use, modify and/ or redistribute the software under the terms of the CeCILL-B license as circulated by CEA, CNRS and INRIA at the following URL http://www.cecill.info.
As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license, users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.
In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software, that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured and, more generally, to use and operate it in the same conditions as regards security.
The fact that you are presently reading this means that you have had knowledge of the CeCILL-B license and that you accept its terms.
!CeCILL-B Free Software License Agreement
<<<
<html><object width='100%' height="500" type='text/plain' data='files/licence.txt' border='0' ></object></html>
<<<
/***
|''Name''|SimpleSearchPlugin|
|''Description''|displays search results as a simple list of matching tiddlers|
|''Authors''|FND|
|''Version''|0.4.1|
|''Status''|stable|
|''Source''|http://devpad.tiddlyspot.com/#SimpleSearchPlugin|
|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/contributors/FND/plugins/SimpleSearchPlugin.js|
|''License''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''Keywords''|search|
!Revision History
!!v0.2.0 (2008-08-18)
* initial release
!!v0.3.0 (2008-08-19)
* added Open All button (renders Classic Search option obsolete)
* sorting by relevance (title matches before content matches)
!!v0.4.0 (2008-08-26)
* added tag matching
!To Do
* tag matching optional
* animations for container creation and removal
* when clicking on search results, do not scroll to the respective tiddler (optional)
* use template for search results
!Code
***/
//{{{
if(!version.extensions.SimpleSearchPlugin) { //# ensure that the plugin is only installed once
version.extensions.SimpleSearchPlugin = { installed: true };
if(!config.extensions) { config.extensions = {}; }
config.extensions.SimpleSearchPlugin = {
heading: "Search Results",
containerId: "searchResults",
btnCloseLabel: "close",
btnCloseTooltip: "dismiss search results",
btnCloseId: "search_close",
btnOpenLabel: "Open all",
btnOpenTooltip: "open all search results",
btnOpenId: "search_open",
displayResults: function(matches, query) {
story.refreshAllTiddlers(true); // update highlighting within story tiddlers
var el = document.getElementById(this.containerId);
query = '"""' + query + '"""'; // prevent WikiLinks
if(el) {
removeChildren(el);
} else { //# fallback: use displayArea as parent
var container = document.getElementById("displayArea");
el = document.createElement("div");
el.id = this.containerId;
el = container.insertBefore(el, container.firstChild);
}
var msg = "!" + this.heading + "\n";
if(matches.length > 0) {
msg += "''" + config.macros.search.successMsg.format([matches.length.toString(), query]) + ":''\n";
this.results = [];
for(var i = 0 ; i < matches.length; i++) {
this.results.push(matches[i].title);
msg += "* [[" + matches[i].title + "]]\n";
}
} else {
msg += "''" + config.macros.search.failureMsg.format([query]) + "''"; // XXX: do not use bold here!?
}
createTiddlyButton(el, this.btnCloseLabel, this.btnCloseTooltip, config.extensions.SimpleSearchPlugin.closeResults, "button", this.btnCloseId);
wikify(msg, el);
if(matches.length > 0) { // XXX: redundant!?
createTiddlyButton(el, this.btnOpenLabel, this.btnOpenTooltip, config.extensions.SimpleSearchPlugin.openAll, "button", this.btnOpenId);
}
},
closeResults: function() {
var el = document.getElementById(config.extensions.SimpleSearchPlugin.containerId);
removeNode(el);
config.extensions.SimpleSearchPlugin.results = null;
highlightHack = null;
},
openAll: function(ev) {
story.displayTiddlers(null, config.extensions.SimpleSearchPlugin.results);
return false;
}
};
config.shadowTiddlers.StyleSheetSimpleSearch = "/*{{{*/\n" +
"#" + config.extensions.SimpleSearchPlugin.containerId + " {\n" +
"\toverflow: auto;\n" +
"\tpadding: 5px 1em 10px;\n" +
"\tbackground-color: [[ColorPalette::TertiaryPale]];\n" +
"}\n\n" +
"#" + config.extensions.SimpleSearchPlugin.containerId + " h1 {\n" +
"\tmargin-top: 0;\n" +
"\tborder: none;\n" +
"}\n\n" +
"#" + config.extensions.SimpleSearchPlugin.containerId + " ul {\n" +
"\tmargin: 0.5em;\n" +
"\tpadding-left: 1.5em;\n" +
"}\n\n" +
"#" + config.extensions.SimpleSearchPlugin.containerId + " .button {\n" +
"\tdisplay: block;\n" +
"\tborder-color: [[ColorPalette::TertiaryDark]];\n" +
"\tpadding: 5px;\n" +
"\tbackground-color: [[ColorPalette::TertiaryLight]];\n" +
"}\n\n" +
"#" + config.extensions.SimpleSearchPlugin.containerId + " .button:hover {\n" +
"\tborder-color: [[ColorPalette::SecondaryMid]];\n" +
"\tbackground-color: [[ColorPalette::SecondaryLight]];\n" +
"}\n\n" +
"#" + config.extensions.SimpleSearchPlugin.btnCloseId + " {\n" +
"\tfloat: right;\n" +
"\tmargin: -5px -1em 5px 5px;\n" +
"}\n\n" +
"#" + config.extensions.SimpleSearchPlugin.btnOpenId + " {\n" +
"\tfloat: left;\n" +
"\tmargin-top: 5px;\n" +
"}\n" +
"/*}}}*/";
store.addNotification("StyleSheetSimpleSearch", refreshStyles);
// override Story.search()
Story.prototype.search = function(text, useCaseSensitive, useRegExp) {
highlightHack = new RegExp(useRegExp ? text : text.escapeRegExp(), useCaseSensitive ? "mg" : "img");
var matches = store.search(highlightHack, null, "excludeSearch");
var q = useRegExp ? "/" : "'";
config.extensions.SimpleSearchPlugin.displayResults(matches, q + text + q);
};
// override TiddlyWiki.search() to sort by relevance
TiddlyWiki.prototype.search = function(searchRegExp, sortField, excludeTag, match) {
var candidates = this.reverseLookup("tags", excludeTag, !!match);
var primary = [];
var secondary = [];
var tertiary = [];
for(var t = 0; t < candidates.length; t++) {
if(candidates[t].title.search(searchRegExp) != -1) {
primary.push(candidates[t]);
} else if(candidates[t].tags.join(" ").search(searchRegExp) != -1) {
secondary.push(candidates[t]);
} else if(candidates[t].text.search(searchRegExp) != -1) {
tertiary.push(candidates[t]);
}
}
var results = primary.concat(secondary).concat(tertiary);
if(sortField) {
results.sort(function(a, b) {
return a[sortField] < b[sortField] ? -1 : (a[sortField] == b[sortField] ? 0 : +1);
});
}
return results;
};
} //# end of "install only once"
//}}}
/***
|Name|SinglePageModePlugin|
|Source|http://www.TiddlyTools.com/#SinglePageModePlugin|
|Documentation|http://www.TiddlyTools.com/#SinglePageModePluginInfo|
|Version|2.9.7|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|Show tiddlers one at a time with automatic permalink, or always open tiddlers at top/bottom of page.|
This plugin allows you to configure TiddlyWiki to navigate more like a traditional multipage web site with only one tiddler displayed at a time.
!!!!!Documentation
>see [[SinglePageModePluginInfo]]
!!!!!Configuration
<<<
<<option chkSinglePageMode>> Display one tiddler at a time
><<option chkSinglePagePermalink>> Automatically permalink current tiddler
><<option chkSinglePageKeepFoldedTiddlers>> Don't close tiddlers that are folded
><<option chkSinglePageKeepEditedTiddlers>> Don't close tiddlers that are being edited
<<option chkTopOfPageMode>> Open tiddlers at the top of the page
<<option chkBottomOfPageMode>> Open tiddlers at the bottom of the page
<<option chkSinglePageAutoScroll>> Automatically scroll tiddler into view (if needed)
Notes:
* The "display one tiddler at a time" option can also be //temporarily// set/reset by including a 'paramifier' in the document URL: {{{#SPM:true}}} or {{{#SPM:false}}}.
* If more than one display mode is selected, 'one at a time' display takes precedence over both 'top' and 'bottom' settings, and if 'one at a time' setting is not used, 'top of page' takes precedence over 'bottom of page'.
* When using Apple's Safari browser, automatically setting the permalink causes an error and is disabled.
<<<
!!!!!Revisions
<<<
2010.11.30 2.9.7 use story.getTiddler()
2008.10.17 2.9.6 changed chkSinglePageAutoScroll default to false
| Please see [[SinglePageModePluginInfo]] for previous revision details |
2005.08.15 1.0.0 Initial Release. Support for BACK/FORWARD buttons adapted from code developed by Clint Checketts.
<<<
!!!!!Code
***/
//{{{
version.extensions.SinglePageModePlugin= {major: 2, minor: 9, revision: 7, date: new Date(2010,11,30)};
//}}}
//{{{
config.paramifiers.SPM = { onstart: function(v) {
config.options.chkSinglePageMode=eval(v);
if (config.options.chkSinglePageMode && config.options.chkSinglePagePermalink && !config.browser.isSafari) {
config.lastURL = window.location.hash;
if (!config.SPMTimer) config.SPMTimer=window.setInterval(function() {checkLastURL();},1000);
}
} };
//}}}
//{{{
if (config.options.chkSinglePageMode==undefined)
config.options.chkSinglePageMode=false;
if (config.options.chkSinglePagePermalink==undefined)
config.options.chkSinglePagePermalink=true;
if (config.options.chkSinglePageKeepFoldedTiddlers==undefined)
config.options.chkSinglePageKeepFoldedTiddlers=false;
if (config.options.chkSinglePageKeepEditedTiddlers==undefined)
config.options.chkSinglePageKeepEditedTiddlers=false;
if (config.options.chkTopOfPageMode==undefined)
config.options.chkTopOfPageMode=false;
if (config.options.chkBottomOfPageMode==undefined)
config.options.chkBottomOfPageMode=false;
if (config.options.chkSinglePageAutoScroll==undefined)
config.options.chkSinglePageAutoScroll=false;
//}}}
//{{{
config.SPMTimer = 0;
config.lastURL = window.location.hash;
function checkLastURL()
{
if (!config.options.chkSinglePageMode)
{ window.clearInterval(config.SPMTimer); config.SPMTimer=0; return; }
if (config.lastURL == window.location.hash) return; // no change in hash
var tids=decodeURIComponent(window.location.hash.substr(1)).readBracketedList();
if (tids.length==1) // permalink (single tiddler in URL)
story.displayTiddler(null,tids[0]);
else { // restore permaview or default view
config.lastURL = window.location.hash;
if (!tids.length) tids=store.getTiddlerText("DefaultTiddlers").readBracketedList();
story.closeAllTiddlers();
story.displayTiddlers(null,tids);
}
}
if (Story.prototype.SPM_coreDisplayTiddler==undefined)
Story.prototype.SPM_coreDisplayTiddler=Story.prototype.displayTiddler;
Story.prototype.displayTiddler = function(srcElement,tiddler,template,animate,slowly)
{
var title=(tiddler instanceof Tiddler)?tiddler.title:tiddler;
var tiddlerElem=story.getTiddler(title); // ==null unless tiddler is already displayed
var opt=config.options;
var single=opt.chkSinglePageMode && !startingUp;
var top=opt.chkTopOfPageMode && !startingUp;
var bottom=opt.chkBottomOfPageMode && !startingUp;
if (single) {
story.forEachTiddler(function(tid,elem) {
// skip current tiddler and, optionally, tiddlers that are folded.
if ( tid==title
|| (opt.chkSinglePageKeepFoldedTiddlers && elem.getAttribute("folded")=="true"))
return;
// if a tiddler is being edited, ask before closing
if (elem.getAttribute("dirty")=="true") {
if (opt.chkSinglePageKeepEditedTiddlers) return;
// if tiddler to be displayed is already shown, then leave active tiddler editor as is
// (occurs when switching between view and edit modes)
if (tiddlerElem) return;
// otherwise, ask for permission
var msg="'"+tid+"' is currently being edited.\n\n";
msg+="Press OK to save and close this tiddler\nor press Cancel to leave it opened";
if (!confirm(msg)) return; else story.saveTiddler(tid);
}
story.closeTiddler(tid);
});
}
else if (top)
arguments[0]=null;
else if (bottom)
arguments[0]="bottom";
if (single && opt.chkSinglePagePermalink && !config.browser.isSafari) {
window.location.hash = encodeURIComponent(String.encodeTiddlyLink(title));
config.lastURL = window.location.hash;
document.title = wikifyPlain("SiteTitleText") + " - " + title;
if (!config.SPMTimer) config.SPMTimer=window.setInterval(function() {checkLastURL();},1000);
}
if (tiddlerElem && tiddlerElem.getAttribute("dirty")=="true") { // editing... move tiddler without re-rendering
var isTopTiddler=(tiddlerElem.previousSibling==null);
if (!isTopTiddler && (single || top))
tiddlerElem.parentNode.insertBefore(tiddlerElem,tiddlerElem.parentNode.firstChild);
else if (bottom)
tiddlerElem.parentNode.insertBefore(tiddlerElem,null);
else this.SPM_coreDisplayTiddler.apply(this,arguments); // let CORE render tiddler
} else
this.SPM_coreDisplayTiddler.apply(this,arguments); // let CORE render tiddler
var tiddlerElem=story.getTiddler(title);
if (tiddlerElem&&opt.chkSinglePageAutoScroll) {
// scroll to top of page or top of tiddler
var isTopTiddler=(tiddlerElem.previousSibling==null);
var yPos=isTopTiddler?0:ensureVisible(tiddlerElem);
// if animating, defer scroll until after animation completes
var delay=opt.chkAnimate?config.animDuration+10:0;
setTimeout("window.scrollTo(0,"+yPos+")",delay);
}
}
if (Story.prototype.SPM_coreDisplayTiddlers==undefined)
Story.prototype.SPM_coreDisplayTiddlers=Story.prototype.displayTiddlers;
Story.prototype.displayTiddlers = function() {
// suspend single/top/bottom modes when showing multiple tiddlers
var opt=config.options;
var saveSPM=opt.chkSinglePageMode; opt.chkSinglePageMode=false;
var saveTPM=opt.chkTopOfPageMode; opt.chkTopOfPageMode=false;
var saveBPM=opt.chkBottomOfPageMode; opt.chkBottomOfPageMode=false;
this.SPM_coreDisplayTiddlers.apply(this,arguments);
opt.chkBottomOfPageMode=saveBPM;
opt.chkTopOfPageMode=saveTPM;
opt.chkSinglePageMode=saveSPM;
}
//}}}
/***
|Name|SinglePageModePluginInfo|
|Source|http://www.TiddlyTools.com/#SinglePageModePlugin|
|Documentation|http://www.TiddlyTools.com/#SinglePageModePluginInfo|
|Version|2.9.6|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|documentation|
|Description|Documentation for SinglePageModePlugin|
Normally, as you click on the links in TiddlyWiki, more and more tiddlers are displayed on the page. The order of this tiddler display depends upon when and where you have clicked. Some people like this non-linear method of reading the document, while others have reported that when many tiddlers have been opened, it can get somewhat confusing. SinglePageModePlugin allows you to configure TiddlyWiki to navigate more like a traditional multipage web site with only one item displayed at a time.
!!!!!Usage
<<<
When the plugin is enabled, only one tiddler will be displayed at a time and the browser window's titlebar is updated to include the current tiddler title. The browser's location URL is also updated with a 'permalink' for the current tiddler so that it is easier to create a browser 'bookmark' for the current tiddler. Alternatively, even when displaying multiple tiddlers //is// permitted, you can still reduce the potential for confusion by forcing tiddlers to always open at the top (or bottom) of the page instead of being displayed following the tiddler containing the link that was clicked.
<<<
!!!!!Configuration
<<<
<<option chkSinglePageMode>> Display one tiddler at a time
><<option chkSinglePagePermalink>> Automatically permalink current tiddler
><<option chkSinglePageKeepFoldedTiddlers>> Don't close tiddlers that are folded
><<option chkSinglePageKeepEditedTiddlers>> Don't close tiddlers that are being edited
<<option chkTopOfPageMode>> Open tiddlers at the top of the page
<<option chkBottomOfPageMode>> Open tiddlers at the bottom of the page
<<option chkSinglePageAutoScroll>> Automatically scroll tiddler into view (if needed)
Notes:
* {{block{
The "display one tiddler at a time" option can also be //temporarily// set/reset by including a 'paramifier' in the document URL: {{{#SPM:true}}} or {{{#SPM:false}}}. You can also use {{{SPM:expression}}}, where 'expression' is any javascript statement that evaluates to true or false. This allows you to create hard-coded links in other documents that can selectively enable/disable the use of this option based on various programmatic conditions, such as the current username. For example, using
{{{#SPM:config.options.txtUserName!="SomeName"}}}
enables 'one tiddler at a time' display for all users //other than// "~SomeName")}}}
* If more than one display mode is selected, 'one at a time' display takes precedence over both 'top' and 'bottom' settings, and if 'one at a time' setting is not used, 'top of page' takes precedence over 'bottom of page'.
* When using Apple's Safari browser, automatically setting the permalink causes an error and is disabled.
<<<
!!!!!Revisions
<<<
2008.10.17 2.9.6 changed chkSinglePageAutoScroll default to false
2008.06.12 2.9.5 corrected 'scroll to top of page' logic in auto-scroll handling
2008.06.11 2.9.4 added chkSinglePageKeepEditedTiddlers option
2008.06.05 2.9.3 in displayTiddler(), bypass single/top/bottom mode handling if startingUp. Allows multiple tiddlers to be displayed during startup processing (e.g., #story:DefaultTiddlers), even if single/top/bottom mode is enabled.
2008.04.18 2.9.2 in displayTiddler() and checkLastURL(), handling for Unicode in tiddler titles (remove explicit conversion between Unicode and UTF, as this is apparently done automatically by encode/decodeURIComponent, resulting in double-encoding!
2008.04.08 2.9.1 don't automatically add options to AdvancedOptions shadow tiddler
2008.04.02 2.9.0 in displayTiddler(), when single-page mode is in use and a tiddler is being edited, ask for permission to save-and-close that tiddler, instead of just leaving it open.
2008.03.29 2.8.3 in displayTiddler(), get title from tiddler object (if needed). Fixes errors caused when calling function passes a tiddler *object* instead of a tiddler *title*
2008.03.14 2.8.2 in displayTiddler(), if editing specified tiddler, just move it to top/bottom of story *without* re-rendering (prevents discard of partial edits).
2008.03.06 2.8.1 in paramifier handler, start 'checkURL' timer if chkSinglePageMode is enabled
2008.03.06 2.8.0 added option, {{{config.options.chkSinglePageKeepFoldedTiddlers}}}, so folded tiddlers won't be closed when using single-page mode. Also, in checkURL(), if hash is a ''permaview'' (e.g., "#foo bar baz"), then display multiple tiddlers rather than attempting to display "foo bar baz" as a single tiddler
2008.03.05 2.7.0 added support for "SPM:" URL paramifier
2008.03.01 2.6.0 in hijack of displayTiddler(), added 'title' argument to closeAllTiddlers() so that target tiddler isn't closed-and-reopened if it was already displayed. Also, added config.options.chkSinglePageAutoScrolloption to bypass automatic 'scroll into view' logic (note: core still does it's own ensureVisible() handling)
2007.12.22 2.5.3 in checkLastURL(), use decodeURIComponent() instead of decodeURI so that tiddler titles with commas (and/or other punctuation) are correctly handled.
2007.10.26 2.5.2 documentation cleanup
2007.10.08 2.5.1 in displayTiddler(), when using single-page or top-of-page mode, scrollTo(0,0) to ensure that page header is in view.
2007.09.13 2.5.0 for TPM/BPM modes, don't force tiddler to redisplay if already shown. Allows transition between view/edit or collapsed/view templates, without repositioning displayed tiddler.
2007.09.12 2.4.0 added option to disable automatic permalink feature. Also, Safari is now excluded from permalinking action to avoid bug where tiddlers don't display after hash is updated.
2007.03.03 2.3.1 fix typo when adding BPM option to AdvancedOptions (prevented checkbox from appearing)
2007.03.03 2.3.0 added support for BottomOfPageMode (BPM) based on request from DaveGarbutt
2007.02.06 2.2.3 in Story.prototype.displayTiddler(), use convertUnicodeToUTF8() for correct I18N string handling when creating URL hash string from tiddler title (based on bug report from BidiX)
2007.01.08 2.2.2 use apply() to invoke hijacked core functions
2006.07.04 2.2.1 in hijack for displayTiddlers(), suspend TPM as well as SPM so that DefaultTiddlers displays in the correct order.
2006.06.01 2.2.0 added chkTopOfPageMode (TPM) handling
2006.02.04 2.1.1 moved global variable declarations to config.* to avoid FireFox 1.5.0.1 crash bug when assigning to globals
2005.12.27 2.1.0 hijack displayTiddlers() so that SPM can be suspended during startup while displaying the DefaultTiddlers (or #hash list). Also, corrected initialization for undefined SPM flag to "false", so default behavior is to display multiple tiddlers
2005.12.27 2.0.0 Update for TW2.0
2005.11.24 1.1.2 When the back and forward buttons are used, the page now changes to match the URL. Based on code added by Clint Checketts
2005.10.14 1.1.1 permalink creation now calls encodeTiddlyLink() to handle tiddler titles with spaces in them
2005.10.14 1.1.0 added automatic setting of window title and location bar ('auto-permalink'). feature suggestion by David Dickens.
2005.10.09 1.0.1 combined documentation and code in a single tiddler
2005.08.15 1.0.0 Initial Release
<<<
Extended libraries documentation <html><sub>(extended-kernel)</sub></html>
[img(50%,)[SIMILAR API suite|images/similarLogo.png]] [>img[images/structure_thumb.png]]
/*{{{*/
/*Haemoglobin Theme for TiddlyWiki*/
/*Design and CSS by Saq Imtiaz*/
/*Version 1.0*/
/*}}}*/
/*{{{*/
#leftMenu {position:relative; float:left; display:inline;margin:0 0.5em 0 0.5em;}
#displayArea{margin:0.5em 0.5em 2em 0.5em;}
#tiddlerDisplay, #tiddlersBar {margin-left:17em;}
#tiddlerDisplay {margin-left:17em;}
#sidebarTabs {font-family:arial,helvetica;}
body
{background:#fefefe;}
#contentWrapper {
font-family: Verdana, Arial, Tahoma, Sans-Serif;
color: #555555;
margin:1.9em auto 1em ; width:1024px;}
#header {background:#fefefe;}
.headerShadow { padding: 1.4em 0em 0.5em 1em; }
.siteTitle {
font-family: 'Trebuchet MS' sans-serif;
font-weight: bold;
font-size: 36px;
color: #BF2323;
background-color: #FFF;
}
.siteSubtitle {
font-size: 1.0em;
display: block;
margin: .5em 3em; color: #999;
}
.clearAll {clear:both;}
.tagClear {clear:none;}
#sidebar {position:relative; float:right; display:inline; right:0;}
a{
color:#BF2323;
text-decoration: none; font-weight:normal;
}
a:hover{
color:#BF2323;
background-color: #fefefe;
border-bottom:1px solid #BF2323;
}
.viewer .button, .editorFooter .button{
color: #555;
border: 1px solid #BF2323;
}
.viewer .button:hover,
.editorFooter .button:hover{
color: #fff;
background: #BF2323;
border-color: #BF2323;
}
.viewer .button:active, .viewer .highlight,.editorFooter .button:active, .editorFooter .highlight{color:#fff; background:#9F1313;border-color:#9F1313;}
#topMenu br {display:none;}
#topMenu {padding:0.45em 1em; background:#BF2323;}
#topMenu a, #topMenu .tiddlyLink, #topMenu .button {color:#f1f1f1; padding:0.3em 0.45em; margin:0 4px;font-size:120%;font-weight:normal;font-variant: small-caps; border:none; background:#BF2323; text-decoration:none; }
#topMenu a:hover, #topMenu .tiddlyLink:hover, #topMenu .button:hover, #topMenu .button:active, #topMenu .highlight {color:#fff;text-decoration:none; background:#9F1313; }
.title {color:#BF2323; border-bottom:1px solid#BF2323; }
.subtitle, .subtitle a { color: #999999; font-size: 1.0em;margin:0.2em;}
.shadow .title{color:#999;}
.toolbar {font-size:85%;}
.selected .toolbar a {color:#999999;}
.selected .toolbar a:hover {color:#333; background:transparent;border:1px solid #fff;}
.toolbar .button:hover, .toolbar .highlight, .toolbar .marked, .toolbar a.button:active{color:#333; background:transparent;border:1px solid #fff;}
* html .viewer pre {
margin-left: 0em;
}
* html .editor textarea, * html .editor input {
width: 98%;
}
.tabSelected{color:#fefefe; background:#999;}
.tabSelected, .tabSelected:hover {
color: #555;
background: #fefefe;
border: solid 1px #ccc;
}
#sidebarTabs .tabUnselected:hover { border-bottom: none;padding-bottom:3px;color:#999;}
.tabUnselected {
color: #999;
background: #eee;
border: solid 1px #ccc;
}
.tabUnselected:hover {text-decoration:none; border:1px solid #ccc;}
#sidebarTabs .tabUnselected { border-bottom: none;padding-bottom:3px;}
#sidebarTabs .tabSelected{padding-bottom:3px;}
#sidebarOptions .sliderPanel {
background: #eee; border:1px solid#ccc;
font-size: .9em;
}
#sidebarOptions .sliderPanel input {border:1px solid #999;}
#sidebarOptions .sliderPanel .txtOptionInput {border:1px solid #999;width:9em;}
#sidebarOptions .sliderPanel a {font-weight:normal; color:#555;background-color: #eee; border-bottom:1px dotted #333;}
#sidebarOptions .sliderPanel a:hover {
color:#111;
background-color: #eee;
border:none;
border-bottom:1px dotted #111;
}
.tabContents {background:#fefefe;}
.tagging, .tagged {
border: 1px solid #eee;
background-color: #F7F7F7;
}
.selected .tagging, .selected .tagged {
background-color: #f7f7f7;
border: 1px solid #ccc;
}
.tagging .listTitle, .tagged .listTitle {
color: #bbb;
}
.selected .tagging .listTitle, .selected .tagged .listTitle {
color: #666;
}
.tagging .button, .tagged .button {
color:#ccc;
}
.selected .tagging .button, .selected .tagged .button {
color:#aaa;
}
.highlight, .marked {background:transparent; color:#111; border:none; text-decoration:underline;}
.tagging .button:hover, .tagged .button:hover, .tagging .button:active, .tagged .button:active {
border: none; background:transparent; text-decoration:underline; color:#333;
}
.popup {
background: #BF2323;
border: 1px solid #BF2323;
}
.popup li.disabled {
color: #000;
}
.popup li a, .popup li a:visited {
color: #eee;
border: none;
}
.popup li a:hover {
background: #bf1717;
color: #fff;
border: none;
}
#messageArea {
border: 4px solid #BF2323;
background: #fefefe;
color: #555;
font-size:90%;
}
#messageArea a:hover { background:#f5f5f5; border:none;}
#messageArea .button{
color: #666;
border: 1px solid #BF2323;
}
#messageArea .button:hover {
color: #fff;
background: #BF2323;
border-color: #BF2323;
}
#contentFooter {background:#BF2323; color:#DF7D7D; clear: both; padding: 0.5em 1em; }
#contentFooter a {
color: #DF7D7D;
border-bottom: 1px dotted #DF7D7D; font-weight:normal;text-decoration:none;
}
#contentFooter a:hover {
color: #FFFFFF;
background-color:transparent;
border-bottom: 1px dotted #fff; text-decoration:none;
}
.searchBar {float:right;font-size: 1.0em;position:relative; margin-top:1.3em;}
.searchBar .button {color:#999;display:block;}
.searchBar .button:hover {border:1px solid #fefefe;color:#4F4B45;}
.searchBar input {
background-color: #fefefe;
color: #999999;
border: 1px solid #CCC; margin-right:3px;
}
.tiddler {padding-bottom:10px;}
.viewer blockquote {
border-left: 5px solid #BF2323;
}
.viewer table, .viewer td {
border: 1px solid #BF2323;
}
.viewer th, thead td {
background: #BF2323;
border: 1px solid #BF2323;
color: #fff;
}
.viewer pre {
border: 1px solid #ccc;
background: #f5f5f5;
}
.viewer code {
color: #111; background:#f5f5f5;
}
.viewer hr {
border-top: dashed 1px #555;
}
.editor input {
border: 1px solid #888; margin-top:5px;
}
.editor textarea {
border: 1px solid #888;
}
h1,h2,h3,h4,h5 { color: #BF2323; background: transparent; padding-bottom:2px; font-family: Arial, Helvetica, sans-serif; }
h1 {font-size:18px;}
h2 {font-size:16px;}
h3 {font-size: 14px;}
/*}}}*/
[[StyleSheetCustomization]]
[[StyleSheetCustomization - DefaultStyles]]
[[StyleSheetCustomization - Buttons]]
[[StyleSheetCustomization - Collapse buttons]]
[[StyleSheetCustomization - Generic styles]]
[[StyleSheetCustomization - Wikispecific]]
[[StyleSheetCustomization - NestedSlidersPlugin]]
/*{{{*/
/* ********************************************************
* This tiddler contains the CSS rules for the button
* displaying a big link on screen.
******************************************************** */
/*}}}*/
/*{{{*/
.linkbigbtn a {
-moz-box-shadow:inset 0px 1px 0px 0px #f29c93;
-webkit-box-shadow:inset 0px 1px 0px 0px #f29c93;
box-shadow:inset 0px 1px 0px 0px #f29c93;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #fe1a00), color-stop(1, #ce0100) );
background:-moz-linear-gradient( center top, #fe1a00 5%, #ce0100 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fe1a00', endColorstr='#ce0100');
background-color:#fe1a00;
-webkit-border-top-left-radius:20px;
-moz-border-radius-topleft:20px;
border-top-left-radius:20px;
-webkit-border-top-right-radius:20px;
-moz-border-radius-topright:20px;
border-top-right-radius:20px;
-webkit-border-bottom-right-radius:20px;
-moz-border-radius-bottomright:20px;
border-bottom-right-radius:20px;
-webkit-border-bottom-left-radius:20px;
-moz-border-radius-bottomleft:20px;
border-bottom-left-radius:20px;
text-indent:0;
border:1px solid #d83526;
display:inline-block;
color:#ffffff;
font-family:Arial;
font-size:22px;
font-weight:bold;
font-style:normal;
height:50px;
line-height:50px;
text-decoration:none;
text-align:center;
text-shadow:1px 1px 0px #b23e35;
padding-left: 3em;
padding-right: 3em;
}
.linkbigbtn a:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ce0100), color-stop(1, #fe1a00) );
background:-moz-linear-gradient( center top, #ce0100 5%, #fe1a00 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ce0100', endColorstr='#fe1a00');
background-color:#ce0100;
text-decoration: none;
}
.linkbigbtn a:active {
position:relative;
top:1px;
}
/* This button was generated using CSSButtonGenerator.com */
/*}}}*/
/*{{{*/
/* ********************************************************
* This tiddler contains the CSS rules for the buttons
* used to expand or collapse a block, using the nested
* sliders plugin.
* It also defines the CSS rules of the expanded blocks.
******************************************************** */
/*}}}*/
/*{{{*/
/* ********************************************************
* Buttons common features
******************************************************** */
.docsmallbtn, .implsmallbtn, .exsmallbtn, .moresmallbtn, .implbigbtn, .docbigbtn, .exbigbtn , .morebigbtn, .doclink a, .morelink a {
text-indent:0;
display:inline-block;
color:#ffffff;
font-family:Arial;
font-size:15px;
font-weight:bold;
font-style:normal;
text-decoration:none;
margin-top: 1px ;
margin-bottom: 1px ;
}
.docsmallbtn:hover, .implsmallbtn.hover, .exsmallbtn:hover, .moresmallbtn:hover, .implbigbtn:hover, .docbigbtn:hover, .exbigbtn:hover, .morebigbtn:hover, .morelink a:hover, .doclink a:hover {
color: #FFFFFF;
text-decoration: none;
}
.docsmallbtn:active, .implsmallbtn:active, .exsmallbtn:active, .moresmallbtn:active, .implbigbtn:active, .docbigbtn:active, .exbigbtn:active, .morebigbtn:active, .morelink a:active, .doclink a:active {
position:relative;
top:1px;
}
/* ********************************************************
* Small buttons common features
******************************************************** */
.docsmallbtn, .implsmallbtn, .exsmallbtn, .moresmallbtn, .morelink a, .doclink a {
-webkit-border-top-left-radius:20px;
-moz-border-radius-topleft:20px;
border-top-left-radius:20px;
-webkit-border-top-right-radius:20px;
-moz-border-radius-topright:20px;
border-top-right-radius:20px;
-webkit-border-bottom-right-radius:20px;
-moz-border-radius-bottomright:20px;
border-bottom-right-radius:20px;
-webkit-border-bottom-left-radius:20px;
-moz-border-radius-bottomleft:20px;
border-bottom-left-radius:20px;
line-height:24px;
height:24px;
text-align:center;
width:120px;
}
/* ********************************************************
* Big buttons common features
******************************************************** */
.implbigbtn, .docbigbtn, .exbigbtn, .morebigbtn {
-webkit-border-top-left-radius:0px;
-moz-border-radius-topleft:0px;
border-top-left-radius:0px;
-webkit-border-top-right-radius:11px;
-moz-border-radius-topright:11px;
border-top-right-radius:11px;
-webkit-border-bottom-right-radius:0px;
-moz-border-radius-bottomright:0px;
border-bottom-right-radius:0px;
-webkit-border-bottom-left-radius:0px;
-moz-border-radius-bottomleft:0px;
border-bottom-left-radius:0px;
height:40px;
line-height:40px;
padding-left: 2.5em;
width:75%;
}
/*}}}*/
/*{{{*/
/* ********************************************************
* Common features of blocks following a big or small button
******************************************************** */
.implsection, .exsection, .docsection, .docsubsection, .moresection {
display:block;
padding: 0.5em;
margin-top:0.25em;
margin-bottom:0.25em;
}
/*}}}*/
/*{{{*/
/* ********************************************************
* Implementation-related declarations
******************************************************** */
/*}}}*/
/*{{{*/
/* Definition of the common features of the small
* and big buttons that can be put
* in a line to display the implementation */
/* This button was generated using CSSButtonGenerator.com */
.implsmallbtn, .implbigbtn {
-moz-box-shadow:inset 0px 1px 0px 0px #c1ed9c;
-webkit-box-shadow:inset 0px 1px 0px 0px #c1ed9c;
box-shadow:inset 0px 1px 0px 0px #c1ed9c;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #9dce2c), color-stop(1, #8cb82b) );
background:-moz-linear-gradient( center top, #9dce2c 5%, #8cb82b 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#9dce2c', endColorstr='#8cb82b');
background-color:#9dce2c;
border:1px solid #83c41a;
text-shadow:1px 1px 0px #689324;
}
.implsmallbtn:hover, .implbigbtn:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #8cb82b), color-stop(1, #9dce2c) );
background:-moz-linear-gradient( center top, #8cb82b 5%, #9dce2c 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#8cb82b', endColorstr='#9dce2c');
background-color:#8cb82b;
}
/* Definition of the block under the button displaying the implementation */
.implsection {
border:1px solid #30BF30;
background-color: #C3FFC3;
}
/* Change the color of the titles inside an implementation section. */
.implsection h1, .implsection h2, .implsection h3, .implsection h4, .implsection h5 {
color: #30BF30;
}
/*}}}*/
/*{{{*/
/* ********************************************************
* Documentation-related declarations
******************************************************** */
/*}}}*/
/*{{{*/
/* Definition of the common features of the small
* and big buttons that can be put
* in a line to display the documentation */
/* This button was generated using CSSButtonGenerator.com */
.docsmallbtn, .docbigbtn, .doclink a {
-moz-box-shadow:inset 0px 1px 0px 0px #bbdaf7;
-webkit-box-shadow:inset 0px 1px 0px 0px #bbdaf7;
box-shadow:inset 0px 1px 0px 0px #bbdaf7;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #79bbff), color-stop(1, #378de5) );
background:-moz-linear-gradient( center top, #79bbff 5%, #378de5 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#79bbff', endColorstr='#378de5');
background-color:#79bbff;
border:1px solid #84bbf3;
text-shadow:1px 1px 0px #528ecc;
}
.docsmallbtn:hover, .docbigbtn:hover, .doclink a:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #378de5), color-stop(1, #79bbff) );
background:-moz-linear-gradient( center top, #378de5 5%, #79bbff 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#378de5', endColorstr='#79bbff');
background-color:#378de5;
}
/* Definition of the block under the button displaying the documentation */
.docsection {
border:1px solid #528fcc;
background-color: #d6eafc;
}
.docsubsection {
border:1px solid #528fcc;
background-color: #96d9f5;
}
/* Change the color of the titles inside a document section. */
.docsection h1, .docsection h2, .docsection h3, .docsection h4, .docsection h5 {
color: #528fcc;
}
/* Definition of a title style for the javadoc */
.javadoctitle {
display: block;
font-weight: bold;
font-size:130%;
text-decoration: underline;
color: #528fcc;
margin-top: 1em;
}
/* Definition of a block displaying the javadoc */
.javadocsection {
display: block;
border:1px solid #528fcc;
padding: 0.5em;
background: #FFFFFF;
margin-top:-1em;
margin-bottom:0.25em;
margin-left: 1em;
}
/*}}}*/
/*{{{*/
/* ********************************************************
* Example-related declarations
******************************************************** */
/*}}}*/
/*{{{*/
/* Definition of the common features of the small
* and big buttons that can be put
* in a line to display an example */
/* This button was generated using CSSButtonGenerator.com */
.exsmallbtn, .exbigbtn {
-moz-box-shadow:inset 0px 1px 0px 0px #fed897;
-webkit-box-shadow:inset 0px 1px 0px 0px #fed897;
box-shadow:inset 0px 1px 0px 0px #fed897;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #f6b33d), color-stop(1, #d29105) );
background:-moz-linear-gradient( center top, #f6b33d 5%, #d29105 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6b33d', endColorstr='#d29105');
background-color:#f6b33d;
border:1px solid #eda933;
text-shadow:1px 1px 0px #cd8a15;
}
.exsmallbtn:hover, .exbigbtn:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #d29105), color-stop(1, #f6b33d) );
background:-moz-linear-gradient( center top, #d29105 5%, #f6b33d 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#d29105', endColorstr='#f6b33d');
background-color:#d29105;
}
/* Definition of the block under the button displaying the example */
.exsection {
border:1px solid #eda933;
background-color: #fae4bd;
}
/* Change the color of the titles inside an example section. */
.exsection h1, .exsection h2, .exsection h3, .exsection h4, .exsection h5 {
color: #eda933;
}
/*}}}*/
/*{{{*/
/* ********************************************************
* Read more-related declarations
******************************************************** */
/*}}}*/
/*{{{*/
/* Definition of the common features of the small
* and big buttons that can be put
* in a line to display more information*/
/* This button was generated using CSSButtonGenerator.com */
.moresmallbtn, .morebigbtn, .morelink a {
-moz-box-shadow:inset 0px 1px 0px 0px #f29c93;
-webkit-box-shadow:inset 0px 1px 0px 0px #f29c93;
box-shadow:inset 0px 1px 0px 0px #f29c93;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #fe1a00), color-stop(1, #ce0100) );
background:-moz-linear-gradient( center top, #fe1a00 5%, #ce0100 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fe1a00', endColorstr='#ce0100');
background-color:#fe1a00;
border:1px solid #d83526;
text-shadow:1px 1px 0px #b23e35;
}
.moresmallbtn:hover, .morebigbtn:hover, .morelink a:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ce0100), color-stop(1, #fe1a00) );
background:-moz-linear-gradient( center top, #ce0100 5%, #fe1a00 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ce0100', endColorstr='#fe1a00');
background-color:#ce0100;
}
/* Definition of the block under the button displaying the additional information */
.moresection {
border:1px solid #dcdcdc;
background-color: #f9f9f9;
}
/* Change the color of the titles inside additional information. */
.moresection h1, .moresection h2, .moresection h3, .moresection h4, .moresection h5 {
color: #ce0100;
}
/*}}}*/
/*{{{*/
/* ********************************************************
* This tiddler contains the CSS rules for the custom
* default behavior of some HTML tags of the wiki.
******************************************************** */
/*}}}*/
/*{{{*/
/* Put an image before the "back to parent" link. */
.toparent a:before {
content:url(images/arrow.png);
margin-right: 0.5em;
}
.toparent {
display:block;
margin-bottom: -0.5em;
}
/*}}}*/
/*{{{*/
/* Justify text by default */
body {
text-align: justify;
}
/*}}}*/
/*{{{*/
/* Put a border around images by default */
#tiddlerDisplay img {
border:1px solid #A60000;
padding: 0.25em;
margin: 0.25em;
}
/*}}}*/
/*{{{*/
/* Prevent bullets from overlapping a floating block */
ul, ol {
overflow: hidden;
}
/*}}}*/
/*{{{*/
/* Set the caption of images as bold. */
span.center.caption {
font-family: Impact;
font-style: italic;
font-size: 130%;
}
/*}}}*/
/*{{{*/
/* Use the same style for internal and external links. */
.externalLink {
font-weight: bold;
text-decoration: none;
}
/*}}}*/
/*{{{*/
/* ********************************************************
* This tiddler contains the CSS rules for the classes
* that are used in any wiki of this documentation.
******************************************************** */
/*}}}*/
/*{{{*/
/* Image flush command */
.clear {
display:block;
clear:both;
margin-bottom:-1em;
}
.clearright {
display:block;
clear:right;
margin-bottom:-1em;
}
.clearleft {
display:block;
clear:right;
margin-bottom:-1em;
}
/*}}}*/
/*{{{*/
/* alignment commands */
.center {
display:block;
text-align:center;
}
/*}}}*/
/*{{{*/
/* figure related commands */
.caption{
display:block;
text-align:center;
font-family: Impact;
font-style: italic;
font-size: 130%;
}
/*}}}*/
/*{{{*/
/* Java classes related commands */
.className {
font-family: cursive;
font-weight: bold;
}
.methodName {
font-family: cursive;
font-weight: bold;
font-style: italic;
}
.fieldName {
font-family: cursive;
font-weight: bold;
}
.argumentName {
font-family: cursive;
font-weight: bold;
}
.packageName {
font-family: cursive;
font-style: italic;
font-weight: bold;
}
.packageName:before, .packageName:after, .methodName:before, .methodName:after {
content: '"';
}
/*}}}*/
/*{{{*/
/* Block putting a big emphasis on text. */
.focusemphasisblock{
display:block;
border:1px solid #008000;
background-color: #DEFEDE;
padding: 1.5em;
font-weight: bold;
color: #008000;
}
/*}}}*/
/*{{{*/
/* Block putting a strong emphasis on text. */
.bigemphasisblock {
display:block;
border:1px solid #A60000;
background-color: #FF7373;
padding: 1.5em;
font-weight: bold;
color: #FEFEFE;
}
/*}}}*/
/*{{{*/
/* *********************************************
The small button used by the nested slider plugin
when the "+ + +" maccro is used without a text between "[ ]".
********************************************* */
/*}}}*/
/*{{{*/
.expandbutton {
-moz-box-shadow:inset 0px 1px 0px 0px #f29c93;
-webkit-box-shadow:inset 0px 1px 0px 0px #f29c93;
box-shadow:inset 0px 1px 0px 0px #f29c93;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #fe1a00), color-stop(1, #ce0100) );
background:-moz-linear-gradient( center top, #fe1a00 5%, #ce0100 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fe1a00', endColorstr='#ce0100');
background-color:#fe1a00;
-webkit-border-top-left-radius:16px;
-moz-border-radius-topleft:16px;
border-top-left-radius:16px;
-webkit-border-top-right-radius:16px;
-moz-border-radius-topright:16px;
border-top-right-radius:16px;
-webkit-border-bottom-right-radius:16px;
-moz-border-radius-bottomright:16px;
border-bottom-right-radius:16px;
-webkit-border-bottom-left-radius:16px;
-moz-border-radius-bottomleft:16px;
border-bottom-left-radius:16px;
text-indent:0px;
border:1px solid #d83526;
display:inline-block;
color:#ffffff;
font-family:Arial;
font-size:14px;
font-weight:bold;
font-style:normal;
height:20px;
line-height:20px;
text-decoration:none;
text-align:center;
padding-left: 0.4em;
padding-right: 0.4em;
}
.expandbutton:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ce0100), color-stop(1, #fe1a00) );
background:-moz-linear-gradient( center top, #ce0100 5%, #fe1a00 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ce0100', endColorstr='#fe1a00');
background-color:#ce0100;
}
.expandbutton:active {
position:relative;
top:1px;
}
/* This button was generated using CSSButtonGenerator.com */
/*}}}*/
/*{{{*/
/* ********************************************************
* This tiddler contains the CSS rules for the classes
* that are specific to this wiki.
******************************************************** */
/*}}}*/
/*{{{*/
/* Style of the bar under the navigation buttons */
.guidelinesNavMenu {
display:block;
text-align:center;
margin-top: 5px;
margin-bottom: 5px;
}
hr.topSep, hr.botSep {
margin-bottom: -0.5em;
width: 100%;
height: 2px;
border: 0;
background: -webkit-linear-gradient(left, rgba(198,0,3,0) 0%,rgba(198,0,3,0.9) 50%,rgba(198,0,3,0) 100%);
background: -o-linear-gradient(left, rgba(198,0,3,0) 0%,rgba(198,0,3,0.9) 50%,rgba(198,0,3,0) 100%);
background: -ms-linear-gradient(left, rgba(198,0,3,0) 0%,rgba(198,0,3,0.9) 50%,rgba(198,0,3,0) 100%);
background: linear-gradient(to right, rgba(198,0,3,0) 0%,rgba(198,0,3,0.9) 50%,rgba(198,0,3,0) 100%);
}
hr.topSep {
margin-top: -1em;
}
/*}}}*/
/*{{{*/
/* Style of the title displayed in the design guidelines */
.stepMainTitle {
color: rgb(191,35,35);
text-align: center;
font-family: Impact;
font-size: 300%;
font-weight: bold;
text-align: center;
letter-spacing:2px;
display:block;
margin-top: 0.5em;
}
/*}}}*/
/*{{{*/
/***** LAYOUT STYLES - DO NOT EDIT! *****/
ul.suckerfish, ul.suckerfish ul {
margin: 0;
padding: 0;
list-style: none;
line-height:1.4em;
}
ul.suckerfish li {
display: inline-block;
display: block;
float: left;
}
ul.suckerfish li ul {
position: absolute;
left: -999em;
}
ul.suckerfish li:hover ul, ul.suckerfish li.sfhover ul {
left: auto;
}
ul.suckerfish ul li {
float: none;
border-right: 0;
border-left:0;
}
ul.suckerfish a, ul.suckerfish a:hover {
display: block;
}
ul.suckerfish li a.tiddlyLink, ul.suckerfish li a, #mainMenu ul.suckerfish li a {font-weight:bold;}
/**** END LAYOUT STYLES *****/
/**** COLORS AND APPEARANCE - DEFAULT *****/
ul.suckerfish li a {
padding: 0.5em 1.5em;
font-weight:bold;
border-bottom: 0;
-moz-box-shadow:inset 0px 1px 0px 0px #f29c93;
-webkit-box-shadow:inset 0px 1px 0px 0px #f29c93;
box-shadow:inset 0px 1px 0px 0px #f29c93;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #fe1a00), color-stop(1, #ce0100) );
background:-moz-linear-gradient( center top, #fe1a00 5%, #ce0100 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fe1a00', endColorstr='#ce0100');
background-color:#fe1a00;
color:#ffffff;
}
ul.suckerfish li:hover a, ul.suckerfish li.sfhover a{
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ce0100), color-stop(1, #fe1a00) );
background:-moz-linear-gradient( center top, #ce0100 5%, #fe1a00 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ce0100', endColorstr='#fe1a00');
background-color:#ce0100;
}
ul.suckerfish li:hover ul a, ul.suckerfish li.sfhover ul a{
color: #d83526;
background: #ffeeee;
}
ul.suckerfish ul li a:hover {
background: #ffdddd;
}
ul.suckerfish li a{
width:9.5em;
}
ul.suckerfish ul li a, ul.suckerfish ul li a:hover{
display:inline-block;
width:9.5em;
}
ul.suckerfish li {
border:1px solid #d83526;
}
ul.suckerfish li ul li a {
border-style: solid;
border-color: #d83526;
border-top-width: 0px;
border-bottom-width: 1px;
border-left-width: 1px;
border-right-width: 1px;
}
/***** END COLORS AND APPEARANCE - DEFAULT *****/
/***** LAYOUT AND APPEARANCE: VERTICAL *****/
ul.suckerfish.vertical li{
width:10em;
border-left: 0px solid #00558f;
}
ul.suckerfish.vertical ul li, ul.suckerfish.vertical li a, ul.suckerfish.vertical li:hover a, ul.suckerfish.vertical li.sfhover a {
border-left: 0.8em solid #00558f;
}
ul.suckerfish.vertical li a, ul.suckerfish.vertical li:hover a, ul.suckerfish.vertical li.sfhover a, ul.suckerfish.vertical li.sfhover a:hover{
width:8em;
}
ul.suckerfish.vertical {
width:10em; text-align:left;
float:left;
}
ul.suckerfish.vertical li a {
padding: 0.5em 1em 0.5em 1em;
border-top:1px solid #fff;
}
ul.suckerfish.vertical, ul.suckerfish.vertical ul {
line-height:1.4em;
}
ul.suckerfish.vertical li:hover ul, ul.suckerfish.vertical li.sfhover ul {
margin: -2.4em 0 0 10.9em;
}
ul.suckerfish.vertical li:hover ul li a, ul.suckerfish.vertical li.sfhover ul li a {
border: 0px solid #FFF;
}
ul.suckerfish.vertical li:hover a, ul.suckerfish.vertical li.sfhover a{
padding-right:1.1em;
}
ul.suckerfish.vertical li:hover ul li, ul.suckerfish.vertical li.sfhover ul li {
border-bottom:1px solid #fff;
}
/***** END LAYOUT AND APPEARANCE: VERTICAL *****/
/*}}}*/
/*{{{*/
.leaf, .subtree {display:block; margin-left : 0.5em}
.subtree {margin-bottom:0.5em}
#mainMenu {text-align:left}
.branch .button {border:1px solid #DDD; color:#AAA;font-size:9px;padding:0 2px;margin-right:0.3em;vertical-align:middle;text-align:center;}
/*}}}*/
A successful project requires many people to play many roles. Some members write code or documentation, while others are valuable as testers, submitting patches and suggestions.
The team is comprised of Members and Contributors. Members have direct access to the source of a project and actively evolve the code-base. Contributors improve the project through submission of patches and suggestions to the Members.
!Members
The following is a list of developers with commit privileges that have directly contributed to the project in one way or another.
|!Name |!Email |!Organization |!Roles |
| [[Yoann KUBERA|http://www.yoannkubera.net]]|yoann.kubera@gmail.com |[[LGI2A laboratory|http://www.lgi2a.univ-artois.fr/]] - France |designer, architect, developer|
| [[Gildas MORVAN|http://www.lgi2a.univ-artois.fr/~morvan/Gildas_Morvan/Contact.html]]|gildas.morvan@univ-artois.fr |[[LGI2A laboratory|http://www.lgi2a.univ-artois.fr/]] - France |creator of the IRM4MLS meta-model |
!Contributors
There are no contributors listed for this project.
/***
|''Name:''|TiddlersBarPlugin|
|''Description:''|A bar to switch between tiddlers through tabs (like browser tabs bar).|
|''Version:''|1.2.5|
|''Date:''|Jan 18,2008|
|''Source:''|http://visualtw.ouvaton.org/VisualTW.html|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''~CoreVersion:''|2.1.0|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0, others|
!Demos
On [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], open several tiddlers to use the tabs bar.
!Installation
#import this tiddler from [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] (tagged as systemConfig)
#save and reload
#''if you're using a custom [[PageTemplate]]'', add {{{<div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>}}} before {{{<div id='tiddlerDisplay'></div>}}}
#optionally, adjust StyleSheetTiddlersBar
!Tips
*Doubleclick on the tiddlers bar (where there is no tab) create a new tiddler.
*Tabs include a button to close {{{x}}} or save {{{!}}} their tiddler.
*By default, click on the current tab close all others tiddlers.
!Configuration options
<<option chkDisableTabsBar>> Disable the tabs bar (to print, by example).
<<option chkHideTabsBarWhenSingleTab >> Automatically hide the tabs bar when only one tiddler is displayed.
<<option txtSelectedTiddlerTabButton>> ''selected'' tab command button.
<<option txtPreviousTabKey>> previous tab access key.
<<option txtNextTabKey>> next tab access key.
!Code
***/
//{{{
config.options.chkDisableTabsBar = config.options.chkDisableTabsBar ? config.options.chkDisableTabsBar : false;
config.options.chkHideTabsBarWhenSingleTab = config.options.chkHideTabsBarWhenSingleTab ? config.options.chkHideTabsBarWhenSingleTab : false;
config.options.txtSelectedTiddlerTabButton = config.options.txtSelectedTiddlerTabButton ? config.options.txtSelectedTiddlerTabButton : "closeOthers";
config.options.txtPreviousTabKey = config.options.txtPreviousTabKey ? config.options.txtPreviousTabKey : "";
config.options.txtNextTabKey = config.options.txtNextTabKey ? config.options.txtNextTabKey : "";
config.macros.tiddlersBar = {
tooltip : "see ",
tooltipClose : "click here to close this tab",
tooltipSave : "click here to save this tab",
promptRename : "Enter tiddler new name",
currentTiddler : "",
previousState : false,
previousKey : config.options.txtPreviousTabKey,
nextKey : config.options.txtNextTabKey,
tabsAnimationSource : null, //use document.getElementById("tiddlerDisplay") if you need animation on tab switching.
handler: function(place,macroName,params) {
var previous = null;
if (config.macros.tiddlersBar.isShown())
story.forEachTiddler(function(title,e){
if (title==config.macros.tiddlersBar.currentTiddler){
var d = createTiddlyElement(null,"span",null,"tab tabSelected");
config.macros.tiddlersBar.createActiveTabButton(d,title);
if (previous && config.macros.tiddlersBar.previousKey) previous.setAttribute("accessKey",config.macros.tiddlersBar.nextKey);
previous = "active";
}
else {
var d = createTiddlyElement(place,"span",null,"tab tabUnselected");
var btn = createTiddlyButton(d,title,config.macros.tiddlersBar.tooltip + title,config.macros.tiddlersBar.onSelectTab);
btn.setAttribute("tiddler", title);
if (previous=="active" && config.macros.tiddlersBar.nextKey) btn.setAttribute("accessKey",config.macros.tiddlersBar.previousKey);
previous=btn;
}
var isDirty =story.isDirty(title);
var c = createTiddlyButton(d,isDirty ?"!":"x",isDirty?config.macros.tiddlersBar.tooltipSave:config.macros.tiddlersBar.tooltipClose, isDirty ? config.macros.tiddlersBar.onTabSave : config.macros.tiddlersBar.onTabClose,"tabButton");
c.setAttribute("tiddler", title);
if (place.childNodes) {
place.insertBefore(document.createTextNode(" "),place.firstChild); // to allow break line here when many tiddlers are open
place.insertBefore(d,place.firstChild);
}
else place.appendChild(d);
})
},
refresh: function(place,params){
removeChildren(place);
config.macros.tiddlersBar.handler(place,"tiddlersBar",params);
if (config.macros.tiddlersBar.previousState!=config.macros.tiddlersBar.isShown()) {
story.refreshAllTiddlers();
if (config.macros.tiddlersBar.previousState) story.forEachTiddler(function(t,e){e.style.display="";});
config.macros.tiddlersBar.previousState = !config.macros.tiddlersBar.previousState;
}
},
isShown : function(){
if (config.options.chkDisableTabsBar) return false;
if (!config.options.chkHideTabsBarWhenSingleTab) return true;
var cpt=0;
story.forEachTiddler(function(){cpt++});
return (cpt>1);
},
selectNextTab : function(){ //used when the current tab is closed (to select another tab)
var previous="";
story.forEachTiddler(function(title){
if (!config.macros.tiddlersBar.currentTiddler) {
story.displayTiddler(null,title);
return;
}
if (title==config.macros.tiddlersBar.currentTiddler) {
if (previous) {
story.displayTiddler(null,previous);
return;
}
else config.macros.tiddlersBar.currentTiddler=""; // so next tab will be selected
}
else previous=title;
});
},
onSelectTab : function(e){
var t = this.getAttribute("tiddler");
if (t) story.displayTiddler(null,t);
return false;
},
onTabClose : function(e){
var t = this.getAttribute("tiddler");
if (t) {
if(story.hasChanges(t) && !readOnly) {
if(!confirm(config.commands.cancelTiddler.warning.format([t])))
return false;
}
story.closeTiddler(t);
}
return false;
},
onTabSave : function(e) {
var t = this.getAttribute("tiddler");
if (!e) e=window.event;
if (t) config.commands.saveTiddler.handler(e,null,t);
return false;
},
onSelectedTabButtonClick : function(event,src,title) {
var t = this.getAttribute("tiddler");
if (!event) event=window.event;
if (t && config.options.txtSelectedTiddlerTabButton && config.commands[config.options.txtSelectedTiddlerTabButton])
config.commands[config.options.txtSelectedTiddlerTabButton].handler(event, src, t);
return false;
},
onTiddlersBarAction: function(event) {
var source = event.target ? event.target.id : event.srcElement.id; // FF uses target and IE uses srcElement;
if (source=="tiddlersBar") story.displayTiddler(null,'New Tiddler',DEFAULT_EDIT_TEMPLATE,false,null,null);
},
createActiveTabButton : function(place,title) {
if (config.options.txtSelectedTiddlerTabButton && config.commands[config.options.txtSelectedTiddlerTabButton]) {
var btn = createTiddlyButton(place, title, config.commands[config.options.txtSelectedTiddlerTabButton].tooltip ,config.macros.tiddlersBar.onSelectedTabButtonClick);
btn.setAttribute("tiddler", title);
}
else
createTiddlyText(place,title);
}
}
story.coreCloseTiddler = story.coreCloseTiddler? story.coreCloseTiddler : story.closeTiddler;
story.coreDisplayTiddler = story.coreDisplayTiddler ? story.coreDisplayTiddler : story.displayTiddler;
story.closeTiddler = function(title,animate,unused) {
if (title==config.macros.tiddlersBar.currentTiddler)
config.macros.tiddlersBar.selectNextTab();
story.coreCloseTiddler(title,false,unused); //disable animation to get it closed before calling tiddlersBar.refresh
var e=document.getElementById("tiddlersBar");
if (e) config.macros.tiddlersBar.refresh(e,null);
}
story.displayTiddler = function(srcElement,tiddler,template,animate,unused,customFields,toggle){
story.coreDisplayTiddler(config.macros.tiddlersBar.tabsAnimationSource,tiddler,template,animate,unused,customFields,toggle);
var title = (tiddler instanceof Tiddler)? tiddler.title : tiddler;
if (config.macros.tiddlersBar.isShown()) {
story.forEachTiddler(function(t,e){
if (t!=title) e.style.display="none";
else e.style.display="";
})
config.macros.tiddlersBar.currentTiddler=title;
}
var e=document.getElementById("tiddlersBar");
if (e) config.macros.tiddlersBar.refresh(e,null);
}
var coreRefreshPageTemplate = coreRefreshPageTemplate ? coreRefreshPageTemplate : refreshPageTemplate;
refreshPageTemplate = function(title) {
coreRefreshPageTemplate(title);
if (config.macros.tiddlersBar) config.macros.tiddlersBar.refresh(document.getElementById("tiddlersBar"));
}
ensureVisible=function (e) {return 0} //disable bottom scrolling (not useful now)
config.shadowTiddlers.StyleSheetTiddlersBar = "/*{{{*/\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar .button {border:0}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar .tab {white-space:nowrap}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar {padding : 1em 0.5em 2px 0.5em}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += ".tabUnselected .tabButton, .tabSelected .tabButton {padding : 0 2px 0 2px; margin: 0 0 0 4px;}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += ".tiddler, .tabContents {border:1px [[ColorPalette::TertiaryPale]] solid;}\n";
config.shadowTiddlers.StyleSheetTiddlersBar +="/*}}}*/";
store.addNotification("StyleSheetTiddlersBar", refreshStyles);
config.refreshers.none = function(){return true;}
config.shadowTiddlers.PageTemplate=config.shadowTiddlers.PageTemplate.replace(/<div id='tiddlerDisplay'><\/div>/m,"<div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>\n<div id='tiddlerDisplay'></div>");
//}}}
|~ViewToolbar|closeTiddler closeOthers editTiddler > fields syncing permalink references jump|
|~EditToolbar|+saveTiddler -cancelTiddler deleteTiddler|
<!--{{{-->
<div class='toolbar' role='navigation' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' macro='view title'></div>
<!-- <div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div> -->
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
Copyright © 2018 [[Laboratoire de Genie Informatique et d'Automatique de l'Artois|http://www.lgi2a.univ-artois.fr]]. All Rights Reserved.