Welcome to TiddlyWiki created by Jeremy Ruston; Copyright © 2004-2007 Jeremy Ruston, Copyright © 2007-2011 UnaMesa Association
/%
!info
|Name|AutoRefresh|
|Source|http://www.TiddlyTools.com/#AutoRefresh|
|Version|2.0.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|transclusion|
|Description|set/clear tiddler refresh flags to force/prevent re-rendering when changes occur|
Usage:
<<<
{{{
<<tiddler AutoRefresh>>
<<tiddler AutoRefresh with: mode id>>
}}}
*''mode'' (optional), one of:
**''off'' or ''disable'' - prevents refresh of rendered content (except when PageTemplate is changed!)
**''on'' or ''enable'' - re-render content whenever corresponding tiddler source is changed (default)
**''force'' - re-render content whenever //''ANY''// tiddler is changed
*''id'' (optional), is a unique DOM element identifier on which to operate (e.g., 'mainMenu'). If omitted, the current tiddler (if any) is implied.
<<<
!end
!show
<<tiddler {{
var here=story.findContainingTiddler(place);
var target=document.getElementById('$2')||here||place.parentNode;
if (target==here) { // in a tiddler, get viewer element
var elems=target.getElementsByTagName('*');
for (var i=0;i<elems.length;i++)
if (hasClass(elems[i],'viewer')) { target=elems[i]; break; }
}
if (target) {
var mode='$1'; if (mode=='$'+'1') mode='on';
if (['on','enable','force'].contains(mode.toLowerCase())) {
var title=target.getAttribute('tiddler');
if (!title&&here) title=here.getAttribute('tiddler');
if (title) target.setAttribute('tiddler',title);
target.setAttribute('refresh','content');
target.setAttribute('force',(mode=='force')?'true':'');
} else if (['off','disable'].contains(mode.toLowerCase())) {
target.setAttribute('refresh','');
target.setAttribute('force','');
}
}
'';}}>>
!end
%/<<tiddler {{var src='AutoRefresh'; src+(tiddler&&tiddler.title==src?'##info':'##show');}}
with: [[$1]] [[$2]]>>
/***
|''Name:''|DatePickerLibrary|
|''Description:''|DatePicker library for use with macros|
|''Author:''|Saq Imtiaz ( lewcid@gmail.com )|
|''Code Repository:''|http://svn.tiddlywiki.org/Trunk/contributors/SaqImtiaz/libraries/DatePicker.js|
|''Version:''|0.9|
|''Date:''|06/04/2007|
|''License:''|[[Creative Commons Attribution-ShareAlike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/]]|
|''~CoreVersion:''|2.3.0|
***/
// /%
//!BEGIN-PLUGIN-CODE
//{{{
function $id(n) {
return document.getElementById(n);
}
DatePicker = {
days : ['S','M','T','W','T','F','S'],
daysMon : ['M','T','W','T','F','S','S'],
cells : new Array(42),
setup : function(){
var cte = createTiddlyElement;
var table = this.table = cte(null,"table","datePickerTable");
table.style.display = 'none';
document.body.appendChild(table);
var thead = cte(table,"thead");
var hRow = cte(thead,"tr");
hRow.onclick = stopEvent;
cte(hRow,"td",null,"datePickerNav","<<").onclick = DatePicker.prevm;
cte(hRow,"td","datePickerMNS",null,null,{colSpan:"5"});
cte(hRow,"td",null,"datePickerNav",">>",{align:"right"}).onclick=DatePicker.nextm;
var tbody = cte(table,"tbody","datePickerTableBody");
var dayRow = cte(tbody,"tr",null,"datePickerDaysHeader");
for (var i=0; i<this.days.length; i++){
cte(dayRow,"td",null,null,this.days[i]);
}
},
show : function(el,dateObj,cb) {
var me = DatePicker;
var now = me.now = new Date();
if (!dateObj)
dateObj = now;
me.root = el;
if (cb)
me.root.datePickerCallback = cb;
me.scc = { m : now.getMonth(), y : now.getFullYear(), d : now.getDate() };
Popup.place(el,me.table,{x:0,y:1});
var cur = [dateObj.getDate(),dateObj.getMonth()+1,dateObj.getFullYear()];
me.cc = { m : cur[1]-1, y : cur[2] };
me.sd = { m : cur[1]-1, y : cur[2], d : cur[0] };
me.fillCalendar(cur[0],me.scc.d,cur[1]-1,cur[2]);
},
fillCalendar : function(hd,today,cm,cy) {
var me = DatePicker;
var monStart = config.mGTD.getOptChk('WeekStartsMonday');
var sd = me.now.getDate();
var td = new Date(cy,cm,1)
var cd = td.getDay();
$id('datePickerMNS').innerHTML = td.formatString('MMM YYYY')
var tbody = $id('datePickerTableBody');
removeChildren(tbody);
var dowRow = createTiddlyElement(tbody,"tr",null,"datePickerDowRow");
for (var d=0;d<=7;d++) {
// dow headings
createTiddlyElement(dowRow,"td",null,null,DatePicker[monStart?'daysMon':'days'][d]);
}
var days = (new Date(cy, cm+1, 0)).getDate();
var day = 1;
for (var j=1;j<=6;j++) { //rows
var row = createTiddlyElement(tbody,"tr",null,"datePickerDayRow");
for (var t=1; t<=7; t++) { //cells
var d = 7 * (j-1) - (-t) + (monStart ? 1 : 0); //id key
var is_this_month = ((d >= (cd -(-1))) && (d<=cd-(-(days))));
var dip = ( ((d-cd < sd) && (cm == me.scc.m) && (cy == me.scc.y)) || (cm < me.scc.m && cy == me.scc.y) || (cy < me.scc.y) );
var htd = ( (hd != '') && (d-cd == hd) );
var hToday = ( (today != '') && (d-cd == today) && cy == me.scc.y && cm == me.scc.m );
if (htd)
_class = 'highlightedDate';
else if (dip)
_class = 'oldDate';
else if (hToday && ! htd)
_class = 'todayDate';
else
_class = 'defaultDate';
if ((monStart && (t==6||t==7)) || (!monStart && (t == 1 || t == 7))) {
// weekend
_class += ' weekend';
}
if (!is_this_month) {
_class += ' otherMonth';
}
var cell = createTiddlyElement(row,"td","datePickerDay"+d,_class,(new Date(cy,cm,d-cd)).getDate());
cell.onmouseover = function(e){addClass(this,'tdover');};
cell.onmouseout = function(e){removeClass(this,'tdover');};
cell.onclick = me.selectDate;
me.cells[d] = new Date(cy,cm,d-cd);
day++;
}
if(day > days + cd)
break;
}
},
nextm : function() {
var me = DatePicker;
me.cc.m += 1;
if (me.cc.m >= 12) {
me.cc.m = 0;
me.cc.y++;
}
me.fillCalendar(me.getDayStatus(me.cc.m,me.cc.y),me.scc.d,me.cc.m,me.cc.y);
return false;
},
prevm : function() {
var me = DatePicker;
me.cc.m -= 1;
if (me.cc.m < 0) {
me.cc.m = 11;
me.cc.y--;
}
me.fillCalendar(me.getDayStatus(me.cc.m,me.cc.y),me.scc.d,me.cc.m,me.cc.y);
return false;
},
getDayStatus : function(ccm,ccy){
return (ccy == this.sd.y && ccm == this.sd.m)? this.sd.d : '';
},
selectDate : function(ev){
var e = ev ? ev : window.event;
var me = DatePicker;
var date = me.cells[resolveTarget(e).id.substring(13,resolveTarget(e).id.length)];
if (me.root.datePickerCallback && typeof me.root.datePickerCallback == 'function')
me.root.datePickerCallback(me.root,date);
$id('datePickerTable').style.display = 'none';
return false;
},
onclick : function(ev){
$id("datePickerTable").style.display = 'none';
return false;
},
create : function(el,dateObj,cb){
el.onclick = el.onfocus = function(e){DatePicker.show(el,dateObj,cb);stopEvent(e)};
},
css: "table#datePickerTable td.datePickerNav {\n"+
" cursor:pointer;\n"+
"}\n"+
"\n"+
".datePickerDaysHeader td {\n"+
" text-align:center;\n"+
" background:#ABABAB;\n"+
" font:12px Arial;\n"+
"}\n"+
"\n"+
".datePickerDayRow td {\n"+
" width:18px;\n"+
" height:18px;\n"+
"}\n"+
"\n"+
"td#datePickerMNS, td.datePickerNav {\n"+
" font:bold 13px Arial;\n"+
"}\n"+
"\n"+
"table#datePickerTable {\n"+
" position:absolute;\n"+
" border-collapse:collapse;\n"+
" background:#FFFFFF;\n"+
" border:1px solid #ABABAB;\n"+
" display:none; \n"+
"}\n"+
"\n"+
"table#datePickerTable td{\n"+
" padding: 3px;\n"+
"}\n"+
"\n"+
"td#datePickerMNS {\n"+
" text-align: center;\n"+
"}\n"+
"\n"+
"tr.datePickerDayRow td {\n"+
" background-color : #C4D3EA;\n"+
" cursor : pointer;\n"+
" border : 1px solid #6487AE;\n"+
" text-align : center;\n"+
" font : 10px Arial;\n"+
"}\n"+
"\n"+
"tr.datePickerDayRow td.defaultDate {\n"+
" color : #333333; \n"+
" text-decoration : none; \n"+
"}\n"+
"\n"+
"tr.datePickerDayRow td.emptyDate {\n"+
" cursor:default; \n"+
"}\n"+
"\n"+
"tr.datePickerDayRow td.oldDate {\n"+
" color : #ABABAB;\n"+
" text-decoration : line-through;\n"+
"}\n"+
"tr.datePickerDayRow td.highlightedDate {\n"+
" background : #FFF799;\n"+
" font-weight : bold;\n"+
" color : #333333;\n"+
"}\n"+
"\n"+
"tr.datePickerDayRow td.todayDate {\n"+
" font-weight : bold;\n"+
" color : red;\n"+
"}\n"+
"\n"+
"table#datePickerTable tr.datePickerDayRow td.tdover {\n"+
" background:#fc6;\n"+
"}",
init : function(){
this.setup();
addEvent(document,'click',DatePicker.onclick);
config.shadowTiddlers['StyleSheetDatePicker'] = this.css;
if(store)
store.addNotification('StyleSheetDatePicker',refreshStyles);
}
};
DatePicker.init();
//}}}
//!END-PLUGIN-CODE
// %/
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser excludeLists'></span></div>
<!--}}}-->
/***
|''Name:''|LoadRemoteFileThroughProxy (previous LoadRemoteFileHijack)|
|''Description:''|When the TiddlyWiki file is located on the web (view over http) the content of [[SiteProxy]] tiddler is added in front of the file url. If [[SiteProxy]] does not exist "/proxy/" is added. |
|''Version:''|1.1.0|
|''Date:''|mar 17, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#LoadRemoteFileHijack|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0|
***/
//{{{
version.extensions.LoadRemoteFileThroughProxy = {
major: 1, minor: 1, revision: 0,
date: new Date("mar 17, 2007"),
source: "http://tiddlywiki.bidix.info/#LoadRemoteFileThroughProxy"};
if (!window.bidix) window.bidix = {}; // bidix namespace
if (!bidix.core) bidix.core = {};
bidix.core.loadRemoteFile = loadRemoteFile;
loadRemoteFile = function(url,callback,params)
{
if ((document.location.toString().substr(0,4) == "http") && (url.substr(0,4) == "http")){
url = store.getTiddlerText("SiteProxy", "/proxy/") + url;
}
return bidix.core.loadRemoteFile(url,callback,params);
}
//}}}
merge(Date.prototype,{
addDay: function(n) { this.setDate( this.getDate() + n ); },
addWeek: function(n) { this.setDate( this.getDate() + n*7 ); },
addFortnight: function(n) { this.setDate( this.getDate() + n*14 ); },
addMonth: function(n) { this.setMonth( this.getMonth() + n ); },
addYear: function(n) { this.setYear( this.getFullYear() + n ); }
});
// it works in view mode, that's why we can't just use edit macro
merge(config.macros, {
mgtdEditField: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var fieldName = params[0];
var useTiddler = tiddler;
if (params[1])
useTiddler = store.fetchTiddler(params[1]);
var curVal = useTiddler.fields[fieldName] || '';
var editBox = createTiddlyElement(place,'input',null,'editBox');
editBox.value = curVal;
var callback = function(){
useTiddler.fields[fieldName] = this.value;
useTiddler.touch(); // see MgtdDateUtils
}
editBox.onchange = callback;
}
}
});
!!Options
Show tickler alerts regardless of realm settings.
<<toggleTag AlertsIgnoreRealm MgtdSettings>>
Actions can have multiple contexts.
<<toggleTag MultipleContexts MgtdSettings>>
Show full area name next to actions in action lists instead of just [A].
<<toggleTag FullAreaInActionLists MgtdSettings>>
Show full project name next to actions in action lists instead of just [P].
<<toggleTag FullProjectInActionLists MgtdSettings>>
Show full contact name next to actions in action lists instead of just [C].
<<toggleTag FullContactInActionLists MgtdSettings>>
Week should start on Monday in calendar popups.
<<toggleTag WeekStartsMonday MgtdSettings>>
Enter the date format for ticklers.
Tickler date format:<<mgtdEditField ticklerdateformat MgtdSettings>>
(see [[Date Formats|http://tiddlywiki.org/wiki/Date_Formats]])
Enter the date format for 'new journal'.
Journal date format:<<mgtdEditField newjournaldateformat MgtdSettings>>
(see [[Date Formats|http://tiddlywiki.org/wiki/Date_Formats]])
Hour that ticklers should become active on their tickler date. (0 = Midnight, 12 = Midday)
Tickler activate hour:<<mgtdEditField tickleractivatehour MgtdSettings>>
/***
|''Name:''|PasswordOptionPlugin|
|''Description:''|Extends TiddlyWiki options with non encrypted password option.|
|''Version:''|1.0.2|
|''Date:''|Apr 19, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#PasswordOptionPlugin|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0 (Beta 5)|
***/
//{{{
version.extensions.PasswordOptionPlugin = {
major: 1, minor: 0, revision: 2,
date: new Date("Apr 19, 2007"),
source: 'http://tiddlywiki.bidix.info/#PasswordOptionPlugin',
author: 'BidiX (BidiX (at) bidix (dot) info',
license: '[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D]]',
coreVersion: '2.2.0 (Beta 5)'
};
config.macros.option.passwordCheckboxLabel = "Save this password on this computer";
config.macros.option.passwordInputType = "password"; // password | text
setStylesheet(".pasOptionInput {width: 11em;}\n","passwordInputTypeStyle");
merge(config.macros.option.types, {
'pas': {
elementType: "input",
valueField: "value",
eventName: "onkeyup",
className: "pasOptionInput",
typeValue: config.macros.option.passwordInputType,
create: function(place,type,opt,className,desc) {
// password field
config.macros.option.genericCreate(place,'pas',opt,className,desc);
// checkbox linked with this password "save this password on this computer"
config.macros.option.genericCreate(place,'chk','chk'+opt,className,desc);
// text savePasswordCheckboxLabel
place.appendChild(document.createTextNode(config.macros.option.passwordCheckboxLabel));
},
onChange: config.macros.option.genericOnChange
}
});
merge(config.optionHandlers['chk'], {
get: function(name) {
// is there an option linked with this chk ?
var opt = name.substr(3);
if (config.options[opt])
saveOptionCookie(opt);
return config.options[name] ? "true" : "false";
}
});
merge(config.optionHandlers, {
'pas': {
get: function(name) {
if (config.options["chk"+name]) {
return encodeCookie(config.options[name].toString());
} else {
return "";
}
},
set: function(name,value) {config.options[name] = decodeCookie(value);}
}
});
// need to reload options to load passwordOptions
loadOptionsCookie();
/*
if (!config.options['pasPassword'])
config.options['pasPassword'] = '';
merge(config.optionsDesc,{
pasPassword: "Test password"
});
*/
//}}}
/***
Description: Contains the stuff you need to use Tiddlyspot
Note, you also need UploadPlugin, PasswordOptionPlugin and LoadRemoteFileThroughProxy
from http://tiddlywiki.bidix.info for a complete working Tiddlyspot site.
***/
//{{{
// edit this if you are migrating sites or retrofitting an existing TW
config.tiddlyspotSiteId = 'dato';
// make it so you can by default see edit controls via http
config.options.chkHttpReadOnly = false;
window.readOnly = false; // make sure of it (for tw 2.2)
window.showBackstage = true; // show backstage too
// disable autosave in d3
if (window.location.protocol != "file:")
config.options.chkGTDLazyAutoSave = false;
// tweak shadow tiddlers to add upload button, password entry box etc
with (config.shadowTiddlers) {
SiteUrl = 'http://'+config.tiddlyspotSiteId+'.tiddlyspot.com';
SideBarOptions = SideBarOptions.replace(/(<<saveChanges>>)/,"$1<<tiddler TspotSidebar>>");
OptionsPanel = OptionsPanel.replace(/^/,"<<tiddler TspotOptions>>");
DefaultTiddlers = DefaultTiddlers.replace(/^/,"[[WelcomeToTiddlyspot]] ");
MainMenu = MainMenu.replace(/^/,"[[WelcomeToTiddlyspot]] ");
}
// create some shadow tiddler content
merge(config.shadowTiddlers,{
'TspotOptions':[
"tiddlyspot password:",
"<<option pasUploadPassword>>",
""
].join("\n"),
'TspotControls':[
"| tiddlyspot password:|<<option pasUploadPassword>>|",
"| site management:|<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . . " + config.tiddlyspotSiteId + ">>//(requires tiddlyspot password)//<br>[[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]], [[download (go offline)|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download]]|",
"| links:|[[tiddlyspot.com|http://tiddlyspot.com/]], [[FAQs|http://faq.tiddlyspot.com/]], [[blog|http://tiddlyspot.blogspot.com/]], email [[support|mailto:support@tiddlyspot.com]] & [[feedback|mailto:feedback@tiddlyspot.com]], [[donate|http://tiddlyspot.com/?page=donate]]|"
].join("\n"),
'WelcomeToTiddlyspot':[
"This document is a ~TiddlyWiki from tiddlyspot.com. A ~TiddlyWiki is an electronic notebook that is great for managing todo lists, personal information, and all sorts of things.",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //What now?// @@ Before you can save any changes, you need to enter your password in the form below. Then configure privacy and other site settings at your [[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]] (your control panel username is //" + config.tiddlyspotSiteId + "//).",
"<<tiddler TspotControls>>",
"See also GettingStarted.",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //Working online// @@ You can edit this ~TiddlyWiki right now, and save your changes using the \"save to web\" button in the column on the right.",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //Working offline// @@ A fully functioning copy of this ~TiddlyWiki can be saved onto your hard drive or USB stick. You can make changes and save them locally without being connected to the Internet. When you're ready to sync up again, just click \"upload\" and your ~TiddlyWiki will be saved back to tiddlyspot.com.",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //Help!// @@ Find out more about ~TiddlyWiki at [[TiddlyWiki.com|http://tiddlywiki.com]]. Also visit [[TiddlyWiki.org|http://tiddlywiki.org]] for documentation on learning and using ~TiddlyWiki. New users are especially welcome on the [[TiddlyWiki mailing list|http://groups.google.com/group/TiddlyWiki]], which is an excellent place to ask questions and get help. If you have a tiddlyspot related problem email [[tiddlyspot support|mailto:support@tiddlyspot.com]].",
"",
"@@font-weight:bold;font-size:1.3em;color:#444; //Enjoy :)// @@ We hope you like using your tiddlyspot.com site. Please email [[feedback@tiddlyspot.com|mailto:feedback@tiddlyspot.com]] with any comments or suggestions."
].join("\n"),
'TspotSidebar':[
"<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . . " + config.tiddlyspotSiteId + ">><html><a href='http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download' class='button'>download</a></html>"
].join("\n")
});
//}}}
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |
| 19/12/2011 00:05:06 | YourName | [[/|http://dato.tiddlyspot.com/]] | [[store.cgi|http://dato.tiddlyspot.com/store.cgi]] | . | [[index.html | http://dato.tiddlyspot.com/index.html]] | . | ok |
| 19/12/2011 00:06:56 | YourName | [[/|http://dato.tiddlyspot.com/]] | [[store.cgi|http://dato.tiddlyspot.com/store.cgi]] | . | [[index.html | http://dato.tiddlyspot.com/index.html]] | . |
| 19/12/2011 00:19:57 | YourName | [[/|http://dato.tiddlyspot.com/]] | [[store.cgi|http://dato.tiddlyspot.com/store.cgi]] | . | [[index.html | http://dato.tiddlyspot.com/index.html]] | . |
| 19/12/2011 00:32:33 | YourName | [[/|http://dato.tiddlyspot.com/#test]] | [[store.cgi|http://dato.tiddlyspot.com/store.cgi]] | . | [[index.html | http://dato.tiddlyspot.com/index.html]] | . |
| 19/12/2011 00:34:23 | YourName | [[/|http://dato.tiddlyspot.com/#test]] | [[store.cgi|http://dato.tiddlyspot.com/store.cgi]] | . | [[index.html | http://dato.tiddlyspot.com/index.html]] | . |
| 19/12/2011 00:35:38 | YourName | [[/|http://dato.tiddlyspot.com/#test]] | [[store.cgi|http://dato.tiddlyspot.com/store.cgi]] | . | [[index.html | http://dato.tiddlyspot.com/index.html]] | . |
| 19/12/2011 00:38:46 | YourName | [[/|http://dato.tiddlyspot.com/#test]] | [[store.cgi|http://dato.tiddlyspot.com/store.cgi]] | . | [[index.html | http://dato.tiddlyspot.com/index.html]] | . |
| 19/12/2011 00:41:51 | YourName | [[/|http://dato.tiddlyspot.com/#test]] | [[store.cgi|http://dato.tiddlyspot.com/store.cgi]] | . | [[index.html | http://dato.tiddlyspot.com/index.html]] | . |
| 19/12/2011 00:47:08 | YourName | [[/|http://dato.tiddlyspot.com/#test]] | [[store.cgi|http://dato.tiddlyspot.com/store.cgi]] | . | [[index.html | http://dato.tiddlyspot.com/index.html]] | . |
| 19/12/2011 10:42:04 | YourName | [[/|http://dato.tiddlyspot.com/#test]] | [[store.cgi|http://dato.tiddlyspot.com/store.cgi]] | . | [[index.html | http://dato.tiddlyspot.com/index.html]] | . |
/***
|''Name:''|UploadPlugin|
|''Description:''|Save to web a TiddlyWiki|
|''Version:''|4.1.3|
|''Date:''|Feb 24, 2008|
|''Source:''|http://tiddlywiki.bidix.info/#UploadPlugin|
|''Documentation:''|http://tiddlywiki.bidix.info/#UploadPluginDoc|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0|
|''Requires:''|PasswordOptionPlugin|
***/
//{{{
version.extensions.UploadPlugin = {
major: 4, minor: 1, revision: 3,
date: new Date("Feb 24, 2008"),
source: 'http://tiddlywiki.bidix.info/#UploadPlugin',
author: 'BidiX (BidiX (at) bidix (dot) info',
coreVersion: '2.2.0'
};
//
// Environment
//
if (!window.bidix) window.bidix = {}; // bidix namespace
bidix.debugMode = false; // true to activate both in Plugin and UploadService
//
// Upload Macro
//
config.macros.upload = {
// default values
defaultBackupDir: '', //no backup
defaultStoreScript: "store.php",
defaultToFilename: "index.html",
defaultUploadDir: ".",
authenticateUser: true // UploadService Authenticate User
};
config.macros.upload.label = {
promptOption: "Save and Upload this TiddlyWiki with UploadOptions",
promptParamMacro: "Save and Upload this TiddlyWiki in %0",
saveLabel: "save to web",
saveToDisk: "save to disk",
uploadLabel: "upload"
};
config.macros.upload.messages = {
noStoreUrl: "No store URL in parmeters or options",
usernameOrPasswordMissing: "Username or password missing"
};
config.macros.upload.handler = function(place,macroName,params) {
if (readOnly)
return;
var label;
if (document.location.toString().substr(0,4) == "http")
label = this.label.saveLabel;
else
label = this.label.uploadLabel;
var prompt;
if (params[0]) {
prompt = this.label.promptParamMacro.toString().format([this.destFile(params[0],
(params[1] ? params[1]:bidix.basename(window.location.toString())), params[3])]);
} else {
prompt = this.label.promptOption;
}
createTiddlyButton(place, label, prompt, function() {config.macros.upload.action(params);}, null, null, this.accessKey);
};
config.macros.upload.action = function(params)
{
// for missing macro parameter set value from options
if (!params) params = {};
var storeUrl = params[0] ? params[0] : config.options.txtUploadStoreUrl;
var toFilename = params[1] ? params[1] : config.options.txtUploadFilename;
var backupDir = params[2] ? params[2] : config.options.txtUploadBackupDir;
var uploadDir = params[3] ? params[3] : config.options.txtUploadDir;
var username = params[4] ? params[4] : config.options.txtUploadUserName;
var password = config.options.pasUploadPassword; // for security reason no password as macro parameter
// for still missing parameter set default value
if ((!storeUrl) && (document.location.toString().substr(0,4) == "http"))
storeUrl = bidix.dirname(document.location.toString())+'/'+config.macros.upload.defaultStoreScript;
if (storeUrl.substr(0,4) != "http")
storeUrl = bidix.dirname(document.location.toString()) +'/'+ storeUrl;
if (!toFilename)
toFilename = bidix.basename(window.location.toString());
if (!toFilename)
toFilename = config.macros.upload.defaultToFilename;
if (!uploadDir)
uploadDir = config.macros.upload.defaultUploadDir;
if (!backupDir)
backupDir = config.macros.upload.defaultBackupDir;
// report error if still missing
if (!storeUrl) {
alert(config.macros.upload.messages.noStoreUrl);
clearMessage();
return false;
}
if (config.macros.upload.authenticateUser && (!username || !password)) {
alert(config.macros.upload.messages.usernameOrPasswordMissing);
clearMessage();
return false;
}
bidix.upload.uploadChanges(false,null,storeUrl, toFilename, uploadDir, backupDir, username, password);
return false;
};
config.macros.upload.destFile = function(storeUrl, toFilename, uploadDir)
{
if (!storeUrl)
return null;
var dest = bidix.dirname(storeUrl);
if (uploadDir && uploadDir != '.')
dest = dest + '/' + uploadDir;
dest = dest + '/' + toFilename;
return dest;
};
//
// uploadOptions Macro
//
config.macros.uploadOptions = {
handler: function(place,macroName,params) {
var wizard = new Wizard();
wizard.createWizard(place,this.wizardTitle);
wizard.addStep(this.step1Title,this.step1Html);
var markList = wizard.getElement("markList");
var listWrapper = document.createElement("div");
markList.parentNode.insertBefore(listWrapper,markList);
wizard.setValue("listWrapper",listWrapper);
this.refreshOptions(listWrapper,false);
var uploadCaption;
if (document.location.toString().substr(0,4) == "http")
uploadCaption = config.macros.upload.label.saveLabel;
else
uploadCaption = config.macros.upload.label.uploadLabel;
wizard.setButtons([
{caption: uploadCaption, tooltip: config.macros.upload.label.promptOption,
onClick: config.macros.upload.action},
{caption: this.cancelButton, tooltip: this.cancelButtonPrompt, onClick: this.onCancel}
]);
},
options: [
"txtUploadUserName",
"pasUploadPassword",
"txtUploadStoreUrl",
"txtUploadDir",
"txtUploadFilename",
"txtUploadBackupDir",
"chkUploadLog",
"txtUploadLogMaxLine"
],
refreshOptions: function(listWrapper) {
var opts = [];
for(i=0; i<this.options.length; i++) {
var opt = {};
opts.push();
opt.option = "";
n = this.options[i];
opt.name = n;
opt.lowlight = !config.optionsDesc[n];
opt.description = opt.lowlight ? this.unknownDescription : config.optionsDesc[n];
opts.push(opt);
}
var listview = ListView.create(listWrapper,opts,this.listViewTemplate);
for(n=0; n<opts.length; n++) {
var type = opts[n].name.substr(0,3);
var h = config.macros.option.types[type];
if (h && h.create) {
h.create(opts[n].colElements['option'],type,opts[n].name,opts[n].name,"no");
}
}
},
onCancel: function(e)
{
backstage.switchTab(null);
return false;
},
wizardTitle: "Upload with options",
step1Title: "These options are saved in cookies in your browser",
step1Html: "<input type='hidden' name='markList'></input><br>",
cancelButton: "Cancel",
cancelButtonPrompt: "Cancel prompt",
listViewTemplate: {
columns: [
{name: 'Description', field: 'description', title: "Description", type: 'WikiText'},
{name: 'Option', field: 'option', title: "Option", type: 'String'},
{name: 'Name', field: 'name', title: "Name", type: 'String'}
],
rowClasses: [
{className: 'lowlight', field: 'lowlight'}
]}
};
//
// upload functions
//
if (!bidix.upload) bidix.upload = {};
if (!bidix.upload.messages) bidix.upload.messages = {
//from saving
invalidFileError: "The original file '%0' does not appear to be a valid TiddlyWiki",
backupSaved: "Backup saved",
backupFailed: "Failed to upload backup file",
rssSaved: "RSS feed uploaded",
rssFailed: "Failed to upload RSS feed file",
emptySaved: "Empty template uploaded",
emptyFailed: "Failed to upload empty template file",
mainSaved: "Main TiddlyWiki file uploaded",
mainFailed: "Failed to upload main TiddlyWiki file. Your changes have not been saved",
//specific upload
loadOriginalHttpPostError: "Can't get original file",
aboutToSaveOnHttpPost: 'About to upload on %0 ...',
storePhpNotFound: "The store script '%0' was not found."
};
bidix.upload.uploadChanges = function(onlyIfDirty,tiddlers,storeUrl,toFilename,uploadDir,backupDir,username,password)
{
var callback = function(status,uploadParams,original,url,xhr) {
if (!status) {
displayMessage(bidix.upload.messages.loadOriginalHttpPostError);
return;
}
if (bidix.debugMode)
alert(original.substr(0,500)+"\n...");
// Locate the storeArea div's
var posDiv = locateStoreArea(original);
if((posDiv[0] == -1) || (posDiv[1] == -1)) {
alert(config.messages.invalidFileError.format([localPath]));
return;
}
bidix.upload.uploadRss(uploadParams,original,posDiv);
};
if(onlyIfDirty && !store.isDirty())
return;
clearMessage();
// save on localdisk ?
if (document.location.toString().substr(0,4) == "file") {
var path = document.location.toString();
var localPath = getLocalPath(path);
saveChanges();
}
// get original
var uploadParams = new Array(storeUrl,toFilename,uploadDir,backupDir,username,password);
var originalPath = document.location.toString();
// If url is a directory : add index.html
if (originalPath.charAt(originalPath.length-1) == "/")
originalPath = originalPath + "index.html";
var dest = config.macros.upload.destFile(storeUrl,toFilename,uploadDir);
var log = new bidix.UploadLog();
log.startUpload(storeUrl, dest, uploadDir, backupDir);
displayMessage(bidix.upload.messages.aboutToSaveOnHttpPost.format([dest]));
if (bidix.debugMode)
alert("about to execute Http - GET on "+originalPath);
var r = doHttp("GET",originalPath,null,null,username,password,callback,uploadParams,null);
if (typeof r == "string")
displayMessage(r);
return r;
};
bidix.upload.uploadRss = function(uploadParams,original,posDiv)
{
var callback = function(status,params,responseText,url,xhr) {
if(status) {
var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
displayMessage(bidix.upload.messages.rssSaved,bidix.dirname(url)+'/'+destfile);
bidix.upload.uploadMain(params[0],params[1],params[2]);
} else {
displayMessage(bidix.upload.messages.rssFailed);
}
};
// do uploadRss
if(config.options.chkGenerateAnRssFeed) {
var rssPath = uploadParams[1].substr(0,uploadParams[1].lastIndexOf(".")) + ".xml";
var rssUploadParams = new Array(uploadParams[0],rssPath,uploadParams[2],'',uploadParams[4],uploadParams[5]);
var rssString = generateRss();
// no UnicodeToUTF8 conversion needed when location is "file" !!!
if (document.location.toString().substr(0,4) != "file")
rssString = convertUnicodeToUTF8(rssString);
bidix.upload.httpUpload(rssUploadParams,rssString,callback,Array(uploadParams,original,posDiv));
} else {
bidix.upload.uploadMain(uploadParams,original,posDiv);
}
};
bidix.upload.uploadMain = function(uploadParams,original,posDiv)
{
var callback = function(status,params,responseText,url,xhr) {
var log = new bidix.UploadLog();
if(status) {
// if backupDir specified
if ((params[3]) && (responseText.indexOf("backupfile:") > -1)) {
var backupfile = responseText.substring(responseText.indexOf("backupfile:")+11,responseText.indexOf("\n", responseText.indexOf("backupfile:")));
displayMessage(bidix.upload.messages.backupSaved,bidix.dirname(url)+'/'+backupfile);
}
var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
displayMessage(bidix.upload.messages.mainSaved,bidix.dirname(url)+'/'+destfile);
store.setDirty(false);
log.endUpload("ok");
} else {
alert(bidix.upload.messages.mainFailed);
displayMessage(bidix.upload.messages.mainFailed);
log.endUpload("failed");
}
};
// do uploadMain
var revised = bidix.upload.updateOriginal(original,posDiv);
bidix.upload.httpUpload(uploadParams,revised,callback,uploadParams);
};
bidix.upload.httpUpload = function(uploadParams,data,callback,params)
{
var localCallback = function(status,params,responseText,url,xhr) {
url = (url.indexOf("nocache=") < 0 ? url : url.substring(0,url.indexOf("nocache=")-1));
if (xhr.status == 404)
alert(bidix.upload.messages.storePhpNotFound.format([url]));
if ((bidix.debugMode) || (responseText.indexOf("Debug mode") >= 0 )) {
alert(responseText);
if (responseText.indexOf("Debug mode") >= 0 )
responseText = responseText.substring(responseText.indexOf("\n\n")+2);
} else if (responseText.charAt(0) != '0')
alert(responseText);
if (responseText.charAt(0) != '0')
status = null;
callback(status,params,responseText,url,xhr);
};
// do httpUpload
var boundary = "---------------------------"+"AaB03x";
var uploadFormName = "UploadPlugin";
// compose headers data
var sheader = "";
sheader += "--" + boundary + "\r\nContent-disposition: form-data; name=\"";
sheader += uploadFormName +"\"\r\n\r\n";
sheader += "backupDir="+uploadParams[3] +
";user=" + uploadParams[4] +
";password=" + uploadParams[5] +
";uploaddir=" + uploadParams[2];
if (bidix.debugMode)
sheader += ";debug=1";
sheader += ";;\r\n";
sheader += "\r\n" + "--" + boundary + "\r\n";
sheader += "Content-disposition: form-data; name=\"userfile\"; filename=\""+uploadParams[1]+"\"\r\n";
sheader += "Content-Type: text/html;charset=UTF-8" + "\r\n";
sheader += "Content-Length: " + data.length + "\r\n\r\n";
// compose trailer data
var strailer = new String();
strailer = "\r\n--" + boundary + "--\r\n";
data = sheader + data + strailer;
if (bidix.debugMode) alert("about to execute Http - POST on "+uploadParams[0]+"\n with \n"+data.substr(0,500)+ " ... ");
var r = doHttp("POST",uploadParams[0],data,"multipart/form-data; ;charset=UTF-8; boundary="+boundary,uploadParams[4],uploadParams[5],localCallback,params,null);
if (typeof r == "string")
displayMessage(r);
return r;
};
// same as Saving's updateOriginal but without convertUnicodeToUTF8 calls
bidix.upload.updateOriginal = function(original, posDiv)
{
if (!posDiv)
posDiv = locateStoreArea(original);
if((posDiv[0] == -1) || (posDiv[1] == -1)) {
alert(config.messages.invalidFileError.format([localPath]));
return;
}
var revised = original.substr(0,posDiv[0] + startSaveArea.length) + "\n" +
store.allTiddlersAsHtml() + "\n" +
original.substr(posDiv[1]);
var newSiteTitle = getPageTitle().htmlEncode();
revised = revised.replaceChunk("<title"+">","</title"+">"," " + newSiteTitle + " ");
revised = updateMarkupBlock(revised,"PRE-HEAD","MarkupPreHead");
revised = updateMarkupBlock(revised,"POST-HEAD","MarkupPostHead");
revised = updateMarkupBlock(revised,"PRE-BODY","MarkupPreBody");
revised = updateMarkupBlock(revised,"POST-SCRIPT","MarkupPostBody");
return revised;
};
//
// UploadLog
//
// config.options.chkUploadLog :
// false : no logging
// true : logging
// config.options.txtUploadLogMaxLine :
// -1 : no limit
// 0 : no Log lines but UploadLog is still in place
// n : the last n lines are only kept
// NaN : no limit (-1)
bidix.UploadLog = function() {
if (!config.options.chkUploadLog)
return; // this.tiddler = null
this.tiddler = store.getTiddler("UploadLog");
if (!this.tiddler) {
this.tiddler = new Tiddler();
this.tiddler.title = "UploadLog";
this.tiddler.text = "| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |";
this.tiddler.created = new Date();
this.tiddler.modifier = config.options.txtUserName;
this.tiddler.modified = new Date();
store.addTiddler(this.tiddler);
}
return this;
};
bidix.UploadLog.prototype.addText = function(text) {
if (!this.tiddler)
return;
// retrieve maxLine when we need it
var maxLine = parseInt(config.options.txtUploadLogMaxLine,10);
if (isNaN(maxLine))
maxLine = -1;
// add text
if (maxLine != 0)
this.tiddler.text = this.tiddler.text + text;
// Trunck to maxLine
if (maxLine >= 0) {
var textArray = this.tiddler.text.split('\n');
if (textArray.length > maxLine + 1)
textArray.splice(1,textArray.length-1-maxLine);
this.tiddler.text = textArray.join('\n');
}
// update tiddler fields
this.tiddler.modifier = config.options.txtUserName;
this.tiddler.modified = new Date();
store.addTiddler(this.tiddler);
// refresh and notifiy for immediate update
story.refreshTiddler(this.tiddler.title);
store.notify(this.tiddler.title, true);
};
bidix.UploadLog.prototype.startUpload = function(storeUrl, toFilename, uploadDir, backupDir) {
if (!this.tiddler)
return;
var now = new Date();
var text = "\n| ";
var filename = bidix.basename(document.location.toString());
if (!filename) filename = '/';
text += now.formatString("0DD/0MM/YYYY 0hh:0mm:0ss") +" | ";
text += config.options.txtUserName + " | ";
text += "[["+filename+"|"+location + "]] |";
text += " [[" + bidix.basename(storeUrl) + "|" + storeUrl + "]] | ";
text += uploadDir + " | ";
text += "[[" + bidix.basename(toFilename) + " | " +toFilename + "]] | ";
text += backupDir + " |";
this.addText(text);
};
bidix.UploadLog.prototype.endUpload = function(status) {
if (!this.tiddler)
return;
this.addText(" "+status+" |");
};
//
// Utilities
//
bidix.checkPlugin = function(plugin, major, minor, revision) {
var ext = version.extensions[plugin];
if (!
(ext &&
((ext.major > major) ||
((ext.major == major) && (ext.minor > minor)) ||
((ext.major == major) && (ext.minor == minor) && (ext.revision >= revision))))) {
// write error in PluginManager
if (pluginInfo)
pluginInfo.log.push("Requires " + plugin + " " + major + "." + minor + "." + revision);
eval(plugin); // generate an error : "Error: ReferenceError: xxxx is not defined"
}
};
bidix.dirname = function(filePath) {
if (!filePath)
return;
var lastpos;
if ((lastpos = filePath.lastIndexOf("/")) != -1) {
return filePath.substring(0, lastpos);
} else {
return filePath.substring(0, filePath.lastIndexOf("\\"));
}
};
bidix.basename = function(filePath) {
if (!filePath)
return;
var lastpos;
if ((lastpos = filePath.lastIndexOf("#")) != -1)
filePath = filePath.substring(0, lastpos);
if ((lastpos = filePath.lastIndexOf("/")) != -1) {
return filePath.substring(lastpos + 1);
} else
return filePath.substring(filePath.lastIndexOf("\\")+1);
};
bidix.initOption = function(name,value) {
if (!config.options[name])
config.options[name] = value;
};
//
// Initializations
//
// require PasswordOptionPlugin 1.0.1 or better
bidix.checkPlugin("PasswordOptionPlugin", 1, 0, 1);
// styleSheet
setStylesheet('.txtUploadStoreUrl, .txtUploadBackupDir, .txtUploadDir {width: 22em;}',"uploadPluginStyles");
//optionsDesc
merge(config.optionsDesc,{
txtUploadStoreUrl: "Url of the UploadService script (default: store.php)",
txtUploadFilename: "Filename of the uploaded file (default: in index.html)",
txtUploadDir: "Relative Directory where to store the file (default: . (downloadService directory))",
txtUploadBackupDir: "Relative Directory where to backup the file. If empty no backup. (default: ''(empty))",
txtUploadUserName: "Upload Username",
pasUploadPassword: "Upload Password",
chkUploadLog: "do Logging in UploadLog (default: true)",
txtUploadLogMaxLine: "Maximum of lines in UploadLog (default: 10)"
});
// Options Initializations
bidix.initOption('txtUploadStoreUrl','');
bidix.initOption('txtUploadFilename','');
bidix.initOption('txtUploadDir','');
bidix.initOption('txtUploadBackupDir','');
bidix.initOption('txtUploadUserName','');
bidix.initOption('pasUploadPassword','');
bidix.initOption('chkUploadLog',true);
bidix.initOption('txtUploadLogMaxLine','10');
// Backstage
merge(config.tasks,{
uploadOptions: {text: "upload", tooltip: "Change UploadOptions and Upload", content: '<<uploadOptions>>'}
});
config.backstageTasks.push("uploadOptions");
//}}}
//{{{
//requires DatePicker: http://svn.tiddlywiki.org/Trunk/contributors/SaqImtiaz/libraries/DatePicker.js
if (DatePicker) {
merge(config.macros, {
calendarPopup: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var dateBox = createTiddlyButton(place,params[0],params[1]);
dateBox.style.cursor='pointer';
DatePicker.create(dateBox,(new Date()),function(el,objDate) {
// mostly copy/pasted from NewSavedTiddler. refactor please
var title = prompt("Enter name for new Tickler","");
if (title) {
if (typeof config.macros.newTiddler.getName == "function") {
title = config.macros.newTiddler.getName(title); // from NewMeansNewPlugin
}
store.saveTiddler(title,title,"",config.options.txtUserName,new Date(),"Tickler Once "+config.macros.mgtdList.getRealm(),{'mgtd_date':objDate.convertToYYYYMMDDHHMM()});
story.displayTiddler(this,title);
}
});
}
},
dateChooser: {
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var useTiddler = tiddler;
if (params[0])
useTiddler = store.fetchTiddler(params[0]);
var curVal = useTiddler.fields['mgtd_date'] || undefined;
var startDate = curVal ? Date.convertFromYYYYMMDDHHMM(curVal) : null;
var dateBox = createTiddlyElement(place,'input',null,'dateBox');
var dateFormat = config.mGTD.getOptTxt('ticklerdateformat');
var defaultDateFormat = 'ddd, DD-mmm-YY';
if (!dateFormat) {
// makes it nicer for upgraders who don't have a format set
dateFormat = defaultDateFormat;
config.mGTD.setOptTxt('ticklerdateformat', defaultDateFormat);
}
dateBox.value = startDate ? startDate.formatString(dateFormat) : '(set date)';
var callback = function(el,objDate){
el.value = objDate.formatString(dateFormat);
store.setValue(useTiddler, 'mgtd_date',objDate.convertToYYYYMMDDHHMM());
}
DatePicker.create(dateBox,startDate,callback);
}
},
addDay: {
label: {addDay:"+d", addWeek:"+w", addFortnight:"+f", addMonth:"+m", addYear:"+y" },
tooltip: {addDay:"day", addWeek:"week", addFortnight:"fortnight", addMonth:"month", addYear:"year" },
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var useTiddler = tiddler;
if (params[0]) useTiddler = store.fetchTiddler(params[0]);
var curVal = useTiddler.fields['mgtd_date'] || undefined;
var curDate = curVal ? Date.convertFromYYYYMMDDHHMM(curVal) : new Date();
// ensure ticklers don't have minutes/hours since new Date() has minutes/hours
curDate.setHours(0);
curDate.setMinutes(0);
curDate.setSeconds(0);
// call the applicable date method. happens to match the macroname. see MgtdDateUtils. sorry for confusing code.
curDate[macroName](1);
createTiddlyButton(place,config.macros.addDay.label[macroName],"add a "+config.macros.addDay.tooltip[macroName],function() {
store.setValue(useTiddler, 'mgtd_date',curDate.convertToYYYYMMDDHHMM());
return false;
});
}
}
});
config.macros.addWeek = config.macros.addDay;
config.macros.addFortnight = config.macros.addDay;
config.macros.addMonth = config.macros.addDay;
config.macros.addYear = config.macros.addDay;
} // if (DatePicker)
//}}}
.datepicker {
position: absolute;
border: 2px solid #1C3262;
font-size: 11px;
width: 194px;
padding: 3px;
height: 221px;
background: #fff;
line-height: normal;
}
/* header
********************************************************/
.datepicker .header {
position: relative;
background: #1C3262;
height: 21px;
padding-top: 4px;
margin-bottom: 3px;
}
.datepicker .header .title {
text-align: center;
padding-top: 1px;
margin: 0px 42px 0 20px;
}
.datepicker .header .titleText {
color: #fff;
font-weight: bold;
}
.datepicker .header .next,
.datepicker .header .previous,
.datepicker .header .closeButton {
position: absolute;
width: 15px;
height: 15px;
background: #fff;
text-align: center;
color: #666;
top: 5px;
cursor: pointer;
}
.datepicker .header .previous {
left: 5px;
}
.datepicker .header .next {
right: 28px;
}
.datepicker .header .closeButton {
right: 5px;
}
/* body
********************************************************/
.datepicker .body {
position: relative;
top: 0px;
left: 0px;
width: 194px;
border-right: 2px solid #fff;
height: 193px;
overflow: hidden;
}
/* time
********************************************************/
.datepicker .time {
width: 100%;
height: 100%;
background: #eee;
}
.datepicker .time .hour,
.datepicker .time .separator,
.datepicker .time .minutes {
border: 1px solid #ccc;
background: #fff;
width: 50px;
font-size: 32px;
position: absolute;
top: 50px;
text-align: center;
padding: 2px;
}
.datepicker .time .hour {
left: 30px;
}
.datepicker .time .separator {
background: transparent;
border: 0px;
width: 10px;
left: 91px;
}
.datepicker .time .minutes {
left: 110px;
}
.datepicker .time .ok {
position: absolute;
top: 105px;
width: 136px;
left: 30px;
font-size: 20px;
}
/* days-grid
********************************************************/
.datepicker .days .day {
float: left;
background: #ccc;
cursor: pointer;
text-align: center;
padding-top: 4px;
width: 25px;
overflow: hidden;
height: 21px;
margin: 0 3px 3px 0;
}
.datepicker .days .day0 {
margin-right: 0;
}
.datepicker .days .week5 .day {
margin-bottom: 0;
}
/* days-colors
********************************************************/
.datepicker .days .title {
background: #5D6E95;
font-weight: bold;
color: #fff;
cursor: default;
}
.datepicker .days .otherMonth {
background: #eee;
color: #aaa;
}
/* months
********************************************************/
.datepicker .months .month {
float: left;
background: #eee;
cursor: pointer;
text-align: center;
overflow: hidden;
width: 62px;
height: 31px;
padding-top: 15px;
margin: 0 3px 3px 0;
}
.datepicker .months .month3,
.datepicker .months .month6,
.datepicker .months .month9,
.datepicker .months .month12 {
margin-right: 0;
width: 64px;
}
.datepicker .months .month10,
.datepicker .months .month11,
.datepicker .months .month12 {
margin-bottom: 0;
}
/* years
********************************************************/
.datepicker .years .year {
float: left;
background: #eee;
cursor: pointer;
text-align: center;
padding-top: 11px;
width: 46px;
overflow: hidden;
height: 25px;
margin: 0 3px 3px 0;
}
.datepicker .years .year3,
.datepicker .years .year7,
.datepicker .years .year11,
.datepicker .years .year15,
.datepicker .years .year19 {
margin-right: 0;
width: 47px;
}
.datepicker .years .year16,
.datepicker .years .year17,
.datepicker .years .year18,
.datepicker .years .year19 {
margin-bottom: 0;
height: 26px;
}
/* global
********************************************************/
.datepicker .selected {
background: #8C929F !important;
color: #fff !important;
}
.datepicker .unavailable {
background: #edd !important;
color: #b88 !important;
cursor: default !important;
}
.datepicker .days .week .day:hover,
.datepicker .months .month:hover,
.datepicker .years .year:hover {
background: #5D6E95 !important;
color: #fff !important;
}
http://dl.dropbox.com/u/9385804/FrDPlugins.html
http://dl.dropbox.com/u/9385804/FrDPlugins.html
config.mptwDateFormat = 'DD/MM/YY';
config.mptwJournalFormat = 'Journal DD/MM/YY';
config.mGTD.getOptChk = function(option) { return store.fetchTiddler('MgtdSettings').tags.contains(option); }
config.mGTD.getOptTxt = function(fieldName) { return store.fetchTiddler('MgtdSettings').fields[fieldName.toLowerCase()]; }
config.mGTD.setOptTxt = function(fieldName,fieldValue) { store.fetchTiddler('MgtdSettings').fields[fieldName.toLowerCase()] = fieldValue; }