mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
Add a new journal page toolbar button
Spot the easter egg with the toolbar button… Fixes #336
This commit is contained in:
parent
0dcf54c3b5
commit
e872f17842
11
core/images/new-journal-button.tid
Normal file
11
core/images/new-journal-button.tid
Normal file
@ -0,0 +1,11 @@
|
||||
title: $:/core/images/new-journal-button
|
||||
tags: $:/tags/Image
|
||||
|
||||
<svg class="tc-image-new-journal-button tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
|
||||
<g fill-rule="evenodd">
|
||||
<path d="M94.0292969,15.8677686 L79.7519531,15.8677686 C79.7519531,19.0628043 82.3534236,21.6528926 85.5625,21.6528926 L88.21875,21.6528926 L88.21875,24.2975207 L88.21875,31.7355372 L88.21875,34.3801653 L85.5625,34.3801653 C75.2934554,34.3801653 66.96875,26.091883 66.96875,15.8677686 L66.96875,15.8677686 L66.4375,15.8677686 L66.4375,15.8677686 C66.4375,7.10424199 59.3020382,0 50.5,0 C41.6979618,0 34.5625,7.10424199 34.5625,15.8677686 C34.5625,24.6312952 41.6979618,31.7355372 50.5,31.7355372 L50.5,24.2975207 C45.8239172,24.2975207 42.0332031,20.5233921 42.0332031,15.8677686 C42.0332031,11.2121451 45.8239172,7.43801653 50.5,7.43801653 C55.1760828,7.43801653 58.9667969,11.2121451 58.9667969,15.8677686 L44.6894531,15.8677686 L44.6894531,15.8677686 C44.6894531,19.0628043 47.2909236,21.6528926 50.5,21.6528926 L53.15625,21.6528926 L53.15625,24.2975207 L53.15625,31.7355372 L53.15625,34.3801653 L50.5,34.3801653 C40.2309554,34.3801653 31.90625,26.091883 31.90625,15.8677686 L25,15.8677686 L25,128 L110,128 L110,15.8677686 L101.5,15.8677686 C101.5,7.10424199 94.3645382,0 85.5625,0 C76.7604618,0 69.625,7.10424199 69.625,15.8677686 C69.625,24.6312952 76.7604618,31.7355372 85.5625,31.7355372 L85.5625,24.2975207 C80.8864172,24.2975207 77.0957031,20.5233921 77.0957031,15.8677686 C77.0957031,11.2121451 80.8864172,7.43801653 85.5625,7.43801653 C90.2385828,7.43801653 94.0292969,11.2121451 94.0292969,15.8677686 Z M62.1789039,108.449078 L62.1789039,119.245226 C62.1789039,120.437733 63.1300595,121.404456 64.3033627,121.404456 L69.6145099,121.404456 C70.7878132,121.404456 71.7389688,120.437733 71.7389688,119.245226 L71.7389688,108.449078 L82.3612632,108.449078 C83.5345664,108.449078 84.485722,107.482391 84.485722,106.289848 L84.485722,100.891774 C84.485722,99.6992319 83.5345664,98.7325448 82.3612632,98.7325448 L71.7389688,98.7325448 L71.7389688,87.9363966 C71.7389688,86.7438541 70.7878132,85.777167 69.6145099,85.777167 L64.3033627,85.777167 C63.1300595,85.777167 62.1789039,86.7438541 62.1789039,87.9363966 L62.1789039,98.7325448 L51.5566095,98.7325448 C50.3833034,98.7325448 49.4321506,99.6992319 49.4321506,100.891774 L49.4321506,106.289848 C49.4321506,107.482391 50.3833034,108.449078 51.5566095,108.449078 L62.1789039,108.449078 Z"></path>
|
||||
<text font-family="Helvetica" font-size="48" font-weight="bold" fill="#FFFFFF">
|
||||
<tspan x="68" y="77.4847912" text-anchor="middle"><<now "DD">></tspan>
|
||||
</text>
|
||||
</g>
|
||||
</svg>
|
@ -34,6 +34,8 @@ Home/Caption: home
|
||||
Home/Hint: Open the default tiddlers
|
||||
Language/Caption: language
|
||||
Language/Hint: Choose the user interface language
|
||||
NewJournal/Caption: new journal
|
||||
NewJournal/Hint: Create a new journal tiddler
|
||||
NewTiddler/Caption: new tiddler
|
||||
NewTiddler/Hint: Create a new tiddler
|
||||
More/Caption: more
|
||||
|
32
core/modules/macros/now.js
Normal file
32
core/modules/macros/now.js
Normal file
@ -0,0 +1,32 @@
|
||||
/*\
|
||||
title: $:/core/modules/macros/now.js
|
||||
type: application/javascript
|
||||
module-type: macro
|
||||
|
||||
Macro to return a formatted version of the current time
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Information about this macro
|
||||
*/
|
||||
|
||||
exports.name = "now";
|
||||
|
||||
exports.params = [
|
||||
{name: "format"}
|
||||
];
|
||||
|
||||
/*
|
||||
Run the macro
|
||||
*/
|
||||
exports.run = function(format) {
|
||||
return $tw.utils.formatDateString(new Date(),format || "0hh:0mm, DDth MMM YYYY");
|
||||
};
|
||||
|
||||
})();
|
14
core/ui/PageControls/new-journal.tid
Normal file
14
core/ui/PageControls/new-journal.tid
Normal file
@ -0,0 +1,14 @@
|
||||
title: $:/core/ui/Buttons/new-journal
|
||||
tags: $:/tags/PageControls
|
||||
caption: {{$:/core/images/new-journal-button}} {{$:/language/Buttons/NewJournal/Caption}}
|
||||
description: {{$:/language/Buttons/NewJournal/Hint}}
|
||||
|
||||
<$button tooltip={{$:/language/Buttons/NewJournal/Hint}} aria-label={{$:/language/Buttons/NewJournal/Caption}} class=<<tv-config-toolbar-class>>>
|
||||
<$action-sendmessage $message="tm-new-tiddler" title=<<now "DDth MMM YYYY">> tags="Journal"/>
|
||||
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
|
||||
{{$:/core/images/new-journal-button}}
|
||||
</$list>
|
||||
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
|
||||
<$text text={{$:/language/Buttons/NewJournal/Caption}}/>
|
||||
</$list>
|
||||
</$button>
|
@ -9,6 +9,7 @@ core/ui/Buttons/import: hide
|
||||
core/ui/Buttons/language: hide
|
||||
core/ui/Buttons/tag-manager: hide
|
||||
core/ui/Buttons/more-page-actions: hide
|
||||
core/ui/Buttons/new-journal: hide
|
||||
core/ui/Buttons/permaview: hide
|
||||
core/ui/Buttons/storyview: hide
|
||||
core/ui/Buttons/theme: hide
|
||||
|
@ -1,2 +1,2 @@
|
||||
title: $:/tags/PageControls
|
||||
list: [[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/close-all]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/import]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/tag-manager]] [[$:/core/ui/Buttons/language]] [[$:/core/ui/Buttons/theme]] [[$:/core/ui/Buttons/storyview]] [[$:/core/ui/Buttons/encryption]] [[$:/core/ui/Buttons/full-screen]] [[$:/core/ui/Buttons/save-wiki]] [[$:/core/ui/Buttons/refresh]] [[$:/core/ui/Buttons/more-page-actions]]
|
||||
list: [[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/close-all]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/new-journal]] [[$:/core/ui/Buttons/import]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/tag-manager]] [[$:/core/ui/Buttons/language]] [[$:/core/ui/Buttons/theme]] [[$:/core/ui/Buttons/storyview]] [[$:/core/ui/Buttons/encryption]] [[$:/core/ui/Buttons/full-screen]] [[$:/core/ui/Buttons/save-wiki]] [[$:/core/ui/Buttons/refresh]] [[$:/core/ui/Buttons/more-page-actions]]
|
||||
|
28
editions/tw5.com/tiddlers/NowMacro.tid
Normal file
28
editions/tw5.com/tiddlers/NowMacro.tid
Normal file
@ -0,0 +1,28 @@
|
||||
caption: qualify
|
||||
created: 20141008141616791
|
||||
modified: 20141008142012309
|
||||
tags: Macros
|
||||
title: NowMacro
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
The 'now' macro returns the current date and time, formatted with an optional format string.
|
||||
|
||||
! Parameters
|
||||
|
||||
|!Position |!Name |!Description |!Default |
|
||||
|1st |format |DateFormat string specifying the format for the date/time |`0hh:0mm, DDth MMM YYYY` |
|
||||
|
||||
! Examples
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
* <<now>>
|
||||
* <<now "DDth MMM YYYY">>
|
||||
```
|
||||
|
||||
Returns:
|
||||
|
||||
* <<now>>
|
||||
* <<now "DDth MMM YYYY">>
|
||||
|
Loading…
Reference in New Issue
Block a user