Welcome to TiddlyWiki created by Jeremy Ruston, Copyright © 2007 UnaMesa Association
/*{{{*/
window.ccTiddlyVersion = '1.6.1';
window.workspacePermission= {};
window.url = "http://casa.colorado.edu/~jdarling/megawiki";
window.workspace = "";
config.options.txtTheme = 'simpleTheme';
workspacePermission.anonC = 0 ;
workspacePermission.anonR = 1;
workspacePermission.anonU = 0;
workspacePermission.anonD = 0;
// hide new journal
config.macros.newJournal.handler=function(place,macroName,params,wikifier,paramString,tiddler){};
// hide new tiddler
config.macros.newTiddler.handler = function(place,macroName,params,wikifier,paramString,tiddler){};
// PHP TO JAVASCRIPT VARIABLE ASSIGNMENT ---
window.workspace_delete = "D";
window.workspace_udate = "";
window.can_create_account = "0";
window.openid_enabled = "0";
setStylesheet(store.getRecursiveTiddlerText("ccStyleSheet",10),"ccStyleSheet");
/*}}}*/
/***
|''Name''|ccRegister|
|''Description''|Allows users to Register for a user account. If the user is logged in there are informed of their username This Macro will later be added to ccLogin Status|
|''Author''|[[Simon McManus|http://simonmcmanus.com]] |
|''Version''|1.0.1|
|''Date''|12/05/2008|
|''Status''|@@alpha@@|
|''Source''|http://svn.tiddlywiki.org/Trunk/association/serversides/cctiddly/ccPlugins/ccRegister.js|
|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/association/serversides/cctiddly/ccPlugins/ccRegister.js|
|''License''|BSD|
|''Requires''|ccLogin, ccLoginStatus|
|''Feedback''|http://groups.google.com/group/ccTiddly|
|''Keywords''|ccTiddly ccRegister|
!Description
Show the current user their login status.
!Usage
{{{
<>
}}}
!Code
***/
//{{{
config.macros.ccRegister ={};
config.macros.ccRegister.handler=function(place,macroName,params,wikifier,paramString,tiddler){
var registerDiv = createTiddlyElement(place,"div",null,"loginDiv",null);
this.refresh(registerDiv);
};
config.macros.ccRegister.refresh=function(place,errorMsg){
var loginDivRef = document.getElementById("LoginDiv");
removeChildren(loginDivRef);
var wrapper = createTiddlyElement(place,"div");
if (can_create_account != 1){
createTiddlyElement(place,'div',null,"annotation",'You do not have permissions to register for an account ');
return null;
}
if (errorMsg=='201'){
return false;
}
var frm=createTiddlyElement(place,"form",null,"wizard");
frm.onsubmit= config.macros.ccRegister.registerOnSubmit;
createTiddlyElement(frm,"h1",null,null,"Register");
createTiddlyElement(frm,"h2",null,null,"Sign up for an account");
createTiddlyElement(frm,"br");
var body=createTiddlyElement(frm,"div",null,"wizardBody");
var step=createTiddlyElement(body,"div",null,"wizardStep");
var user_label = createTiddlyElement(step,"label",null,"label","Username");
user_label.setAttribute("for","username");
var username=createTiddlyElement(null,"input","username" ,"input");
username.onkeyup=function() {
config.macros.ccRegister.usernameKeyPress(this.value);
};
step.appendChild(username);
username.setAttribute("tabindex","1");
createTiddlyElement(step,"span",'username_error','inlineError',null);
createTiddlyElement(step,"br");
var mail_label = createTiddlyElement(step,"label",null,"label","E-Mail Address");
mail_label.setAttribute("for","username");
var mail=createTiddlyElement(null,"input","mail" ,"input");
mail.onkeyup=function() {
config.macros.ccRegister.mailKeyUp(this.value);
};
step.appendChild(mail);
mail.setAttribute("tabindex","2");
createTiddlyElement(step,"span",'mail_error','inlineError','');
createTiddlyElement(step,"br");
var pw1_label = createTiddlyElement(step,"label",null,"label","Password");
pw1_label.setAttribute("for","password1");
var password1 = createTiddlyElement(null,"input","password1","input");
password1.setAttribute("type","password");
password1.setAttribute("tabindex","3");
step.appendChild(password1);
createTiddlyElement(step,"span",'mail_error','inlineError','');
createTiddlyElement(step,"span",'pass1_error','inlineError');
createTiddlyElement(step,"br");
var pw2_label = createTiddlyElement(step,"label",null,"label","Password Confirmation");
pw2_label.setAttribute("for","password2");
var password2 = createTiddlyElement(null,"input","password2","input");
password2.setAttribute("type","password");
password2.setAttribute("tabindex","4");
step.appendChild(password2);
createTiddlyElement(step,"span",'pass2_error','inlineError');
createTiddlyElement(step,"br");
var a = createTiddlyElement(step,"div",null,"submit");
var btn = createTiddlyElement(null,"input",this.prompt,"button");
btn.setAttribute("type","submit");
btn.setAttribute("value","Register Account");
btn.setAttribute("tabindex","5");
btn.setAttribute("id","registerAccountSubmit");
a.appendChild(btn);
createTiddlyElement(a,"span","submitStatus",null,"");
};
config.macros.ccRegister.emailValid=function(str){
if((str.indexOf(".") > 0) && (str.indexOf("@") > 0)){
return true;
}else{
return false;
}
};
config.macros.ccRegister.mailKeyUp=function(mail){
if(config.macros.ccRegister.emailValid(mail)){
var a=document.getElementById('mail_error');
var field=document.getElementById('mail');
a.innerHTML='The email address is valid ';
a.setAttribute("class","inlineOk");
a.setAttribute("className", "inlineOk");
field.setAttribute("class","input");
}
};
config.macros.ccRegister.registerOnSubmit=function(){
if(this.username.value==''){
document.getElementById('username_error').innerHTML='Please enter a username';
this.username.setAttribute("class","inputError");
return false;
}else{
document.getElementById('username_error').innerHTML='Please enter a username';
this.username.setAttribute("class","input");
}
var mail_space="";
if(this.username.value===''){
displayMessage('no username entered');
}
if(config.macros.ccRegister.emailValid(this.mail.value)){
mail_space=document.getElementById('mail_error');
mail_space.innerHTML="email ok";
mail_space.setAttribute("class","inlineOk");
}else{
mail_space=document.getElementById('mail_error');
mail_space.innerHTML='not a valid email address ';
mail_space.setAttribute("class","inlineError");
return false;
}
if(this.password1.value===''){
document.getElementById('pass1_error').innerHTML='Please enter a password';
this.password1.setAttribute("class","inputError");
return false;
}else{
document.getElementById('pass1_error').innerHTML='';
this.password1.setAttribute("class","input");
}
if(this.password2.value===''){
document.getElementById('pass2_error').innerHTML='Please enter a password';
this.password2.setAttribute("class","inputError");
return false;
}else{
document.getElementById('pass2_error').innerHTML='';
this.password2.setAttribute("class","input");
}
if(this.password1.value != this.password2.value ){
this.password1.setAttribute("class","inputError");
document.getElementById('pass2_error').innerHTML='Please ensure both passwords match';
this.password2.setAttribute("class","inputError");
return false;
}
var submit=document.getElementById('registerAccountSubmit');
submit.disabled=true;
submit.setAttribute("class","buttonDisabled");
document.getElementById('submitStatus').innerHTML='Please wait, your account is being created.';
setTimeout(config.macros.ccRegister.registerCheckResp,3000);
displayMessage(this.username.value);
doHttp('POST',url+'/handle/register.php',"username=" + encodeURIComponent(this.username.value)+ "&password="+Crypto.hexSha1Str(this.password1.value).toLowerCase(),null,null,null,config.macros.ccRegister.registerCallback,null);
return false;
};
config.macros.ccRegister.registerCheckResp=function(){
if (registerState !="Fail" && registerState !="ok"){
alert("Your registration has timed out. ");
}
};
config.macros.ccRegister.registerCallback=function(status,params,responseText,uri,xhr){
if(xhr.status=='201'){
registerState="ok";
var loginDiv=document.getElementById("LoginDiv");
document.getElementById('submitStatus').innerHTML='Your account has been created ';
document.getElementById('username').value='';
document.getElementById('mail').value='';
document.getElementById('password1').value='';
document.getElementById('password2').value='';
document.getElementById('username_error').innerHTML='';
document.getElementById('mail_error').innerHTML='';
document.getElementById('pass1_error').innerHTML='';
document.getElementById('pass2_error').innerHTML='';
var but=document.getElementById('registerAccountSubmit');
but.disabled=false;
but.setAttribute("class","button");
document.getElementById('registerAccountSubmit').setAttribute('class','button');
}else{
registerState ="Fail";
}
};
config.macros.ccRegister.usernameKeyPress=function(){
doHttp('POST',url+'/handle/register.php',"username="+document.getElementById("username").value+"&free=1",null,null,null,config.macros.ccRegister.usernameCallback,null);
return false;
};
config.macros.ccRegister.usernameCallback=function(status,params,responseText,uri,xhr){
var field = "";
if(responseText > 0){
var error=document.getElementById('username_error');
field=document.getElementById('username');
error.innerHTML='The username has already been taken. ';
error.setAttribute("class","inlineError");
// For IE
error.setAttribute("className", "inlineError");
field.setAttribute("class","inputError");
}else{
var a = document.getElementById('username_error');
field = document.getElementById('username');
a.innerHTML='The username is available ';
// For IE
a.setAttribute("className", "inlineOk");
a.setAttribute("class","inlineOk");
field.setAttribute("class","input");
}
};
//}}}
[[Login]] [[GettingStarted]]
/***
|''Name''|ccAbout|
|''Description''|The ccAbout macro lets you find the current version number in ccTiddly|
|''Author''|Simon McManus|
|''Contributors''|Simon McManus|
|''Version''|2.3|
|''Date''|12/05/08|
|''Status''|@@alpha@@;|
|''Source''|http://svn.tiddlywiki.org/Trunk/association/serversides/cctiddly/ccPlugins/ccAbout.js|
|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/association/serversides/cctiddly/ccPlugins/ccAbout.js|
|''License''|BSD|
|''Feedback''|http://groups.google.com/group/ccTiddly|
|''Keywords''|ccTiddly ccAbout|
!Usage
{{{
<>
}}}
***/
//{{{
config.backstageTasks.push("about");
merge(config.tasks,{about:{text: "about",tooltip: "Find out more about ccTiddly ",content: '<<ccAbout>>'}});
config.macros.ccAbout={};
config.macros.ccAbout.handler=function(place,macroName,params,wikifier,paramString,tiddler,errorMsg){
createTiddlyElement(place,"h1","","","About ccTiddly");
createTiddlyElement(place,"br");
var str="You are running ccTiddly " + window.ccTiddlyVersion;
createTiddlyText(place,str);
createTiddlyElement(place,"br");
createTiddlyElement(place,"br");
var str="more info about ccTiddly can be found at " ;
createTiddlyText(place,str);
var link=createExternalLink(place,'http://tiddlywiki.org/wiki/CcTiddly');
link.textContent='http://tiddlywiki.org/wiki/CcTiddly';
};
//}}}
/***
|''Name''|ccSave|
|''Description''|Currently only being used to stop the upgrade option |
|''Author''|[[Simon McManus|http://simonmcmanus.com]] |
|''Version''|1.0.1|
|''Date''|12/05/2008|
!Code
***/
//{{{
// GENERAL ccTiddly Bits
config.backstageTasks.remove("upgrade");
config.backstageTasks.remove("save");
//}}}
/***
|''Name:''|ccLoadRemoteFileThroughProxy (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){
var urlStart = window.url;
if((document.location.toString().substr(0,4)=="http")&&(url.substr(0,4)=="http")){
url=urlStart+"/"+store.getTiddlerText("SiteProxy","/proxy")+url;
}
var a = bidix.core.loadRemoteFile(url,callback,params);
return a;
}
//}}}
/***
|''Name:''|simpleTheme|
|''~StyleSheet:''|##StyleSheet|
***/
!StyleSheet
#mainMenu {display:none}
#sidebarOptions{display:none}
#sidebarTabs {display:none}
/*}}}*/
/***
|Name|TaggedTemplateTweak|
|Source|http://www.TiddlyTools.com/#TaggedTemplateTweak|
|Documentation|http://www.TiddlyTools.com/#TaggedTemplateTweakInfo|
|Version|1.2.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br> and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.chooseTemplateForTiddler()|
|Description|use alternative ViewTemplate/EditTemplate for tiddler's tagged with specific tag values|
This tweak extends story.chooseTemplateForTiddler() so that ''whenever a tiddler is marked with a specific tag value, it can be viewed and/or edited using alternatives to the standard tiddler templates.''
!!!!!Documentation
>see [[TaggedTemplateTweakInfo]]
!!!!!Revisions
<<<
2008.04.01 [1.2.0] added support for using systemTheme section-based template definitions (requested by Phil Hawksworth)
2008.01.22 [*.*.*] plugin size reduction - documentation moved to [[TaggedTemplateTweakInfo]]
2007.06.23 [1.1.0] re-written to use automatic 'tag prefix' search instead of hard coded check for each tag. Allows new custom tags to be used without requiring code changes to this plugin.
| please see [[TaggedTemplateTweakInfo]] for previous revision details |
2007.06.11 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.taggedTemplate= {major: 1, minor: 2, revision: 0, date: new Date(2008,4,1)};
Story.prototype.taggedTemplate_chooseTemplateForTiddler = Story.prototype.chooseTemplateForTiddler
Story.prototype.chooseTemplateForTiddler = function(title,template)
{
// get default template from core
var template=this.taggedTemplate_chooseTemplateForTiddler.apply(this,arguments);
// if the tiddler to be rendered doesn't exist yet, just return core result
var tiddler=store.getTiddler(title); if (!tiddler) return template;
// look for template whose prefix matches a tag on this tiddler
for (i=0; i<tiddler.tags.length; i++) {
var t=tiddler.tags[i]+template; // add tag prefix
var c=t.substr(0,1).toUpperCase()+t.substr(1); // capitalized for WikiWord title
var s=config.options.txtTheme+"##"; // systemTheme section prefix
if (store.tiddlerExists(t)) { template=t; break; }
if (store.tiddlerExists(c)) { template=c; break; }
if (store.getTiddlerText(s+t)) { template=s+t; break; }
if (store.getTiddlerText(s+c)) { template=s+c; break; }
}
return template;
}
//}}}
/***
|''Name''|ccLoginStatus|
|''Description''|Allows users to see their login status and displays the options to login or logout. This Macro will later be added to ccLogin|
|''Author''|[[Simon McManus|http://simonmcmanus.com]] |
|''Version''|1.0.1|
|''Date''|12/05/2008|
|''Status''|@@alpha@@|
|''Source''|http://svn.tiddlywiki.org/Trunk/association/serversides/cctiddly/ccPlugins/ccLoginStatus.js|
|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/association/serversides/cctiddly/ccPlugins/ccLoginStatus.js|
|''License''|BSD|
|''Requires''|ccRegister, ccLogin|
|''Feedback''|http://groups.google.com/group/ccTiddly|
|''Keywords''|ccTiddly ccLoginStatus|
!Description
Show the current user their login status.
!Usage
{{{
<>
}}}
!Code
***/
//{{{
config.macros.ccLoginStatus={};
config.macros.ccLoginStatus.handler=function(place,macroName,params,wikifier,paramString,tiddler){
var loginDiv=createTiddlyElement(place,"div",null,"loginDiv",null);
this.refresh(loginDiv);
};
config.macros.ccLoginStatus.refresh=function(place,errorMsg){
var loginDivRef=document.getElementById ("LoginDiv");
removeChildren(loginDivRef);
var wrapper=createTiddlyElement(place,"div");
if (isLoggedIn()){
createTiddlyElement(wrapper,"br");
name = cookieString(document.cookie).txtUserName;
var str=wikify("You are viewing the workspace "+workspace +" and are logged in as: "+decodeURIComponent(name),wrapper);
var btn=createTiddlyElement(null,"input",null,"button");
btn.setAttribute("type", "button");
btn.onclick=function() {
window.location = window.location+"?&logout=1"
};
// btn.setAttribute("type","submit");d
btn.value="Logout";
wrapper.appendChild(btn);
}else{
wikify("[[Login]]",wrapper);
}
};
//}}}
If you've forgotten your username and / or password, please contact the administrator:
simon@osmosoft.com
/***
|''Name''|ccLogin|
|''Description''|Allows users to login to ccTiddly, In future, this will include the ccRegister and ccLoginStatus Status Macro|
|''Author''|[[Simon McManus|http://simonmcmanus.com]] |
|''Version''|1.0.1|
|''Date''|12/05/2008|
|''Status''|@@alpha@@|
|''Source''|http://svn.tiddlywiki.org/Trunk/association/serversides/cctiddly/ccPlugins/ccLogin.js|
|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/association/serversides/cctiddly/ccPlugins/ccLogin.js|
|''License''|BSD|
|''Requires''|ccRegister, ccLogin|
|''Overrides''|restart|
|''Feedback''|http://groups.google.com/group/ccTiddly|
|''Keywords''|ccTiddly ccLogin|
!Description
To display a login prompt for your user simple type the following text into a tiddler function tiddler :
!Usage
{{{
<>
}}}
!Code
***/
//{{{
config.backstageTasks.push("login");
merge(config.tasks,{login:{text: "login",tooltip: "Login to your TiddlyWiki",content: '<<ccLogin>>'}});
config.macros.saveChanges.handler=function(place,macroName,params,wikifier,paramString,tiddler){};
var loginState=null;
var registerState=null;
config.macros.toolbar.isCommandEnabled=function(command,tiddler){
var title=tiddler.title;
if (workspace_delete=="D"){
// REMOVE OPTION TO DELETE TIDDLERS
if (command.text=='delete'){
return false;
}
}
if (workspace_udate=="D"){
// REMOVE EDIT LINK FROM TIDDLERS
if (command.text=='edit'){
return false;
}
}
var ro=tiddler.isReadOnly();
var shadow=store.isShadowTiddler(title) && !store.tiddlerExists(title);
return (!ro || (ro && !command.hideReadOnly)) && !(shadow && command.hideShadow);
};
// Returns output var with output.txtUsername and output.sessionToken
function findToken(cookieStash){
var output={};
if (!cookieStash){
return false;
}
// THIS IS VERY HACKY AND SHOULD BE REFACTORED WHEN TESTS ARE IN PLACE
var cookies=cookieStash.split('path=/');
for(var c=0; c < cookies.length ; c++){
var cl =cookies[c].split(";");
for(var e=0; e < cl.length; e++){
var p=cl[e].indexOf("=");
if(p!=-1){
var name=cl[e].substr(0,p).trim();
var value=cl[e].substr(p+1).trim();
if (name=='txtUserName'){
output.txtUserName=value;
}
if (name=='sessionToken'){
output.sessionToken=value;
}
}
}
}
return output;
}
function cookieString(str){
var cookies = str.split(";");
var output = {};
for(var c=0; c < cookies.length; c++){
var p = cookies[c].indexOf("=");
if(p != -1) {
var name = cookies[c].substr(0,p).trim();
var value = cookies[c].substr(p+1).trim();
if (name=='txtUserName'){
output.txtUserName=value;
}
if (name=='sessionToken'){
output.sessionToken=value;
}
}
}
return output;
}
function isLoggedIn(){
if(window.loggedIn == '1'){
return true;
}else{
return false;
}
}
config.macros.ccLogin={};
config.macros.ccLogin.handler=function(place,macroName,params,wikifier,paramString,tiddler){
var loginDiv=createTiddlyElement(place,"div",null,"loginDiv",null);
this.refresh(loginDiv);
};
config.macros.ccLogin.refresh=function(place,errorMsg){
var loginDivRef=document.getElementById("LoginDiv");
removeChildren(loginDivRef);
var wrapper=createTiddlyElement(place,"div");
var cookieValues=findToken(document.cookie);
var frm="";
if (isLoggedIn()){
// user is logged in
var msg=createTiddlyElement(wrapper,"div");
// display the logout button
config.macros.ccLoginStatus.handler(msg);
}else{
//user not logged in.
frm=createTiddlyElement(wrapper,"form",null,"wizard");
frm.onsubmit=this.loginOnSubmit;
createTiddlyElement(frm,"h1",null,null,"Login");
createTiddlyElement(frm,"h2",null,null,"Login to ccTiddly");
createTiddlyElement(frm,"br");
var body=createTiddlyElement(frm,"div",null,"wizardBody");
var step=createTiddlyElement(body,"div",null,"wizardStep");
if(errorMsg!==null){
createTiddlyElement(step,"span",null,null,errorMsg);
createTiddlyElement(step,"br");
}
createTiddlyElement(step,"br");
var oidfrm=createTiddlyElement(step,"form",null,null);
oidfrm.method='get';
oidfrm.action='includes/openid/try_auth.php';
if (openid_enabled==1){
createTiddlyElement(oidfrm,"br");
createTiddlyText(oidfrm,"You can get an openID from ");
var link=createExternalLink(oidfrm,'http://myopenid.com');
link.textContent='http://myopenid.com';
createTiddlyElement(oidfrm,"br");
createTiddlyElement(oidfrm,"br");
createTiddlyText(oidfrm,'OpenID:');
var oidaction=createTiddlyElement(null,"input",null);
oidaction.setAttribute("type","hidden");
oidaction.setAttribute("value","verify");
oidfrm.appendChild(oidaction);
var oidid=createTiddlyElement(null,"input",null);
oidid.setAttribute("type","text");
oidid.setAttribute("name","openid_identifier");
oidfrm.appendChild(oidid);
var oidsub=createTiddlyElement(null,"input",null);
oidsub.setAttribute("type","submit");
oidsub.setAttribute("value","Verify");
oidfrm.appendChild(oidsub);
}else{
var user_label=createTiddlyElement(step,"label",null,"label","Username");
user_label.setAttribute("for","cctuser");
var txtuser=createTiddlyElement(step,"input","cctuser","input");
if (cookieValues.txtUserName!==undefined){
txtuser.value=cookieValues.txtUserName ;
}
createTiddlyElement(step,"br");
var pass_label=createTiddlyElement(step,"label",null,"label","Password");
pass_label.setAttribute("for","cctpass");
var txtpass=createTiddlyElement(null,"input","cctpass","input",null,{"type":"password"});
// var txtpass=createTiddlyElement(step,"input","cctpass","cctpass");
txtpass.setAttribute("type","password");
step.appendChild(txtpass);
createTiddlyElement(step,"br");
var submitSpan=createTiddlyElement(step,"div");
submitSpan.setAttribute("class","submit");
var btn1=createTiddlyElement(null,"input",this.prompt,"button");
btn1.setAttribute("type","submit");
btn1.setAttribute("id","loginButton");
btn1.value="Login";
submitSpan.appendChild(btn1);
createTiddlyElement(submitSpan,'p');
var li=createTiddlyElement(submitSpan,'li');
createTiddlyLink(li,'Register','Register');
var li1=createTiddlyElement(submitSpan,'li');
createTiddlyLink(li1,'Forgotten Details','Forgotten Details');
}
}
};
config.macros.killLoginCookie=function(){
var c='sessionToken=invalid';
c+="; expires=Fri, 1 Jan 1811 12:00:00 UTC; path=/";
document.cookie=c;
};
config.macros.ccLogin.logoutOnSubmit=function(){
var loginDivRef=findRelated(this,"loginDiv","className","parentNode");
removeChildren(loginDivRef);
document.cookie="sessionToken=invalid; expires=15/02/2009 00:00:00";
document.cookie = '';
config.macros.killLoginCookie();
//config.macros.ccLogin.refresh(loginDivRef);
doHttp('POST',url+'msghandle.php',"logout=1");
window.location=window.location;
return false;
};
config.macros.ccLogin.logoutCallback=function(status,params,responseText,uri,xhr){
// displayMessage(status);
//return true;
};
config.macros.ccLogin.loginCheckResp=function(){
alert("Your Login has timed out. ");
var but1=document.getElementById('loginButton');
but1.disabled=false;
but1.setAttribute("class","button");
};
config.macros.ccLogin.loginOnSubmit=function(){
var user1=document.getElementById('cctuser').value;
var pass=document.getElementById('cctpass').value;
var but1=document.getElementById('loginButton');
but1.disabled=true;
but1.setAttribute("class","buttonDisabled");
var params={};
loginState ='';
params.origin=this;
//setTimeout(config.macros.ccLogin.loginCheckResp,3000);
var loginResp=doHttp('POST',url+'/handle/login.php',"cctuser=" + encodeURIComponent(user1)+"&cctpass="+Crypto.hexSha1Str(pass).toLowerCase(),null,null,null,config.macros.ccLogin.loginCallback,params);
return false;
};
config.macros.ccLogin.loginCallback=function(status,params,responseText,uri,xhr){
var cookieValues=findToken(document.cookie);
config.macros.ccLogin.saveCookie(cookieValues);
if(xhr.status!==401){
window.location.reload();
} else{
if (xhr.responseText!==""){
displayMessage(xhr.responseText);
}
var loginDivRef=findRelated(params.origin,"loginDiv","className","parentNode");
removeChildren(loginDivRef);
config.macros.ccLogin.refresh(loginDivRef,'Login Failed ');
loginState='fail';
}
return true;
};
config.macros.ccLogin.saveCookie=function(cookieValues){
// Save the session token in cookie.
var c='sessionToken'+"="+cookieValues.sessionToken;
c+="; expires=Fri, 1 Jan 2811 12:00:00 UTC; path=";
document.cookie=c;
// Save the txtUserName in the normal tiddlywiki format
if (cookieValues.txtUserName!==null){
config.options.txtUserName=cookieValues.txtUserName;
saveOptionCookie("txtUserName");
}
};
window.restart = function (){
var tiddlers="";
tiddlers=store.filterTiddlers(store.getTiddlerText("AnonDefaultTiddlers"));
if (isLoggedIn()){
tiddlers=store.filterTiddlers(store.getTiddlerText("DefaultTiddlers"));
}
story.displayTiddlers(null,tiddlers);
invokeParamifier(params,"onstart");
window.scrollTo(0,0);
}
//}}}
/***
|''Name''|ccWorkspace|
|''Description''|Allows users to create Workspaces|
|''Author''|[[Simon McManus | http://simonmcmanus.com]]
|''Version''|1.0.1|
|''Date''|12/05/08|
|''Status''|@@alpha@@|
|''Source''|http://svn.tiddlywiki.org/Trunk/association/serversides/cctiddly/ccPlugins/ccWorkspace.js|
|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/association/serversides/cctiddly/ccPlugins/ccWorkspace.js|
|''License''|BSD|
|''Feedback''|http://groups.google.com/group/ccTiddly|
|''Keywords''|ccTiddly, ccWorkspace|
!Description
Allows users to create their own workspace.
!Usage
{{{
<>
}}}
!Code
***/
//{{{
config.backstageTasks.push('create');
merge(config.tasks,{create: {text: 'create', tooltip: 'Create new workspace', content:'<<ccCreateWorkspace>>'}});
config.macros.ccCreateWorkspace = {}
config.macros.ccCreateWorkspace.handler = function(place,macroName,params,wikifier,paramString,tiddler, errorMsg){
// When we server this tiddler it need to know the URL of the server to post back to
//this value is currently set in index.php, should be index.php?action=createWorkspace to prepare for modulation
//form heading
if (workspacePermission.create!=1)
{
createTiddlyElement(place,'div', null, "annotation", 'You do not have permissions to create a workspace. You may need to log in.');
return null;
}
var frm = createTiddlyElement(place,'form',null,"wizard");
frm.onsubmit = this.createWorkspaceOnSubmit;
createTiddlyElement(frm,'h1',null,null,"Create Workspace");
createTiddlyElement(frm, 'h2', null, null, "Get your own TiddlyWiki workspace below");
var body = createTiddlyElement(frm,'div',null, "wizardBody");
//form content
var step = createTiddlyElement(body,'div',null, "wizardStep");
//createTiddlyElement(step, "br");
//form workspace name/url
var url_label = createTiddlyElement(step, "label", null, "label", url);
url_label.setAttribute("for","ccWorkspaceName");
var workspaceName = createTiddlyElement(step,'input','ccWorkspaceName', 'input')
workspaceName.value = workspace;
workspaceName.size = 15;
workspaceName.name = 'ccWorkspaceName';
workspaceName.onkeyup=function() {
config.macros.ccRegister.workspaceNameKeyPress(this.value);
};
step.appendChild(workspaceName);
createTiddlyElement(step,"span",'workspaceName_error','inlineError',null);
createTiddlyElement(step,'br');
//privilege form
anonTitle = createTiddlyElement(step,'div', null, "checkTitle", 'Anonymous Users Can');
//var anC = createTiddlyCheckbox(null, 'Create Tiddlers', 0);
var span = createTiddlyElement(step, 'span', null, "checkContainer")
var anC = createTiddlyElement(null,'input', 'anC','checkInput');
anC.setAttribute('type','checkbox');
if (workspacePermission.anonC==1)
anC.setAttribute('checked','checked');
span.appendChild(anC);
var anC_label = createTiddlyElement(step, "label", null, "checkLabel", "Create Tiddlers");
anC_label.setAttribute("for","anC");
createTiddlyElement(step,'br');
var span = createTiddlyElement(step, 'span', null, "checkContainer")
var anR = createTiddlyElement(null,'input', 'anR','checkInput');
anR.setAttribute('type','checkbox');
if (workspacePermission.anonR == 1)
anR.setAttribute('checked','checked');
span.appendChild(anR);
var anR_label = createTiddlyElement(step, "label", null, "checkLabel", "Read Tiddlers");
anR_label.setAttribute("for","anR");
createTiddlyElement(step,'br');
var span = createTiddlyElement(step, 'span', null, "checkContainer")
var anU = createTiddlyElement(null,'input', 'anU','checkInput');
anU.setAttribute('type','checkbox');
anU.setAttribute('value','1');
if (workspacePermission.anonU == 1)
anU.setAttribute('checked','checked');
span.appendChild(anU);
var anU_label = createTiddlyElement(step, "label", null, "checkLabel", "Update Tiddlers");
anU_label.setAttribute("for","anU");
createTiddlyElement(step,'br');
var span = createTiddlyElement(step, 'span', null, "checkContainer")
var anD = createTiddlyElement(null,'input', 'anD','checkInput');
anD.setAttribute('type','checkbox');
if (workspacePermission.anonD == 1)
anD.setAttribute('checked','checked');
span.appendChild(anD);
var anD_label = createTiddlyElement(step, "label", null, "checkLabel", "Delete Tiddlers");
anD_label.setAttribute("for","anD");
createTiddlyElement(step,'br');
var a=createTiddlyElement(step, "div", "createWorkspaceButton", "submit")
var btn=createTiddlyElement(null,'input',this.prompt,'button');
btn.setAttribute('type','submit');
btn.value="Create Workspace";
a.appendChild(btn);
createTiddlyElement(a,"span",'workspaceStatus','',null);
};
config.macros.ccCreateWorkspace.createWorkspaceOnSubmit = function() {
var trueStr = "A";
var falseStr = "D";
// build up string with permissions values
var anon=(this.anR.checked?trueStr:falseStr);
anon+=(this.anC.checked?trueStr:falseStr);
anon+=(this.anU.checked?trueStr:falseStr);
anon+=(this.anD.checked?trueStr:falseStr);
var params = {};
params.url = url+'/'+this.ccWorkspaceName.value;
// disable create workspace button
var submit=document.getElementById('createWorkspaceButton');
submit.disabled=true;
submit.setAttribute("class","buttonDisabled");
document.getElementById('workspaceStatus').innerHTML='Please wait, your workspace is being created.';
var loginResp = doHttp('POST',url+'/'+this.ccWorkspaceName.value,'ccCreateWorkspace=' + encodeURIComponent(this.ccWorkspaceName.value)+'&ccAnonPerm='+encodeURIComponent(anon),null,null,null,config.macros.ccCreateWorkspace.createWorkspaceCallback,params);
return false;
};
config.macros.ccCreateWorkspace.createWorkspaceCallback = function(status,params,responseText,uri,xhr) {
//displayMessage(xhr.status);
if(xhr.status==201) {
window.location = params.url;
//displayMessage('workspace crated');
} else if (xhr.status == 200) {
displayMessage(responseText+"Workspace name is already in use.");
} else if (xhr.status == 403) {
displayMessage("Permission denied,the ability to create new workspaces may have been disabled by you systems administrator.");
} else {
displayMessage(responseText);
}
};
config.macros.ccRegister.workspaceNameKeyPress=function(str){
doHttp('POST',url+'/handle/lookupWorkspaceName.php',"ccWorkspaceLookup="+str+"&free=1",null,null,null,config.macros.ccRegister.workspaceNameCallback,null);
return false;
};
config.macros.ccRegister.workspaceNameCallback=function(status,params,responseText,uri,xhr){
var field = "";
if(responseText>0){{
workspaceName_space=document.getElementById('workspaceName_error');
workspaceName_space.innerHTML='Workspace name has already been taken';
workspaceName_space.setAttribute("class","inlineError");
}
}else{
workspaceName_space=document.getElementById('workspaceName_error');
workspaceName_space.innerHTML="Workspace name is available";
workspaceName_space.setAttribute("class","inlineOk");
}
};
config.macros.ccEditWorkspace = {};
config.macros.ccEditWorkspace.handler = function(place,macroName,params,wikifier,paramString,tiddler,errorMsg) {
if (workspacePermission.owner != 1)
{
createTiddlyElement(place,'div',null,"annotation", 'You do not have permissions to edit this workspaces permission. ');
return null;
}
// When we server this tiddler it need to know the URL of the server to post back to, this value is currently set in index.php
var frm = createTiddlyElement(place,'form',null,"wizard");
frm.onsubmit = this.editWorkspaceOnSubmit;
createTiddlyElement(frm,"br");
createTiddlyElement(frm,'h1',null,null,'Edit Workspace Permissions');
createTiddlyElement(frm,"br");
var body = createTiddlyElement(frm,'div',null,"wizardBody");
var step = createTiddlyElement(body,'div',null,"wizardStep");
createTiddlyElement(step,'h5 ',null,null,'Anonymous Users Can : ');
var span = createTiddlyElement(step,'span',null,"checkContainer")
var anC = createTiddlyCheckbox(span,null,workspacePermission.anonC);
anC.id='anC';
anC.setAttribute("class","checkInput");
var anC_label = createTiddlyElement(step,"label",null,"checkLabel","Create Tiddlers");
anC_label.setAttribute("for","anC");
createTiddlyElement(step,'br');
var span = createTiddlyElement(step,'span',null,"checkContainer")
var anR = createTiddlyCheckbox(span,null ,workspacePermission.anonR);
anR.id = 'anR';
anR.setAttribute("class","checkInput");
var anR_label = createTiddlyElement(step,"label",null,"checkLabel","Read Tiddlers");
anR_label.setAttribute("for","anR");
createTiddlyElement(step,'br');
var span = createTiddlyElement(step,'span',null,"checkContainer")
var anU = createTiddlyCheckbox(span,null,workspacePermission.anonU);
anU.id = 'anU';
anU.setAttribute("class","checkInput");
var anU_label = createTiddlyElement(step,"label",null,"checkLabel","Update Tiddlers");
anU_label.setAttribute("for","anU");
createTiddlyElement(step,'br');
var span = createTiddlyElement(step,'span',null,"checkContainer")
var anD = createTiddlyCheckbox(span,null,workspacePermission.anonD);
anD.id = 'anD';
anD.setAttribute("class","checkInput");
var anD_label = createTiddlyElement(step,"label",null,"checkLabel","Delete Tiddlers");
anD_label.setAttribute("for","anD");
createTiddlyElement(step,'br');
createTiddlyElement(frm,'br');
var btn = createTiddlyElement(frm,'input',this.prompt,"button","button");
btn.setAttribute('type','submit');
btn.value = 'Edit Workspace Permissions'
createTiddlyElement(frm,'br');
createTiddlyElement(frm,'br');
};
config.macros.ccEditWorkspace.editWorkspaceOnSubmit = function() {
var trueStr = "A";
var falseStr = "D";
// build up string with permissions values
var anon=(this.anR.checked?trueStr:falseStr);
anon+=(this.anC.checked?trueStr:falseStr);
anon+=(this.anU.checked?trueStr:falseStr);
anon+=(this.anD.checked?trueStr:falseStr);
doHttp('POST',url+'handle/updateWorkspace.php','ccCreateWorkspace=' + encodeURIComponent(workspace)+'&ccAnonPerm='+encodeURIComponent(anon),null,null,null,config.macros.ccEditWorkspace.editWorkspaceCallback,params);
return false;
};
config.macros.ccEditWorkspace.editWorkspaceCallback = function(status,params,responseText,uri,xhr) {
if (xhr.status == 200) {
displayMessage(responseText);
}
return false;
};
//}}}
!ccTiddly Macros
!!!{{{<<ccAbout>>}}}
Provides links to help with ccTiddly.
!!!{{{<<ccUpload>>}}}
If enabled on the server users can upload files to the ccTiddly server
!!!{{{<<ccLogin>>}}}
Displays the login box if the users is not logged in, if the user is logged in they are shown a logout button
!!!{{{<<ccLoginStatus>>}}}
As with {{{<<ccLogin>>}}} except this displays a link to the login tiddler so can be used where space is tight.
!!!{{{<<ccCreateWorkspace>>}}}
Allows users with permission to create a workspace and define its permissions
!!!{{{<<ccVersion>>}}}
Allows users to confirm which version of ccTiddly they are using.
!TiddlyWiki Macros
!!!{{{<<today>>}}}
Shows current date.
!!!{{{<<version>>}}}
This macro shows the version number of the current TiddlyWiki document.
!!!{{{<<Alltags>>}}}
Lists all tags. Clicking on a tag lists all the tiddlers assigned that tag.
!!!{{{<<List [type]>>}}}
Parameters : (all (default), missing, orphans, shadowed, touched, filter)
!!!{{{<<Timeline [date] [length] [format]>>}}}
The timeline macro creates a list of tiddlers sorted by a date specified.
Example :
{{{<<timeline "modified" "0" "ddd, YYYY-0MM-0DD">>}}}
Produces :
<<timeline "modified" "0" "ddd, YYYY-0MM-0DD">>
!!!{{{<<Slider cookie tiddler label tooltip>>}}}
The slider macro allows embedding tiddlers within another tiddler, with the option to toggle the visibility of the transcluded contents.
* cookie: variable to save the state of the slider
* tiddler: name of the tiddler to include in the slider
* label: title text of the slider
* tooltip: tooltip text of the slider
Example
{{{<<slider chkTestSlider [[OptionsPanel]] "Options" "Open advanced options">>}}}
Produces :
<<slider chkTestSlider [[OptionsPanel]] "Options" "Open advanced options">>
!!!{{{<<Tabs>>}}}
The tabs macro creates an area where it displays one of several tiddlers alternately, as the user clicks on the tab labels at the top.
It is used like this:
{{{<<tabs ID Label1 Tip1 Tiddler1 Label2 Tip2 Tiddler2 [Label3 ...]>>}}}
produces :
<<tabs ID Label1 Tip1 Tiddler1 Label2 Tip2 Tiddler2 [Label3 ...]>>
* ID: specifies the name of a cookie used to save the information about which tab was displayed last.
* Label1, Label2, ... define the labels that are displayed at the top of the area for each tab
* Tip1, Tip2, ... define tooltips that explain, somewhat more verbosely than the labels, what you can expect to find on each tab.
* Tiddler1, Tiddler2, ... name the tiddlers that are displayed on each tab.
Obviously, there must be exactly three strings for each tab.
The syntax for the tabs macro looks like this:
{{{<<tabs txt[cookieName]
"[label]" "[title]" [[tiddler]]
"[label]" "[title]" [[tiddler]]
...
>>}}}
produces :
<<tabs txt[cookieName]
"[label]" "[title]" [[tiddler]]
"[label]" "[title]" [[tiddler]]
...
>>
!!!{{{<<Tagging [tag]>>}}}
This macro generates a list of tiddlers that carry the specified tag.
<<tagging [tag]>>
If the tag parameter is not specified, the current tiddler's name will be used instead.
!!!{{{<<Tagchooser>>}}}
!!!{{{<<NewJournal>>}}}
This macro generates a button to create a journal tiddler, using the current time and date as title.
It is otherwise identical to the NewTiddler macro.
Example :
{{{<<newJournal [date format]>>}}}
Produces :
<<newJournal [date format]>>
The optional parameter can be used to specify a custom date format.
In addition, all of the NewTiddler macro's parameters are valid.
!!!{{{<<NewTiddler>>}}}
Usage
<<newTiddler [parameters]>>
Parameters
This macro uses named parameters. All parameters are optional.
|Parameter|Description|
|label |button label|
|prompt|button tooltip|
|title|title for the new tiddler (defaults to "New Tiddler")|
|text|contents for the new tiddler|
|tag|tag to be applied to the new tiddler (parameter can be used repeatedly to specify multiple tags)|
|accessKey|single letter to use as access key to trigger the button|
|focus|which of the editable fields to default the focus to (e.g. "title", "text", "tags")|
|template|template tiddler to use to display the new tiddler (defaults to EditTemplate)|
|fields|custom fields to be assigned to the new tiddler, in name:value;name:value; format|
Only fields contained as input fields in the specified template can be primed with an initial value.
[edit] Example
<<newTiddler
label:"New Tiddler"
text:"Hello world."
tag:"test"
tag:"an example"
accessKey:"1"
focus:"tags"
>>
!!!{{{<<Savechanges>>}}}
!!!{{{<<Search>>}}}
This macro creates an input field to perform full-text searches on a TiddlyWiki document's tiddler contents.
[edit] Usage
Example :
{{{<<search [value]>>}}}
Produces :
<<search [value]>>
By specifiying the value parameter, the search form can be "preloaded" with the desired term.
[edit] Options
This section is still incomplete. You can help by contributing to its expansion.
Please improve the article, or discuss the issue on the talk page.
* case-sensitive
* regular expressions
!!!{{{<<Gradient>>}}}
The Gradient macro allows simple horizontal and vertical coloured gradients. They are constructed from coloured HTML elements, and don't require any images to work.
The Gradient macro is an extended macro that processes the text after it up until the next '
>>
' sequence. It looks like this:
Example :
{{{<<gradient vert #ffffff #ffdddd #ff8888>>gradient fill>>}}}
Produces :
<<gradient vert #ffffff #ffdddd #ff8888>>gradient fill>>
The first parameter can be vert or horiz to indicate the direction of the gradient. The following parameters are two or more colours (CSS RGB(r,g,b) format is also acceptable). The macro constructs a smooth linear gradient between each of the colours in turn.
Inline CSS definitions can be added to gradient fills like this:
Example :
{{{<<gradient vert #000000 #660000 #aa2222>>color:#ffffff;font-size:12pt;Darkness>>}}}
Produces :
<<gradient vert #000000 #660000 #aa2222>>color:#ffffff;font-size:12pt;Darkness>>
!!!{{{<<Closeall>>}}}
!!!{{{<<Permaview>>}}}
Changes the browser address bar to a permalink to the current Tiddler or the set of open tiddlers. It is used with the ToolbarMacro like this:
Example :
{{{<<toolbar permalink>>}}}
Produces :
<<toolbar permalink>>
!!!{{{<<Toolbar>>}}}
The ToolbarMacro is used in the TemplateMechanism to define the toolbar that appearthat appear either in EditMode or in ViewMode. The arguments to the ToolbarMacro is a list of command names, as discussed in the CommandMechanism..
You can precede a command name with a "+" to specify a default command that is automatically chosen when a tiddler is double-clicked, or the ctrl-Enter key combination pressed. Similarly, precede it with "-" to specify a command to be chosen when the Escape key is pressed.
!!!{{{<<Annotations>>}}}
!!!{{{<<Edit>>}}}
The command <<edit>> switches from ViewMode to EditMode. The EditMacro is either a double mouse click inside the tiddler or the entry 'edit' in the tiddler's Toolbar. It is used in ViewTemplate as ToolbarMacro like this:
Example :
{{{<<toolbar +editTiddler>>}}}
Produces :
<<toolbar +editTiddler>>
!!!{{{<<Message>>}}}
!!!{{{<<Refreshdisplay>>}}}
!!!{{{<<View fieldname how...>>}}}
Retrieves a specified field (given by fieldname) from the tiddler to be displayed and outputs its value in one of the following ways (the optional //how// parameter):
* (unspecified): render as is (without formatting)
* link: format as a link (using createTiddlyLink)
* wikified: format using all the normal rendering rules
* date: expects a value of the form YYYYMMDDHHMM and outputs it using either a specified format (...) or config.views.wikified.dateFormat
The standard field names are:
* title - the tiddler title
* tiddler - the tiddler title (as well)
* text - the text of the tiddler
* modifier - the person who last modified it
* modified - date&time of last modification
* created - when it was created
* tags - the tiddler tags
If your tiddlers contain custom fields, they could be specified as well.
The view macro is used extensively in the standard tiddler rendering templates (ViewTemplate and EditTemplate).
!!!ccTiddly Tiddlers
!!! Predefined ccTiddly Tags
simple - displays the tiddler without showing the date editor and tags.
private - Only you will be able to read the tiddlers tagged private.
!!! ccTiddly Tiddlers
[[anonDefaultTiddlers]]
[[ccVariables]]
Normal text {{{preformatted text}}} Normal text.
{{{
A block
of preformatted text
}}}
!!! Links
[[explicitlink]]
[[link|explicitlinkTitle]]
http://www.wikicreole.org
[[http://www.wikicreole.org|Wiki Creole Site]]
!!! Misc
A horizontal rule follows
----
== Lists
* bulleted list
* bullet 2
** bullet level 2
*** bullet level 3
# numbered list
# item 2
## item 2.1
### item 2.1.1
#### item 2.1.1.1
##### item 2.1.1.1.1
# item 3
# item 4
<!--{{{-->
<div class='toolbar' macro='toolbar closeTiddler closeOthers'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
/***
|''Name''|ccUpload|
|''Description''|Allows users to upload files onto a ccTiddly server|
|''Author''|[[Simon McManus | http://simonmcmanus.com]]|
|''Version''|1.0.1|
|''Date''|12/05/2008|
|''Status''|@@alpha@@|
|''Source''|http://svn.tiddlywiki.org/Trunk/association/serversides/cctiddly/ccPlugins/ccUpload.js|
|''CodeRepository''|http://svn.tiddlywiki.org/Trunk/association/serversides/cctiddly/ccPlugins/ccUpload.js|
|''License''|BSD|
|''Feedback''|http://groups.google.com/group/ccTiddly|
|''Documentation''|<...>|
|''Keywords''|ccTiddly, ccUpload|
!Description
Allows users to upload files to a ccTiddly serevr.
!Usage
{{{
<>
}}}
!Code
***/
//{{{
var iFrameLoad=function(){
var uploadIframe= document.getElementById('uploadIframe');
var statusArea=document.getElementById("uploadStatus");
document.getElementById("ccfile").value="";
statusArea.innerHTML=uploadIframe.contentDocument.body.innerHTML;
};
config.macros.ccUpload={};
config.macros.ccUpload.handler=function(place,macroName,params,wikifier,paramString,tiddler,errorMsg){
if (workspacePermission.upload!=1){
createTiddlyElement(place,'div',null,"annotation",'You do not have permissions to create a file on this server. ');
return null;
}
// When we server this tiddler it need to know the URL of the server to post back to,this value is currently set in index.php
var frm=createTiddlyElement(place,'form',null,"wizard");
frm.action=window.url+"/handle/upload.php"; ;
frm.id="ccUpload";
frm.enctype="multipart/form-data";
frm.method="POST";
frm.target="uploadIframe";
var body=createTiddlyElement(frm,'div',null,"wizardBody");
createTiddlyElement(body,"h1",null,null,"Upload File");
createTiddlyElement(body,"h2",null,null,"Upload Files to your workspace");
createTiddlyElement(body,"br");
//form content
var step=createTiddlyElement(body,'div',null,"wizardStep");
var username=createTiddlyElement(step,'input','username','username');
username.name='username';
username.type="HIDDEN";
username.value=config.options.txtUserName;
var label=createTiddlyElement(step,"label",null,"label","Upload your file ");
label.setAttribute("for","ccfile");
var file=createTiddlyElement(step,'input','ccfile','input');
file.type="file";
file.name="userFile";
var workspaceName=createTiddlyElement(step,'input','workspaceName','workspaceName');
workspaceName.name='workspaceName';
workspaceName.type="HIDDEN";
workspaceName.value=workspace;
createTiddlyElement(step,'br');
var saveTo=createTiddlyElement(step,'input','saveTo','saveTo',"workspace");
saveTo.type="HIDDEN";
saveTo.name='saveTo';
saveTo.value='workspace';
var submitDiv=createTiddlyElement(step,"div",null,'submit');
var btn=createTiddlyElement(frm,"input",null,'button');
btn.setAttribute("type","submit");
btn.setAttribute("onClick","config.macros.ccUpload.submitiframe()");
btn.value='Upload File';
submitDiv.appendChild(btn);
// Create the iframe
var iframe=document.createElement("iframe");
iframe.style.display="none";
iframe.id='uploadIframe';
iframe.name='uploadIframe';
frm.appendChild(iframe);
createTiddlyElement(step,"div",'uploadStatus');
iframe.onload=iFrameLoad;
};
config.macros.ccUpload.submitiframe=function(){
var statusArea=document.getElementById("uploadStatus");
statusArea.innerHTML="uploading... <img src=loading.gif /> ";
return true;
};
config.macros.ccCreate={};
config.macros.ccCreate.handler=function(place,macroName,params,wikifier,paramString,tiddler,errorMsg){
if (workspacePermission.upload !=1){
createTiddlyElement(place,'div',null,"annotation",'You do not have permissions to create a new file on this server. ');
return null;
}
// When we server this tiddler it need to know the URL of the server to post back to,this value is currently set in index.php
var frm=createTiddlyElement(place,'form',null,"wizard");
displayMessage(url);
frm.action="hdfdandle/upload.php";
frm.method="POST";
createTiddlyElement(frm,"br");
var body=createTiddlyElement(frm,'div',null,"wizardBody");
createTiddlyElement(frm,"br");
createTiddlyElement(body,"h1",null,null,"Create HTML file ");
createTiddlyElement(body,"br");
//form content
var step=createTiddlyElement(body,'div',null,"wizardStep");
createTiddlyText(step,'Filename : ');
var htmlfile=createTiddlyElement(step,'input','ccHTMLName','ccHMLname');
htmlfile.name='ccHTMLName';
createTiddlyElement(step,'br');
createTiddlyElement(step,'br');
createTiddlyText(step,"add your HTML code to the textbox below :");
createTiddlyElement(step,'br');
var htmlbox=createTiddlyElement(step,'textarea','ccHTML','ccHML');
htmlbox.name='ccHTML';
htmlbox.rows='20';
htmlbox.cols='100';
createTiddlyElement(step,'br');
var username=createTiddlyElement(step,'input','username','username');
username.name='username';
username.type="HIDDEN";
username.value=config.options.txtUserName;
createTiddlyElement(step,'br');
var workspaceName=createTiddlyElement(step,'input','workspaceName','workspaceName');
workspaceName.name='workspaceName';
workspaceName.type="HIDDEN";
workspaceName.value=workspace;
createTiddlyText(step,"Create the file in :");
createTiddlyElement(step,'br');
var RDuser=createTiddlyElement(step,'input','user','user');
RDuser.type="radio";
RDuser.name="saveTo";
RDuser.value="user";
createTiddlyText(step,"My User Area");
createTiddlyElement(step,'br');
var RDworkspace=createTiddlyElement(step,'input','workspace','workspace');
RDworkspace.type="radio";
RDworkspace.name="saveTo";
RDworkspace.value="workspace";
RDworkspace.checked="1";
createTiddlyText(step,"Workspace Area ");
createTiddlyElement(step,'br');
createTiddlyElement(frm,'br');
var btn=createTiddlyElement(frm,'input',this.prompt,'button');
btn.setAttribute('type','submit');
btn.value='Create File ';
createTiddlyElement(frm,'br');
createTiddlyElement(frm,'br');
};
//}}}
/*{{{*/
.input {
display: block;
float: left;
margin-bottom: 4px;
font-size:0.9em;
width: 150px;
margin-bottom: 4px;
padding:4px;
}
.inputError {
display: block;
float: left;
}
.submit {
padding-left:122px;
align:right;
}
.label {
text-align: right;
display: block;
float: left;
}
.checkContainer {
text-align: right;
display: block;
float: left;
}
.inlineError{
color:red;
}
.inlineOk{
color:green;
}
.checkLabel {
text-align:left;
display: block;
float:left;
}
br {
clear: left;
}
.checkContainer {
padding-right: 2px;
width: 120px;
margin-bottom:5px;
}
.label {
padding-top:2px;
padding-right: 5px;
width: 190px;
margin-bottom: 10px;
}
/*BELOW THIS POINT WILLBE SPLIT OFF INTO A THEME*/
/*
.input {
border:solid 1px #B3B3B3;
}
.checkTitle {
font-size:0.9em;
font-weight:bold;
}
.inlineOk{
padding-left:10px;
padding-top:8px;
font-size:0.9em;
}
.inlineError{
padding-left:10px;
padding-top:8px;
font-size:0.9em;
}
.checkInput{
border:solid 1px #B3B3B3;
}
.wizardStep{
border:solid 1px #9399AB;
}
.backButton{
background-color:green;
}
.wizard{
border:solid 1px #9399AB;
margin:10px;
padding:10px;
}
.wizard .button {
padding : 4px 14px 4px 14px;
font-weight:bold;
color:#292929;
border:solid 1px #292929;
font-size:0.9em;
margin-top:1px;
}
.inputError {
font-size:0.9em;
width: 150px;
margin-bottom: 4px;
border:solid 1px #B3B3B3;
padding:4px;
}
label{
font-size:0.9em;
font-face:arial;
color:#292929;
}
.wizard{
background-color:#E1E7F8;
border:solid 1px #9399AB;
}
.checkInput{
border:solid 1px #B3B3B3;
color: #5B5C56;
background-color: #FFFFFF;
border:none;
}
.wizardStep{
border:solid 1px #9399AB;
}
.wizardFooter{
background-color:#E1E7F8;
}
*/
/*}}}*/
Welcome to ccTiddly 1.6. \n\nTest...
MEGA Group Code Repository
http://osmosoft.com/ More info about osmosoft can be found here
our in-house GBTIDL, CASA, and python scripts
/***\n|Name|AttachFilePlugin|\n|Source|http://www.TiddlyTools.com/#AttachFilePlugin|\n|Documentation|http://www.TiddlyTools.com/#AttachFilePluginInfo|\n|Version|3.9.0|\n|Author|Eric Shulman - ELS Design Studios|\n|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|\n|~CoreVersion|2.1|\n|Type|plugin|\n|Requires|AttachFilePluginFormatters, AttachFileMIMETypes|\n|Overrides||\n|Description|Store binary files as base64-encoded tiddlers with fallback links for separate local and/or remote file storage|\nStore or link binary files (such as jpg, gif, pdf or even mp3) within your TiddlyWiki document and then use them as images or links from within your tiddler content.\n> Important note: As of version 3.6.0, in order to //render// images and other binary attachments created with this plugin, you must also install [[AttachFilePluginFormatters]], which extends the behavior of the TiddlyWiki core formatters for embedded images ({{{[img[tooltip|image]]}}}), linked embedded images ({{{[img[tooltip|image][link]]}}}), and external/"pretty" links ({{{[[label|link]]}}}), so that these formatter will process references to attachment tiddlers as if a normal file reference had been provided. |\n!!!!!Documentation\n>see [[AttachFilePluginInfo]]\n!!!!!Inline interface (live)\n>see [[AttachFile]] (shadow tiddler)\n><<tiddler AttachFile>>\n!!!!!Revisions\n<<<\n2008.07.21 [3.9.0] Fixup for FireFox 3: use HTML with separate text+button control instead of type='file' control\n|please see [[AttachFilePluginInfo]] for additional revision details|\n2005.07.20 [1.0.0] Initial Release\n<<<\n!!!!!Code\n***/\n// // version\n//{{{\nversion.extensions.attach = {major: 3, minor: 9, revision: 0, date: new Date(2008,7,21)};\n\n// shadow tiddler\nconfig.shadowTiddlers.AttachFile="<<attach inline>>";\n\n// add 'attach' backstage task (insert before built-in 'importTask')\nif (config.tasks) { // for TW2.2b or above\n config.tasks.attachTask = {\n text: "attach",\n tooltip: "Attach a binary file as a tiddler",\n content: "<<attach inline>>"\n }\n config.backstageTasks.splice(config.backstageTasks.indexOf("importTask"),0,"attachTask");\n}\n\nconfig.macros.attach = {\n// // lingo\n//{{{\n label: "attach file",\n tooltip: "Attach a file to this document",\n linkTooltip: "Attachment: ",\n\n typeList: "AttachFileMIMETypes",\n\n titlePrompt: " enter tiddler title...",\n MIMEPrompt: "<option value=''>select MIME type...</option><option value='editlist'>[edit list...]</option>",\n localPrompt: " enter local path/filename...",\n URLPrompt: " enter remote URL...",\n\n tiddlerErr: "Please enter a tiddler title",\n sourceErr: "Please enter a source path/filename",\n storageErr: "Please select a storage method: embedded, local or remote",\n MIMEErr: "Unrecognized file format. Please select a MIME type",\n localErr: "Please enter a local path/filename",\n URLErr: "Please enter a remote URL",\n fileErr: "Invalid path/file or file not found",\n\n sourceReport: "| source file:|{{{%0}}}|\sn",\n nosourceReport: "| source file:|//none//|\sn",\n dateReport: "| attached on:|%0 by %1|\sn",\n notesReport: "| description:|%0|\sn",\n dataReport: "| embedded:|[[%0|%0]] - {{{type=%1, size=%2 bytes, encoded=%3 bytes}}}|\sn",\n nodataReport: "| embedded:|//none//|\sn",\n localReport: "| local file:|/%LOCAL_LINK%/[[%0|%1]]|\sn",\n nolocalReport: "| local file:|//none//|\sn",\n URLReport: "| remote link:|/%REMOTE_LINK%/[[%0|%0]]|\sn",\n noURLReport: "| remote link:|//none//|\sn",\n\n imageReport: "image\sn<<<\snusage: {{{[img[tooltip|%0]] or [img[tooltip|%0][link]]}}}\sn[img[tooltip|%0]]\sn<<<\sn",\n dataBlock: "\sn/% DO NOT EDIT BELOW THIS POINT\sn---BEGIN_DATA---\sn%0;base64,\sn%1\sn---END_DATA---\sn%/",\n//}}}\n// // macro definition\n//{{{\n handler:\n function(place,macroName,params) {\n if (params && !params[0]) { createTiddlyButton(place,this.label,this.tooltip,this.toggleAttachPanel); return; }\n var id=params.shift();\n this.createAttachPanel(place,id+"_attachPanel",params);\n document.getElementById(id+"_attachPanel").style.position="static";\n document.getElementById(id+"_attachPanel").style.display="block";\n },\n//}}}\n//{{{\n createAttachPanel:\n function(place,panel_id,params) {\n if (!panel_id || !panel_id.length) var panel_id="_attachPanel";\n // remove existing panel (if any)\n var panel=document.getElementById(panel_id); if (panel) panel.parentNode.removeChild(panel);\n // set styles for this panel\n setStylesheet(this.css,"attachPanel");\n // create new panel\n var title=""; if (params && params[0]) title=params.shift();\n var types=this.MIMEPrompt+this.formatListOptions(store.getTiddlerText(this.typeList)); // get MIME types\n panel=createTiddlyElement(place,"span",panel_id,"attachPanel",null);\n var html=this.html.replace(/%id%/g,panel_id);\n html=html.replace(/%title%/g,title);\n html=html.replace(/%disabled%/g,title.length?"disabled":"");\n html=html.replace(/%IEdisabled%/g,config.browser.isIE?"disabled":"");\n html=html.replace(/%types%/g,types);\n panel.innerHTML=html;\n if (config.browser.isGecko) { // FF3 FIXUP\n document.getElementById("attachSource").style.display="none";\n document.getElementById("attachFixPanel").style.display="block";\n }\n return panel;\n },\n//}}}\n//{{{\n toggleAttachPanel:\n function (e) {\n if (!e) var e = window.event;\n var parent=resolveTarget(e).parentNode;\n var panel = document.getElementById("_attachPanel");\n if (panel==undefined || panel.parentNode!=parent)\n panel=config.macros.attach.createAttachPanel(parent,"_attachPanel");\n var isOpen = panel.style.display=="block";\n if(config.options.chkAnimate)\n anim.startAnimating(new Slider(panel,!isOpen,e.shiftKey || e.altKey,"none"));\n else\n panel.style.display = isOpen ? "none" : "block" ;\n e.cancelBubble = true;\n if (e.stopPropagation) e.stopPropagation();\n return(false);\n },\n//}}}\n//{{{\n formatListOptions:\n function(text) {\n if (!text || !text.trim().length) return "";\n // get MIME list content from text\n var parts=text.split("\sn----\sn");\n var out="";\n for (var p=0; p<parts.length; p++) {\n var lines=parts[p].split("\sn");\n var label=lines.shift(); // 1st line=display text\n var value=lines.shift(); // 2nd line=item value\n out +='<option value="%1">%0</option>'.format([label,value]);\n }\n return out;\n },\n//}}}\n// // interface definition\n//{{{\n css:\n ".attachPanel { display: none; position:absolute; z-index:10; width:35em; right:105%; top:0em;\s\n background-color: #eee; color:#000; font-size: 8pt; line-height:110%;\s\n border:1px solid black; border-bottom-width: 3px; border-right-width: 3px;\s\n padding: 0.5em; margin:0em; -moz-border-radius:1em; text-align:left }\s\n .attachPanel form { display:inline;border:0;padding:0;margin:0; }\s\n .attachPanel select { width:99%;margin:0px;font-size:8pt;line-height:110%;}\s\n .attachPanel input { width:98%;padding:0px;margin:0px;font-size:8pt;line-height:110%}\s\n .attachPanel textarea { width:98%;margin:0px;height:2em;font-size:8pt;line-height:110%}\s\n .attachPanel table { width:100%;border:0;margin:0;padding:0;color:inherit; }\s\n .attachPanel tbody, .attachPanel tr, .attachPanel td { border:0;margin:0;padding:0;color:#000; }\s\n .attachPanel .box { border:1px solid black; padding:.3em; margin:.3em 0px; background:#f8f8f8; -moz-border-radius:5px; }\s\n .attachPanel .chk { width:auto;border:0; }\s\n .attachPanel .btn { width:auto; }\s\n .attachPanel .btn2 { width:49%; }\s\n ",\n//}}}\n//{{{\n html:\n '<form>\s\n attach from source file\s\n <input type="file" id="attachSource" name="source" size="56"\s\n onChange="config.macros.attach.onChangeSource(this)">\s\n <div id="attachFixPanel" style="display:none"><!-- FF3 FIXUP -->\s\n <input type="text" id="attachFixSource" style="width:90%"\s\n title="Enter a path/file to attach"\s\n onChange="config.macros.attach.onChangeSource(this);">\s\n <input type="button" style="width:7%" value="..."\s\n title="Enter a path/file to attach"\s\n onClick="config.macros.attach.askForFilename(document.getElementById(\s'attachFixSource\s'));">\s\n </div><!--end FF3 FIXUP-->\s\n <div class="box">\s\n <table style="border:0"><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\s\n embed data <input type=checkbox class=chk name="useData" %IEdisabled% \s\n onclick="if (!this.form.MIMEType.value.length)\s\n this.form.MIMEType.selectedIndex=this.checked?1:0; "> \s\n </td><td style="border:0">\s\n <select size=1 name="MIMEType" \s\n onchange="this.title=this.value; if (this.value==\s'editlist\s')\s\n { this.selectedIndex=this.form.useData.checked?1:0; story.displayTiddler(null,config.macros.attach.typeList,2); return; }">\s\n <option value=""></option>\s\n %types%\s\n </select>\s\n </td></tr><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\s\n local link <input type=checkbox class=chk name="useLocal"\s\n onclick="this.form.local.value=this.form.local.defaultValue=this.checked?config.macros.attach.localPrompt:\s'\s';"> \s\n </td><td style="border:0">\s\n <input type=text name="local" size=15 autocomplete=off value=""\s\n onchange="this.form.useLocal.checked=this.value.length" \s\n onkeyup="this.form.useLocal.checked=this.value.length" \s\n onfocus="if (!this.value.length) this.value=config.macros.attach.localPrompt; this.select()">\s\n </td></tr><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\s\n remote link <input type=checkbox class=chk name="useURL"\s\n onclick="this.form.URL.value=this.form.URL.defaultValue=this.checked?config.macros.attach.URLPrompt:\s'\s';\s"> \s\n </td><td style="border:0">\s\n <input type=text name="URL" size=15 autocomplete=off value=""\s\n onfocus="if (!this.value.length) this.value=config.macros.attach.URLPrompt; this.select()"\s\n onchange="this.form.useURL.checked=this.value.length;"\s\n onkeyup="this.form.useURL.checked=this.value.length;">\s\n </td></tr></table>\s\n </div>\s\n <table style="border:0"><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\s\n attach as \s\n </td><td style="border:0" colspan=2>\s\n <input type=text name="tiddlertitle" size=15 autocomplete=off value="%title%"\s\n onkeyup="if (!this.value.length) { this.value=config.macros.attach.titlePrompt; this.select(); }"\s\n onfocus="if (!this.value.length) this.value=config.macros.attach.titlePrompt; this.select()" %disabled%>\s\n </td></tr><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\s\n description \s\n </td><td style="border:0" colspan=2>\s\n <input type=text name="notes" size=15 autocomplete=off>\s\n </td></tr><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\s\n add tags \s\n </td><td style="border:0">\s\n <input type=text name="tags" size=15 autocomplete=off value="" onfocus="this.select()">\s\n </td><td style="width:40%;text-align:right;border:0">\s\n <input type=button class=btn2 value="attach"\s\n onclick="config.macros.attach.onClickAttach(this)"><!--\s\n --><input type=button class=btn2 value="close"\s\n onclick="var panel=document.getElementById(\s'%id%\s'); if (panel) panel.parentNode.removeChild(panel);">\s\n </td></tr></table>\s\n </form>',\n//}}}\n// // control processing\n//{{{\n onChangeSource:\n function(here) {\n var form=here.form;\n var list=form.MIMEType;\n var theFilename = here.value;\n var theExtension = theFilename.substr(theFilename.lastIndexOf('.')).toLowerCase();\n // if theFilename is in current document folder, remove path prefix and use relative reference\n var h=document.location.href; folder=getLocalPath(decodeURIComponent(h.substr(0,h.lastIndexOf("/")+1)));\n if (theFilename.substr(0,folder.length)==folder) theFilename='./'+theFilename.substr(folder.length);\n else theFilename='file:///'+theFilename; // otherwise, use absolute reference\n theFilename=theFilename.replace(/\s\s/g,"/"); // fixup: change \s to /\n form.useLocal.checked = true;\n form.local.value = theFilename;\n form.useData.checked = !form.useData.disabled;\n list.selectedIndex=1;\n for (var i=0; i<list.options.length; i++) // find matching MIME type\n if (list.options[i].value.indexOf(theExtension)!=-1) { list.selectedIndex = i; break; }\n if (!form.tiddlertitle.disabled)\n form.tiddlertitle.value=theFilename.substr(theFilename.lastIndexOf('/')+1); // get tiddlername from filename\n },\n//}}}\n//{{{\n onClickAttach:\n function (here) {\n clearMessage();\n // get input values\n var form=here.form;\n var src=form.source; if (config.browser.isGecko) src=document.getElementById("attachFixSource");\n var theDate=(new Date()).formatString(config.macros.timeline.dateFormat);\n var theSource = src.value!=src.defaultValue?src.value:"";\n var theTitle=form.tiddlertitle.value;\n var theLocal = form.local.value!=form.local.defaultValue?form.local.value:"";\n var theURL = form.URL.value!=form.URL.defaultValue?form.URL.value:"";\n var theNotes = form.notes.value;\n var theTags = "attachment excludeMissing "+form.tags.value;\n var useData=form.useData.checked;\n var useLocal=form.useLocal.checked;\n var useURL=form.useURL.checked;\n var theMIMEType = form.MIMEType.value.length?form.MIMEType.options[form.MIMEType.selectedIndex].text:"";\n // validate checkboxes and get filename\n if (useData) {\n if (theSource.length) { if (!theLocation) var theLocation=theSource; }\n else { alert(this.sourceErr); src.focus(); return false; }\n }\n if (useLocal) {\n if (theLocal.length) { if (!theLocation) var theLocation = theLocal; }\n else { alert(this.localErr); form.local.focus(); return false; }\n }\n if (useURL) {\n if (theURL.length) { if (!theLocation) var theLocation = theURL; }\n else { alert(this.URLErr); form.URL.focus(); return false; }\n }\n if (!(useData||useLocal||useURL))\n { form.useData.focus(); alert(this.storageErr); return false; }\n if (!theLocation)\n { src.focus(); alert(this.sourceErr); return false; }\n if (!theTitle || !theTitle.trim().length || theTitle==this.titlePrompt)\n { form.tiddlertitle.focus(); alert(this.tiddlerErr); return false; }\n // if not already selected, determine MIME type based on filename extension (if any)\n if (useData && !theMIMEType.length && theLocation.lastIndexOf('.')!=-1) {\n var theExt = theLocation.substr(theLocation.lastIndexOf('.')).toLowerCase();\n var theList=form.MIMEType;\n for (var i=0; i<theList.options.length; i++)\n if (theList.options[i].value.indexOf(theExt)!=-1)\n { var theMIMEType=theList.options[i].text; theList.selectedIndex=i; break; }\n }\n // attach the file\n return this.createAttachmentTiddler(theSource, theDate, theNotes, theTags, theTitle,\n useData, useLocal, useURL, theLocal, theURL, theMIMEType);\n },\n getMIMEType:\n function(src,def) {\n var ext = src.substr(src.lastIndexOf('.')).toLowerCase();\n var list=store.getTiddlerText(this.typeList);\n if (!list || !list.trim().length) return def;\n // get MIME list content from tiddler\n var parts=list.split("\sn----\sn");\n for (var p=0; p<parts.length; p++) {\n var lines=parts[p].split("\sn");\n var mime=lines.shift(); // 1st line=MIME type\n var match=lines.shift(); // 2nd line=matching extensions\n if (match.indexOf(ext)!=-1) return mime;\n }\n return def;\n },\n createAttachmentTiddler:\n function (theSource, theDate, theNotes, theTags, theTitle,\n useData, useLocal, useURL, theLocal, theURL, theMIMEType, noshow) {\n // encode the data\n if (useData) {\n if (!theMIMEType.length) {\n alert(this.MIMEErr);\n form.MIMEType.selectedIndex=1; form.MIMEType.focus();\n return false;\n }\n var theData = this.readFile(theSource); if (!theData) { return false; }\n displayMessage('encoding '+theSource);\n var theEncoded = this.encodeBase64(theData);\n displayMessage('file size='+theData.length+' bytes, encoded size='+theEncoded.length+' bytes');\n }\n // generate tiddler and refresh\n var theText = "";\n theText +=theSource.length?this.sourceReport.format([theSource]):this.nosourceReport;\n theText +=this.dateReport.format([theDate,config.options.txtUserName]);\n theText +=theNotes.length?this.notesReport.format([theNotes]):"";\n theText +=useData?this.dataReport.format([theTitle,theMIMEType,theData.length,theEncoded.length]):this.nodataReport;\n theText +=useLocal?this.localReport.format([theLocal,theLocal.replace(/\s\s/g,"/")]):this.nolocalReport;\n theText +=useURL?this.URLReport.format([theURL]):this.noURLReport;\n theText +=(theMIMEType.substr(0,5)=="image")?this.imageReport.format([theTitle]):"";\n theText +=useData?this.dataBlock.format([theMIMEType,theEncoded]):"";\n store.saveTiddler(theTitle,theTitle,theText,config.options.txtUserName,new Date(),theTags);\n var panel=document.getElementById("attachPanel"); if (panel) panel.style.display="none";\n if (!noshow) { story.displayTiddler(null,theTitle); story.refreshTiddler(theTitle,null,true); }\n displayMessage('attached "'+theTitle+'"');\n return true;\n },\n//}}}\n// // base64 conversion\n//{{{\n encodeBase64:\n function (theData) {\n if (!theData) return null;\n // encode as base64\n var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";\n var out = ""; //This is the output\n var chr1, chr2, chr3 = ""; //These are the 3 bytes to be encoded\n var enc1, enc2, enc3, enc4 = ""; //These are the 4 encoded bytes\n for (var count=0,i=0; i<theData.length; )\n {\n chr1 = theData.charCodeAt(i++); //Grab the first byte\n chr2 = theData.charCodeAt(i++); //Grab the second byte\n chr3 = theData.charCodeAt(i++); //Grab the third byte\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n if (isNaN(chr2))\n enc3 = enc4 = 64;\n else if (isNaN(chr3))\n enc4 = 64;\n out += keyStr.charAt(enc1)+keyStr.charAt(enc2)+keyStr.charAt(enc3)+keyStr.charAt(enc4);\n chr1 = chr2 = chr3 = "";\n enc1 = enc2 = enc3 = enc4 = "";\n count+=4; if (count>60) { out+='\sn'; count=0; } // add line break every 60 chars for readability\n }\n return out;\n },\n//}}}\n// // I/O functions\n//{{{\n readFile: // read local BINARY file data\n function(filePath) {\n if(!window.Components) { return null; }\n try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); }\n catch(e) { alert("access denied: "+filePath); return null; }\n var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);\n try { file.initWithPath(filePath); } catch(e) { alert("cannot read file - invalid path: "+filePath); return null; }\n if (!file.exists()) { alert("cannot read file - not found: "+filePath); return null; }\n var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);\n inputStream.init(file, 0x01, 00004, null);\n var bInputStream = Components.classes["@mozilla.org/binaryinputstream;1"].createInstance(Components.interfaces.nsIBinaryInputStream);\n bInputStream.setInputStream(inputStream);\n return(bInputStream.readBytes(inputStream.available()));\n },\n//}}}\n//{{{\n writeFile:\n function(filepath,data) {\n // TBD: decode base64 and write BINARY data to specified local path/filename\n return(false);\n },\n//}}}\n//{{{\n askForFilename: // for FF3 fixup\n function(target) {\n var msg=config.messages.selectFile;\n if (target && target.title) msg=target.title; // use target field tooltip (if any) as dialog prompt text\n // get local path for current document\n var path=getLocalPath(document.location.href);\n var p=path.lastIndexOf("/"); if (p==-1) p=path.lastIndexOf("\s\s"); // Unix or Windows\n if (p!=-1) path=path.substr(0,p+1); // remove filename, leave trailing slash\n var file=""\n var result=window.mozAskForFilename(msg,path,file,true); // FF3 FIXUP ONLY\n if (target && result.length) // set target field and trigger handling\n { target.value=result; target.onchange(); }\n return result; \n }\n};\n//}}}\n//{{{\nif (window.mozAskForFilename===undefined) { // also defined by CoreTweaks (for ticket #604)\n window.mozAskForFilename=function(msg,path,file,mustExist) {\n if(!window.Components) return false;\n try {\n netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');\n var nsIFilePicker = window.Components.interfaces.nsIFilePicker;\n var picker = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker);\n picker.init(window, msg, mustExist?nsIFilePicker.modeOpen:nsIFilePicker.modeSave);\n var thispath = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);\n thispath.initWithPath(path);\n picker.displayDirectory=thispath;\n picker.defaultExtension='';\n picker.defaultString=file;\n picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterText|nsIFilePicker.filterHTML);\n if (picker.show()!=nsIFilePicker.returnCancel)\n var result=picker.file.persistentDescriptor;\n }\n catch(ex) { displayMessage(ex.toString()); }\n return result;\n }\n}\n//}}}
/***\n|Name|AttachFilePluginFormatters|\n|Source|http://www.TiddlyTools.com/#AttachFilePluginFormatters|\n|Version|3.7.0|\n|Author|Eric Shulman - ELS Design Studios|\n|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|\n|~CoreVersion|2.1|\n|Type|plugin|\n|Requires||\n|Overrides|'image' and 'prettyLink' formatters, TiddlyWiki.prototype.getRecursiveTiddlerText|\n|Description|run-time library for displaying attachment tiddlers|\n\nThis plugin provides "stand-alone" processing for //rendering// attachment tiddlers created by [[AttachFilePlugin]]. Attachment tiddlers are tagged with<<tag attachment>>and contain binary file content (e.g., jpg, gif, pdf, mp3, etc.) that has been stored directly as base64 text-encoded data or can be loaded from external files stored on a local filesystem or remote web server.\n\nNOTE: This plugin does not include the "control panel" and supporting functions needed to //create// new attachment tiddlers. Those features are provided by [[AttachFilePlugin]], which can be installed while building your document, and then safely omitted to reduce the overall file size when you publish your finished document (assuming you don't intend to create any additional attachment tiddlers in that document)\n!!!!!Formatters\n<<<\nThis plugin extends the behavior of the following TiddlyWiki core "wikify()" formatters:\n* embedded images: {{{[img[tooltip|image]]}}}\n* linked embedded images: {{{[img[tooltip|image][link]]}}}\n* external/"pretty" links: {{{[[label|link]]}}}\n\n''Please refer to AttachFilePlugin (source: http://www.TiddlyTools.com/#AttachFilePlugin) for additional information.''\n<<<\n!!!!!Revisions\n<<<\n2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros\n2007.10.29 [3.7.0] more code reduction: removed upload handling from AttachFilePlugin (saves ~7K!)\n2007.10.28 [3.6.0] removed duplicate formatter code from AttachFilePlugin (saves ~10K!) and updated documentation accordingly. This plugin ([[AttachFilePluginFormatters]]) is now //''required''// in order to display attached images/binary files within tiddler content.\n2006.05.20 [3.4.0] through 2007.03.01 [3.5.3] sync with AttachFilePlugin\n2006.05.13 [3.2.0] created from AttachFilePlugin v3.2.0\n<<<\n!!!!!Code\n***/\n// // version\n//{{{\nversion.extensions.attach = {major: 3, minor: 7, revision: 0, date: new Date(2007,10,28)};\n//}}}\n\n//{{{\nif (config.macros.attach==undefined) config.macros.attach= { };\n//}}}\n//{{{\nif (config.macros.attach.isAttachment==undefined) config.macros.attach.isAttachment=function (title) {\n var tiddler = store.getTiddler(title);\n if (tiddler==undefined || tiddler.tags==undefined) return false;\n return (tiddler.tags.indexOf("attachment")!=-1);\n}\n//}}}\n\n//{{{\n// test for local file existence\n// Returns true/false without visible error display\n// Uses Components for FF and ActiveX FSO object for MSIE\nif (config.macros.attach.fileExists==undefined) config.macros.attach.fileExists=function(theFile) {\n var found=false;\n // DEBUG: alert('testing fileExists('+theFile+')...');\n if(window.Components) {\n try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); }\n catch(e) { return false; } // security access denied\n var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);\n try { file.initWithPath(theFile); }\n catch(e) { return false; } // invalid directory\n found = file.exists();\n }\n else { // use ActiveX FSO object for MSIE \n var fso = new ActiveXObject("Scripting.FileSystemObject");\n found = fso.FileExists(theFile)\n }\n // DEBUG: alert(theFile+" "+(found?"exists":"not found"));\n return found;\n}\n//}}}\n\n//{{{\nif (config.macros.attach.getAttachment==undefined) config.macros.attach.getAttachment=function(title) {\n\n // extract embedded data, local and remote links (if any)\n var startmarker="---BEGIN_DATA---\sn";\n var endmarker="\sn---END_DATA---";\n var pos=0; var endpos=0;\n var text = store.getTiddlerText(title);\n var embedded="";\n var locallink="";\n var remotelink="";\n\n // look for embedded data, convert to data: URI\n if ((pos=text.indexOf(startmarker))!=-1 && (endpos=text.indexOf(endmarker))!=-1)\n embedded="data:"+(text.substring(pos+startmarker.length,endpos)).replace(/\sn/g,'');\n if (embedded.length && !config.browser.isIE)\n return embedded; // use embedded data if any... except for IE, which doesn't support data URI\n\n // no embedded data... fallback to local/remote reference links...\n\n // look for 'attachment link markers'\n if ((pos=text.indexOf("/%LOCAL_LINK%/"))!=-1)\n locallink=text.substring(text.indexOf("|",pos)+1,text.indexOf("]]",pos));\n if ((pos=text.indexOf("/%REMOTE_LINK%/"))!=-1)\n remotelink=text.substring(text.indexOf("|",pos)+1,text.indexOf("]]",pos));\n\n // document is being served remotely... use remote URL (if any) (avoids security alert)\n if (remotelink.length && document.location.protocol!="file:")\n return remotelink; \n\n // local link only... return link without checking file existence (avoids security alert)\n if (locallink.length && !remotelink.length) \n return locallink; \n\n // local link, check for file exist... use local link if found\n if (locallink.length) { \n if (this.fileExists(getLocalPath(locallink))) return locallink;\n // maybe local link is relative... add path from current document and try again\n var pathPrefix=document.location.href; // get current document path and trim off filename\n var slashpos=pathPrefix.lastIndexOf("/"); if (slashpos==-1) slashpos=pathPrefix.lastIndexOf("\s\s"); \n if (slashpos!=-1 && slashpos!=pathPrefix.length-1) pathPrefix=pathPrefix.substr(0,slashpos+1);\n if (this.fileExists(getLocalPath(pathPrefix+locallink))) return locallink;\n }\n\n // no embedded data, no local (or not found), fallback to remote URL (if any)\n if (remotelink.length) \n return remotelink;\n\n return ""; // attachment URL doesn't resolve\n}\n//}}}\n//{{{\nif (config.macros.attach.init_formatters==undefined) config.macros.attach.init_formatters=function() {\n if (this.initialized) return;\n // find the formatter for "image" and replace the handler\n for (var i=0; i<config.formatters.length && config.formatters[i].name!="image"; i++);\n if (i<config.formatters.length) config.formatters[i].handler=function(w) {\n if (!this.lookaheadRegExp) // fixup for TW2.0.x\n this.lookaheadRegExp = new RegExp(this.lookahead,"mg");\n this.lookaheadRegExp.lastIndex = w.matchStart;\n var lookaheadMatch = this.lookaheadRegExp.exec(w.source)\n if(lookaheadMatch && lookaheadMatch.index == w.matchStart) // Simple bracketted link\n {\n var e = w.output;\n if(lookaheadMatch[5])\n {\n var link = lookaheadMatch[5];\n // ELS -------------\n if (!config.formatterHelpers.isExternalLink) // fixup for TW2.0.x\n var external=!store.tiddlerExists(link)&&!store.isShadowTiddler(link);\n else\n var external=config.formatterHelpers.isExternalLink(link);\n if (external)\n {\n if (config.macros.attach.isAttachment(link))\n {\n e = createExternalLink(w.output,link);\n e.href=config.macros.attach.getAttachment(link);\n e.title = config.macros.attach.linkTooltip + link;\n }\n else\n e = createExternalLink(w.output,link);\n }\n else \n e = createTiddlyLink(w.output,link,false,null,w.isStatic);\n // ELS -------------\n addClass(e,"imageLink");\n }\n var img = createTiddlyElement(e,"img");\n if(lookaheadMatch[1])\n img.align = "left";\n else if(lookaheadMatch[2])\n img.align = "right";\n if(lookaheadMatch[3])\n img.title = lookaheadMatch[3];\n img.src = lookaheadMatch[4];\n // ELS -------------\n if (config.macros.attach.isAttachment(lookaheadMatch[4]))\n img.src=config.macros.attach.getAttachment(lookaheadMatch[4]);\n // ELS -------------\n w.nextMatch = this.lookaheadRegExp.lastIndex;\n }\n }\n//}}}\n//{{{\n // find the formatter for "prettyLink" and replace the handler\n for (var i=0; i<config.formatters.length && config.formatters[i].name!="prettyLink"; i++);\n if (i<config.formatters.length) {\n var v=version.major+.1*version.minor+.01*version.revision;\n if (v>=2.13) {\n config.formatters[i].handler=function(w) \n {\n this.lookaheadRegExp.lastIndex = w.matchStart;\n var lookaheadMatch = this.lookaheadRegExp.exec(w.source);\n if(lookaheadMatch && lookaheadMatch.index == w.matchStart)\n {\n var e;\n var text = lookaheadMatch[1];\n if(lookaheadMatch[3])\n {\n // Pretty bracketted link\n var link = lookaheadMatch[3];\n if (config.macros.attach.isAttachment(link))\n {\n e = createExternalLink(w.output,link);\n e.href=config.macros.attach.getAttachment(link);\n e.title=config.macros.attach.linkTooltip+link;\n }\n else e = (!lookaheadMatch[2] && config.formatterHelpers.isExternalLink(link))\n ? createExternalLink(w.output,link)\n : createTiddlyLink(w.output,link,false,null,w.isStatic);\n }\n else\n {\n e = createTiddlyLink(w.output,text,false,null,w.isStatic);\n }\n createTiddlyText(e,text);\n w.nextMatch = this.lookaheadRegExp.lastIndex;\n }\n }\n } else { // FALLBACK for TW2.1.2 and earlier\n config.formatters[i].handler=function(w)\n {\n if (!this.lookaheadRegExp) // fixup for TW2.0.x\n this.lookaheadRegExp = new RegExp(this.lookahead,"mg");\n this.lookaheadRegExp.lastIndex = w.matchStart;\n var lookaheadMatch = this.lookaheadRegExp.exec(w.source)\n if(lookaheadMatch && lookaheadMatch.index == w.matchStart)\n {\n var e;\n var text = lookaheadMatch[1];\n if (lookaheadMatch[2]) // Simple bracketted link\n {\n e = createTiddlyLink(w.output,text,false,null,w.isStatic);\n }\n else if(lookaheadMatch[3]) // Pretty bracketted link\n {\n var link = lookaheadMatch[4];\n // ELS -------------\n if (!config.formatterHelpers.isExternalLink) // fixup for TW2.0.x\n var external=!store.tiddlerExists(link)&&!store.isShadowTiddler(link);\n else\n var external=config.formatterHelpers.isExternalLink(link);\n if (external)\n {\n if (config.macros.attach.isAttachment(link))\n {\n e = createExternalLink(w.output,link);\n e.href=config.macros.attach.getAttachment(link);\n e.title = config.macros.attach.linkTooltip + link;\n }\n else\n e = createExternalLink(w.output,link);\n }\n else \n e = createTiddlyLink(w.output,link,false,null,w.isStatic);\n // ELS -------------\n }\n createTiddlyText(e,text);\n w.nextMatch = this.lookaheadRegExp.lastIndex;\n }\n }\n } // END FALLBACK\n } // if "prettyLink" formatter found\n this.initialized=true;\n}\n//}}}\n//{{{\nconfig.macros.attach.init_formatters(); // load time init\n//}}}\n//{{{\nif (TiddlyWiki.prototype.coreGetRecursiveTiddlerText==undefined) {\n TiddlyWiki.prototype.coreGetRecursiveTiddlerText = TiddlyWiki.prototype.getRecursiveTiddlerText;\n TiddlyWiki.prototype.getRecursiveTiddlerText = function(title,defaultText,depth) {\n return config.macros.attach.isAttachment(title)?\n config.macros.attach.getAttachment(title):this.coreGetRecursiveTiddlerText.apply(this,arguments);\n }\n}\n//}}}
/***\n|Name|AttachFilePluginInfo|\n|Source|http://www.TiddlyTools.com/#AttachFilePlugin|\n|Documentation|http://www.TiddlyTools.com/#AttachFilePluginInfo|\n|Version|3.9.0|\n|Author|Eric Shulman - ELS Design Studios|\n|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|\n|~CoreVersion|2.1|\n|Type|plugin|\n|Requires||\n|Overrides||\n|Description|Documentation for AttachFilePlugin|\nStore or link binary files (such as jpg, gif, pdf or even mp3) within your TiddlyWiki document and then use them as images or links from within your tiddler content.\n!!!!!Inline interface (live)\n>see [[AttachFile]] (shadow tiddler)\n><<tiddler AttachFile>>\n!!!!!Syntax\n<<<\n''To display the attach file control panel, simply view the [[AttachFile]] shadow tiddler that is automatically created by the plugin, and contains an instance of the inline control panel.''. Or, you can write:\n{{{\n<<attach inline>>\n}}}\nin any tiddler to display the control panel embedded within that tiddler. Note: you can actually use any unique identifier in place of the "inline" keyword. Each unique id creates a separate instance of the controls. If the same ID is used in more than one tiddler, then the control panel is automatically moved to the most recently rendered location. Or, you can write:\n{{{\n<<attach>>\n}}}\n(with no ID parameter) in SidebarOptions. This adds a command link that opens the controls as a floating panel, positioned directly to the left of the sidebar.\n<<<\n!!!!!Usage\n<<<\nBinary file content can be stored in three different locations:\n#embedded in the attachment tiddler (encoded as base64)\n#on your filesystem (a 'local link' path/filename)\n#on a web server (a 'remote link' URL)\nThe plugin creates an "attachment tiddler" for each file you attach. Regardless of where you store the binary content, your document can refer to the attachment tiddler rather than using a direct file or URL reference in your embedded image or external links, so that changing document locations will not require updating numerous tiddlers or copying files from one system to another.\n> Important note: As of version 3.6.0, in order to //render// images and other binary attachments created with this plugin, you must also install [[AttachFilePluginFormatters]], which extends the behavior of the TiddlyWiki core formatters for embedded images ({{{[img[tooltip|image]]}}}), linked embedded images ({{{[img[tooltip|image][link]]}}}), and external/"pretty" links ({{{[[label|link]]}}}), so that these formatter will process references to attachment tiddlers as if a normal file reference had been provided. |\nWhen you attach a file, a tiddler (tagged with<<tag attachment>>) is generated (using the source filename as the tiddler's title). The tiddler contains //''base64 text-encoded binary data''//, surrounded by {{{/%...%/}}} comment markers (so they are not visible when viewing the tiddler). The tiddler also includes summary details about the file: when it was attached, by whom, etc. and, if the attachment is an image file (jpg, gif, or png), the image is automatically displayed below the summary information.\n>Note: although you can edit an attachment tiddler, ''don't change any of the encoded content below the attachment header'', as it has been prepared for use in the rest of your document, and even changing a single character can make the attachment unusable. //If needed, you ''can'' edit the header information or even the MIME type declaration in the attachment data, but be very careful not to change any of the base64-encoded binary data.//\nWith embedded data, your TW document can be completely self-contained...unfortunately, embedding just a few moderately-sized binary files using base64 text-encoding can dramatically increase the size of your document. To avoid this problem, you can create attachment tiddlers that define external local filesystem (file://) and/or remote web server (http://) 'reference' links, without embedding the binary data directly in the tiddler (i.e., uncheck "embed data" in the 'control panel').\n\nThese links provide an alternative source for the binary data: if embedded data is not found (or you are running on Internet Explorer, which does not currently support using embedded data), then the plugin tries the local filesystem reference. If a local file is not found, then the remote reference (if any) is used. This "fallback" approach also lets you 'virtualize' the external links in your document, so that you can access very large binary content such as PDFs, MP3's, and even *video* files, by using just a 'remote reference link' without embedding any data or downloading huge files to your hard disk.\n\nOf course, when you //do// download an attached file, the local copy will be used instead of accessing a remote server each time, thereby saving bandwidth and allowing you to 'go mobile' without having to edit any tiddlers to alter the link locations...\n<<<\n!!!!!Syntax / Examples\n<<<\nTo embed attached files as images or link to them from other tiddlers, use the standard ~TiddlyWiki image syntax ({{{[img[tooltip|filename]]}}}), linked image syntax ({{{[img[tooltip|filename][tiddlername]]}}}) , or "external link" syntax ({{{[[text|URL]]}}}), replacing the filename or URL that is normally entered with the title of an attachment tiddler.\n\nembedded image data:\n>{{{[img[Meow|AttachFileSample]]}}}\n>[img[Meow|AttachFileSample]]\nembedded image data with link to larger remote image:\n>{{{[img[click for larger view|AttachFileSample][AttachFileSample2]]}}}\n>[img[click for larger view|AttachFileSample][AttachFileSample2]]\n'external' link to embedded image data:\n>{{{[[click to view attachment|AttachFileSample]]}}}\n>[[click to view attachment|AttachFileSample]]\n'external' link to remote image:\n>{{{[[click to view attachment|AttachFileSample2]]}}}\n>[[click to view attachment|AttachFileSample2]]\nregular ~TiddlyWiki links to attachment tiddlers:\n>{{{[[AttachFileSample]]}}} [[AttachFileSample]]\n>{{{[[AttachFileSample2]]}}} [[AttachFileSample2]]\n<<<\n!!!!!Defining MIME types\n<<<\nWhen you select a source file, a ''[[MIME|http://en.wikipedia.org/wiki/MIME]]'' file type is automatically suggested, based on filename extension. The AttachFileMIMETypes tiddler defines the list of MIME types that will be recognized by the plugin. Each MIME type definition consists of exactly two lines of text: the official MIME type designator (e.g., "text/plain", "image/gif", etc.), and a space-separated list of file extensions associated with that type. List entries are separated by "----" (horizontal rules).\n<<<\n!!!!!Known Limitations\n<<<\nInternet Explorer does not support the data: URI scheme, and cannot use the //embedded// data to render images or links. However, you can still use the local/remote link definitions to create file attachments that are stored externally. In addition, while it is relatively easy to read local //text// files, reading binary files is not directly supported by IE's FileSystemObject (FSO) methods, and other file I/O techniques are subject to security barriers or require additional MS proprietary technologies (like ASP or VB) that make implementation more difficult. As a result, you cannot //create// new attachment tiddlers using IE.\n<<<\n!!!!!Installation\n<<<\nImport (or copy/paste) the following tiddlers into your document:\n* [[AttachFilePlugin]] (tagged with <<tag systemConfig>>)\n* [[AttachFilePluginFormatters]] ("runtime distribution library") (tagged with <<tag systemConfig>>)\n* [[AttachFileSample]] and [[AttachFileSample2]] //(tagged with <<tag attachment>>)//\n* [[AttachFileMIMETypes //(defines binary file types)//\n> Important note: As of version 3.6.0, in order to //render// images and other binary attachments created with this plugin, you must also install [[AttachFilePluginFormatters]], which extends the behavior of the TiddlyWiki core formatters for embedded images ({{{[img[tooltip|image]]}}}), linked embedded images ({{{[img[tooltip|image][link]]}}}), and external/"pretty" links ({{{[[label|link]]}}}), so that these formatter will process references to attachment tiddlers as if a normal file reference had been provided. |\n<<<\n!!!!!Revisions\n<<<\n2008.07.21 [3.9.0] Fixup for FireFox 3: use HTML with separate text+button control instead of type='file' control\n2008.05.12 [3.8.1] automatically add 'attach' task to backstage (moved from BackstageTweaks)\n2008.04.09 [3.8.0] in onChangeSource(), if source matches current document folder, use relative reference for local link. Also, disable 'embed' when using IE (which //still// doesn't support data: URI)\n2008.04.07 [3.7.3] fixed typo in HTML for 'local file link' so that clicking in input field doesn't erase current path/file (if any)\n2008.04.07 [3.7.2] auto-create AttachFile shadow tiddler for inline interface\n2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info\n2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros\n2007.12.03 [3.7.1] in createAttachmentTiddler(), added optional "noshow" flag to suppress display of newly created tiddlers.\n2007.10.29 [3.7.0] code reduction: removed support for built-in upload to server... on-line hosting of binary attachments is left to the document author, who can upload/host files using 3rd-party web-based services (e.g. www.flickr.com, ) or stand-alone applications (e.g., FTP).\n2007.10.28 [3.6.0] code reduction: removed duplicate definition of image and prettyLink formatters. Rendering of attachment tiddlers now //requires// installation of AttachFilePluginFormatters\n2007.03.01 [3.5.3] use apply() to invoke hijacked function\n2007.02.25 [3.5.2] in hijack of "prettyLink", fix version check for TW2.2 compatibility (prevent incorrect use of fallback handler)\n2007.01.09 [3.5.1] onClickAttach() refactored to create separate createAttachmentTiddler() API for use with FileDropPluginHandlers\n2006.11.30 [3.5.0] in getAttachment(), for local references, add check for file existence and fallback to remote URL if local file not found. Added fileExists() to encapsulate FF vs. IE local file test function (IE FSO object code is TBD).\n2006.11.29 [3.4.8] in hijack for PrettyLink, 'simple bracketed link' opens tiddler instead of external link to attachment\n2006.11.29 [3.4.7] in readFile(), added try..catch around initWithPath() to handle invalid/non-existent paths better.\n2006.11.09 [3.4.6] REAL FIX for TWv2.1.3: incorporate new TW2.1.3 core "prettyLink" formatter regexp handling logic and check for version < 2.1.3 with fallback to old plugin code. Also, cleanup table layout in HTML (added "border:0" directly to table elements to override stylesheet)\n2006.11.08 [3.4.5] TEMPORARY FIX for TWv2.1.3: disable hijack of wikiLink formatter due to changes in core wikiLink regexp definition. //Links to attachments are broken, but you can still use {{{[img[TiddlerName]]}}} to render attachments as images, as well as {{{background:url('[[TiddlerName]]')}}} in CSS declarations for background images.//\n2006.09.10 [3.4.4] update formatters for 2.1 compatibility (use this.lookaheadRegExp instead of temp variable)\n2006.07.24 [3.4.3] in prettyLink formatter, added check for isShadowTiddler() to fix problem where shadow links became external links.\n2006.07.13 [3.4.2] in getAttachment(), fixed stripping of newlines so data: used in CSS will work\n2006.05.21 [3.4.1] in getAttachment(), fixed substring() to extract data: URI (was losing last character, which broken rendering of SOME images)\n2006.05.20 [3.4.0] hijack core getRecursiveTiddlerText() to support rendering attachments in stylesheets (e.g. {{{url([[AttachFileSample]])}}})\n2006.05.20 [3.3.6] add "description" feature to easily include notes in attachment tiddler (you can always edit to add them later... but...)\n2006.05.19 [3.3.5] add "attach as" feature to change default name for attachment tiddlers. Also, new optional param to specify tiddler name (disables editing)\n2006.05.16 [3.3.0] completed XMLHttpRequest handling for GET or POST to configurable server scripts\n2006.05.13 [3.2.0] added interface for upload feature. Major rewrite of code for clean object definitions. Major improvements in UI interaction and validation.\n2006.05.09 [3.1.1] add wikifer support for using attachments in links from "linked image" syntax: {{{[img[tip|attachment1][attachment2]]}}}\n2006.05.09 [3.1.0] lots of code changes: new options for attachments that use embedded data and/or links to external files (local or remote)\n2006.05.03 [3.0.2] added {{{/%...%/}}} comments around attachment data to hide it when viewing attachment tiddler.\n2006.02.05 [3.0.1] wrapped wikifier hijacks in initAttachmentFormatters() function to eliminate globals and avoid FireFox 1.5.0.1 crash bug when referencing globals\n2005.12.27 [3.0.0] Update for TW2.0. Automatically add 'excludeMissing' tag to attachments\n2005.12.16 [2.2.0] Dynamically create/remove attachPanel as needed to ensure only one instance of interface elements exists, even if there are multiple instances of macro embedding.\n2005.11.20 [2.1.0] added wikifier handler extensions for "image" and "prettyLink" to render tiddler attachments\n2005.11.09 [2.0.0] begin port from old ELS Design plugin/adaptation hybrid based on ~TW1.2.33\n2005.08.05 [1.1.0] moved CSS and HTML definitions into plugin code tiddler instead of using separate tiddlers\n2005.07.27 [1.0.2] core update 1.2.29: custom overlayStyleSheet() replaced with new core setStylesheet()\n2005.07.23 [1.0.1] added parameter checks and corrected addNotification() usage\n2005.07.20 [1.0.0] Initial Release\n<<<
[[AttachFilePlugin]] reads binary data from locally-stored files (e.g., images, PDFs, mp3's, etc.) and converts it to base64-encoded text that is stored in tiddlers tagged with<<tag attachment>>. [[AttachFilePluginFormatters]] allows you to use those tiddlers in place of the external path/file references that are normally part of the image and external links wiki syntax.\n\n[[FileDropPlugin]] and [[FileDropPluginConfig]] allow you to quickly create attachment tiddlers simply by dragging files directly from your system's desktop folder display and dropping it onto an open TiddlyWiki document. Text files are automatically created as simple tiddlers, while binary files are automatically encoded and attached.
text/plain\n.txt .text .js .vbs .asp .cgi .pl\n----\ntext/html\n.htm .html .hta .htx .mht\n----\ntext/comma-separated-values\n.csv\n----\ntext/javascript\n.js\n----\ntext/css\n.css\n----\ntext/xml\n.xml .xsl .xslt\n----\nimage/gif\n.gif\n----\nimage/jpeg\n.jpg .jpe .jpeg\n----\nimage/png\n.png\n----\nimage/bmp\n.bmp\n----\nimage/tiff\n.tif .tiff\n----\naudio/basic\n.au .snd\n----\naudio/wav\n.wav\n----\naudio/x-pn-realaudio\n.ra .rm .ram\n----\naudio/x-midi\n.mid .midi\n----\naudio/mp3\n.mp3\n----\naudio/m3u\n.m3u\n----\nvideo/x-ms-asf\n.asf\n----\nvideo/avi\n.avi\n----\nvideo/mpeg\n.mpg .mpeg\n----\nvideo/quicktime\n.qt .mov .qtvr\n----\napplication/pdf\n.pdf\n----\napplication/rtf\n.rtf\n----\napplication/postscript\n.ai .eps .ps\n----\napplication/wordperfect\n.wpd\n----\napplication/mswrite\n.wri\n----\napplication/msexcel\n.xls .xls3 .xls4 .xls5 .xlw\n----\napplication/msword\n.doc\n----\napplication/mspowerpoint\n.ppt .pps\n----\napplication/x-director\n.swa\n----\napplication/x-shockwave-flash\n.swf\n----\napplication/x-zip-compressed\n.zip\n----\napplication/x-gzip\n.gz\n----\napplication/x-rar-compressed\n.rar\n----\napplication/octet-stream\n.com .exe .dll .ocx\n----\napplication/java-archive\n.jar
[[casa]]
[[GBTIDL]]\n[[CASA]]\n[[Python]]
To contribute code, you will need an account on this wiki and some code to contribute. \n\nI'm working on a server-side solution with accounts, but in the meantime, you will simply need to send code to Jeremy for upload. \n\nOnce the server is up, you can contribute in three ways:\n\n1) Click <<newTiddler>> in the sidebar, enter your title and description, followed by the command """<<attach>>""". An interface should pop up that allows you to select your file.\n\n2) Click <<attach>> in the sidebar.\n\n3) Make a <<newTiddler>> and link directly to a file served elsewhere (like your own web directory): """[[text|path/to/file.idl]]"""
| source file:|{{{rrls.py}}}|\n| attached on:|25 July 2008 by Jeremy|\n| description:|Compute radio recombination line freqeuncies, any atom, any line.|\n| embedded:|[[rrls.py|rrls.txt]] - {{{type=text/plain, size=243 bytes, encoded=329 bytes}}}|\n| local file:|//none//|\n| remote link:|[[rrls.py|http://casa.colorado.edu/~jdarling/megawiki/rrls.txt]]|\n\n/% DO NOT EDIT BELOW THIS POINT\n---BEGIN_DATA---\ntext/plain;base64,\nZGVmIHJybChuLGRuPTEsYW11PTEuMDA3ODI1KTogICAgIyBjb21wdXRlIFJhZGlv\nIFJlY29tYiBMaW5lIGZlcXMgaW4gR0h6CiAgICAjIGZyb20gQnJvd24sIExvY2tt\nYW4gJiBLbmFwcCBBUkFBIDE5NzggMTYgNDQ1CiAgICBmcm9tIG1hdGggaW1wb3J0\nICoKICAgIG51ID0gMy4yODk4NDJlNiooMS01LjQ4NTkzZS00L2FtdSkqKDEvZmxv\nYXQobikqKjIgLSAxL2Zsb2F0KG4rZG4pKioyKQogICAgcmV0dXJuIG51CgogICAg\nCgoK\n---END_DATA---\n%/
<<search>><<closeAll>><<permaview>><<newTiddler>><<newJournal "DD MMM YYYY" "journal">><<saveChanges>><<attach>><<slider 'chkLoginStatus' 'LoginStatus' ' Login Status »' 'Login to make changes'>><<slider chkSliderOptionsPanel OptionsPanel "options »" "Change TiddlyWiki advanced options">>
[[gbtidl]]\n
[[python]]
[[GBTIDL]]\n[[CASA]]\n[[Python]]\n\n[[Contribute]]\n[[About]]
| source file:|//none//|\n| attached on:|7 August 2008 by zeigerb|\n| description:|Scale a poorly-calibrated continuum to match a well-calibrated one.|\n| embedded:|//none//|\n| local file:|//none//|\n| remote link:|/%REMOTE_LINK%/[[https://webfiles.colorado.edu/zeigerb/research/match_dc.pro|https://webfiles.colorado.edu/zeigerb/research/match_dc.pro]]|\n
| source file:|//none//|\n| attached on:|7 August 2008 by zeigerb|\n| description:|Search all records mathcing criteria (scan, plnum, etc.) for time-dependent RFI and flag it; optionally flags only affected channels|\n| embedded:|//none//|\n| local file:|//none//|\n| remote link:|/%REMOTE_LINK%/[[ https://webfiles.colorado.edu/zeigerb/research/rfi_flagger.pro| https://webfiles.colorado.edu/zeigerb/research/rfi_flagger.pro]]|\n
| source file:|//none//|\n| attached on:|7 August 2008 by zeigerb|\n| description:|Plot an ascii file generated by GBTIDL with full IDL plotting capabilities, including (encapuslated) postscript, as options|\n| embedded:|//none//|\n| local file:|//none//|\n| remote link:|/%REMOTE_LINK%/[[ https://webfiles.colorado.edu/zeigerb/research/plot_ascii.pro| https://webfiles.colorado.edu/zeigerb/research/plot_ascii.pro]]|\n
We are the [[Molecular ExtraGalactic Astrophysics (MEGA) Group|http://casa.colorado.edu/~jdarling/group.html]].