| 371 | | config.macros.newTiddler.onClick = function() |
|---|
| | 371 | |
|---|
| | 372 | |
|---|
| | 373 | config.macros.newTiddler.createNewTiddlerButton = function(place,title,params,label,prompt,accessKey,newFocus) |
|---|
| | 374 | { |
|---|
| | 375 | var tags = []; |
|---|
| | 376 | for(var t=1; t<params.length; t++) |
|---|
| | 377 | if((params[t].name == "anon" && t != 1) || (params[t].name == "tag")) |
|---|
| | 378 | tags.push(params[t].value); |
|---|
| | 379 | if(params[0]["label"]) |
|---|
| | 380 | label = params[0]["label"][0]; |
|---|
| | 381 | if(params[0]["prompt"]) |
|---|
| | 382 | prompt = params[0]["prompt"][0]; |
|---|
| | 383 | if(params[0]["accessKey"]) |
|---|
| | 384 | accessKey = params[0]["accessKey"][0]; |
|---|
| | 385 | var btn = createTiddlyButton(place,label,prompt,this.onClickNewTiddler,null,null,accessKey); |
|---|
| | 386 | btn.setAttribute("newTitle",title); |
|---|
| | 387 | btn.setAttribute("params",tags.join("|")); |
|---|
| | 388 | btn.setAttribute("newFocus",newFocus); |
|---|
| | 389 | return btn; |
|---|
| | 390 | } |
|---|
| | 391 | |
|---|
| | 392 | config.macros.newTiddler.onClickNewTiddler = function() |
|---|
| 388 | | if(params[0]) |
|---|
| 389 | | title = params[0]; |
|---|
| 390 | | var btn = createTiddlyButton(place,this.label,this.prompt,this.onClick,null,null,this.accessKey); |
|---|
| 391 | | btn.setAttribute("newTitle",title); |
|---|
| 392 | | btn.setAttribute("params",params.join("|")); |
|---|
| 393 | | btn.setAttribute("newFocus","title"); |
|---|
| 394 | | } |
|---|
| 395 | | } |
|---|
| 396 | | |
|---|
| 397 | | config.macros.newJournal.handler = function(place,macroName,params) |
|---|
| | 410 | if(params[1] && params[1].name == "anon") |
|---|
| | 411 | title = params[1].value; |
|---|
| | 412 | if(params[0]["title"]) |
|---|
| | 413 | title = params[0]["title"][0]; |
|---|
| | 414 | this.createNewTiddlerButton(place,title,params,this.label,this.prompt,this.accessKey,"title"); |
|---|
| | 415 | } |
|---|
| | 416 | } |
|---|
| | 417 | |
|---|
| | 418 | config.macros.newJournal.handler = function(place,macroName,params,wikifier,paramString,tiddler) |
|---|
| 402 | | var title = now.formatString(params[0].trim()); |
|---|
| 403 | | var btn = createTiddlyButton(place,this.label,this.prompt,config.macros.newTiddler.onClick,null,null,this.accessKey); |
|---|
| 404 | | btn.setAttribute("newTitle",title); |
|---|
| 405 | | btn.setAttribute("params",params.join("|")); |
|---|
| 406 | | btn.setAttribute("newFocus","text"); |
|---|
| | 424 | var title = ""; |
|---|
| | 425 | if(params[1].name = "anon") |
|---|
| | 426 | title = params[1].value; |
|---|
| | 427 | if(params[0]["title"]) |
|---|
| | 428 | title = params[0]["title"][0]; |
|---|
| | 429 | title = now.formatString(title.trim()); |
|---|
| | 430 | config.macros.newTiddler.createNewTiddlerButton(place,title,params,this.label,this.prompt,this.accessKey,"text"); |
|---|