1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-26 01:50:28 +00:00

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Bram Chen 2014-08-29 00:28:27 +08:00
commit 1ee07ec770
37 changed files with 146 additions and 55 deletions

View File

@ -480,18 +480,15 @@ $tw.utils.PasswordPrompt.prototype.createPrompt = function(options) {
children = [dm("h1",{text: options.serviceName})];
if(!options.noUserName) {
children.push(dm("input",{
attributes: {type: "text", name: "username", placeholder: "Username"},
"class": "input-small"
attributes: {type: "text", name: "username", placeholder: "Username"}
}));
}
children.push(dm("input",{
attributes: {type: "password", name: "password", placeholder: "Password"},
"class": "input-small"
attributes: {type: "password", name: "password", placeholder: "Password"}
}));
if(options.canCancel) {
children.push(dm("button",{
text: "Cancel",
"class": "btn",
eventListeners: [{
name: "click",
handlerFunction: function(event) {
@ -503,11 +500,9 @@ $tw.utils.PasswordPrompt.prototype.createPrompt = function(options) {
}
children.push(dm("button",{
attributes: {type: "submit"},
text: submitText,
"class": "btn"
text: submitText
}));
var form = dm("form",{
"class": "form-inline",
attributes: {autocomplete: "off"},
children: children
});

View File

@ -1,7 +1,7 @@
title: $:/language/Modals/Download
type: text/vnd.tiddlywiki
subtitle: Download changes
footer: <$button message="tw-close-tiddler" class="btn btn-primary">Close</$button>
footer: <$button message="tw-close-tiddler">Close</$button>
help: http://tiddlywiki.com/static/DownloadingChanges.html
Your browser only supports manual saving.

View File

@ -1,7 +1,7 @@
title: $:/language/Modals/SaveInstructions
type: text/vnd.tiddlywiki
subtitle: Save your work
footer: <$button message="tw-close-tiddler" class="btn btn-primary">Close</$button>
footer: <$button message="tw-close-tiddler">Close</$button>
help: http://tiddlywiki.com/static/SavingChanges.html
Your changes to this wiki need to be saved as a ~TiddlyWiki HTML file.

View File

@ -19,13 +19,13 @@ exports.prefix = function(source,operator,options) {
var results = [];
if(operator.prefix === "!") {
source(function(tiddler,title) {
if(title.substr(0,operator.operand.length).toLowerCase() !== operator.operand.toLowerCase()) {
if(title.substr(0,operator.operand.length) !== operator.operand) {
results.push(title);
}
});
} else {
source(function(tiddler,title) {
if(title.substr(0,operator.operand.length).toLowerCase() === operator.operand.toLowerCase()) {
if(title.substr(0,operator.operand.length) === operator.operand) {
results.push(title);
}
});

View File

@ -18,7 +18,7 @@ Export our filter function
exports.removeprefix = function(source,operator,options) {
var results = [];
source(function(tiddler,title) {
if(title.substr(0,operator.operand.length).toLowerCase() === operator.operand.toLowerCase()) {
if(title.substr(0,operator.operand.length) === operator.operand) {
results.push(title.substr(operator.operand.length));
}
});

View File

@ -0,0 +1,28 @@
/*\
title: $:/core/modules/filters/removesuffix.js
type: application/javascript
module-type: filteroperator
Filter operator for removing a suffix from each title in the list. Titles that do not end with the suffix are removed.
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.removesuffix = function(source,operator,options) {
var results = [];
source(function(tiddler,title) {
if(title.substr(-operator.operand.length) === operator.operand) {
results.push(title.substr(0,title.length - operator.operand.length));
}
});
return results;
};
})();

View File

@ -0,0 +1,36 @@
/*\
title: $:/core/modules/filters/suffix.js
type: application/javascript
module-type: filteroperator
Filter operator for checking if a title ends with a suffix
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.suffix = function(source,operator,options) {
var results = [];
if(operator.prefix === "!") {
source(function(tiddler,title) {
if(title.substr(-operator.operand.length) !== operator.operand) {
results.push(title);
}
});
} else {
source(function(tiddler,title) {
if(title.substr(-operator.operand.length) === operator.operand) {
results.push(title);
}
});
}
return results;
};
})();

View File

@ -55,7 +55,6 @@ Modal.prototype.display = function(title,options) {
$tw.utils.addClass(modalWrapper,"modal");
$tw.utils.addClass(modalHeader,"modal-header");
$tw.utils.addClass(modalBody,"modal-body");
$tw.utils.addClass(modalLink,"btn btn-large btn-block btn-success");
$tw.utils.addClass(modalFooter,"modal-footer");
// Join them together
wrapper.appendChild(modalBackdrop);
@ -115,10 +114,6 @@ Modal.prototype.display = function(title,options) {
message: {
type: "string",
value: "tw-close-tiddler"
},
"class": {
type: "string",
value: "btn btn-primary"
}
},
children: [{

View File

@ -70,7 +70,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
*/
TiddlerWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes.tiddler || changedTiddlers[this.tiddlerTitle]) {
if(changedAttributes.tiddler) {
this.refreshSelf();
return true;
} else {

View File

@ -6,6 +6,6 @@ $:/config/EditToolbarButtons/Visibility/$(listItem)$
\end
<div class="tw-tiddler-title">
<$view field="title"/>
<span class="tw-tiddler-controls titlebar"><$list filter="[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]" variable="listItem"><$reveal type="nomatch" state=<<config-title>> text="hide"><$transclude tiddler=<<listItem>>/></$reveal></$list></span>
<span class="tw-tiddler-controls tc-titlebar"><$list filter="[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]" variable="listItem"><$reveal type="nomatch" state=<<config-title>> text="hide"><$transclude tiddler=<<listItem>>/></$reveal></$list></span>
<div style="clear: both;"></div>
</div>

View File

@ -1,4 +1,4 @@
title: $:/core/ui/EditTemplate/title
tags: $:/tags/EditTemplate
<$edit-text field="draft.title" class="titlebar tw-edit-texteditor"/>
<$edit-text field="draft.title" class="tc-titlebar tw-edit-texteditor"/>

View File

@ -1,3 +1,3 @@
title: $:/core/ui/TiddlerInfo
<$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/TiddlerInfo]!has[draft.of]]" default="$:/core/ui/TiddlerInfo/References"/>
<$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/TiddlerInfo]!has[draft.of]]" default={{$:/config/TiddlerInfo/Default}}/>

View File

@ -8,7 +8,7 @@ fill:$(foregroundColor)$;
$:/config/ViewToolbarButtons/Visibility/$(listItem)$
\end
<div class="tw-tiddler-title">
<h2 class="titlebar">
<h2 class="tc-titlebar">
<span class="tw-tiddler-controls">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]]" variable="listItem"><$reveal type="nomatch" state=<<config-title>> text="hide"><$transclude tiddler=<<listItem>>/></$reveal></$list>
</span>

View File

@ -3,10 +3,10 @@ title: $:/snippets/encryptionstatus
\define lingo-base() $:/language/ControlPanel/Tools/Encryption/
<$reveal type="match" state="$:/isEncrypted" text="yes">
<<lingo Enabled/Prompt>>
<$button message="tw-clear-password" class="btn btn-danger"><<lingo ClearPassword/Button>></$button>
<$button message="tw-set-password" class="btn btn-warning"><<lingo ChangePassword/Button>></$button>
<$button message="tw-clear-password"><<lingo ClearPassword/Button>></$button>
<$button message="tw-set-password"><<lingo ChangePassword/Button>></$button>
</$reveal>
<$reveal type="nomatch" state="$:/isEncrypted" text="yes">
<<lingo Disabled/Prompt>>
<$button message="tw-set-password" class="btn btn-warning"><<lingo SetPassword/Button>></$button>
<$button message="tw-set-password"><<lingo SetPassword/Button>></$button>
</$reveal>

View File

@ -2,5 +2,5 @@ title: HelloThere
This is an experimental edition of TiddlyWiki5 for use with [[Tahoe-LAFS|https://tahoe-lafs.org/]]. At this point it is largely for experimentation by @zooko. Click the ''save changes'' button to PUT the updated TiddlyWiki HTML file back to the server.
<$button message="tw-new-tiddler" class="btn btn-success">New Tiddler</$button>
<$button message="tw-save-wiki" class="btn btn-primary">Save Changes</$button>
<$button message="tw-new-tiddler">New Tiddler</$button>
<$button message="tw-save-wiki">Save Changes</$button>

View File

@ -5,7 +5,7 @@ title: Features
type: text/vnd.tiddlywiki
\define alert-demo()
<$fieldmangler tiddler="SampleAlert"><$set name="currentTiddler" value="SampleAlert"><$button message="tw-add-tag" param="$:/tags/Alert" class="btn btn-inverse">alerts</$button></$set></$fieldmangler>
<$fieldmangler tiddler="SampleAlert"><$set name="currentTiddler" value="SampleAlert"><$button message="tw-add-tag" param="$:/tags/Alert">alerts</$button></$set></$fieldmangler>
\end
* The ability to save changes on almost any desktop HTML5 compatible-browser, with custom apps to enable [[Saving on iPad/iPhone]] and [[Android|Saving on Android]], and a cross-platform [[Firefox extension|Saving with TiddlyFox]] that even runs on Android
* Support for pluggable themes and colour palettes (see the [[control panel|$:/ControlPanel]])
@ -15,7 +15,7 @@ type: text/vnd.tiddlywiki
* Integrated [[AES encryption|Saving with Encryption]]
* TiddlyWiki isn't just a wiki - you can build custom applications with it like this TaskManagementExample
* Full internationalization support, with TiddlyWiki itself available in several languages (see the [[control panel|$:/ControlPanel]])
* Familiar user interface elements like <<alert-demo>>, <$button message="tw-modal" param="SampleWizard" class="btn btn-inverse">wizards</$button> and <$button message="tw-notify" param="SampleNotification" class="btn btn-inverse">notifications</$button>
* Familiar user interface elements like <<alert-demo>>, <$button message="tw-modal" param="SampleWizard">wizards</$button> and <$button message="tw-notify" param="SampleNotification">notifications</$button>
* Easily [[import|ImportTiddlers]] content via drag and drop, copy and paste, or browsing for local files
* Clone existing tiddlers (for example, <$button message="tw-new-tiddler" param=<<currentTiddler>>>clone this tiddler</$button>)
* TiddlyWiki is [[surprisingly scalable|Scalability]] to many thousands of tiddlers and megabytes of content

View File

@ -7,17 +7,25 @@ type: text/vnd.tiddlywiki
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.15-beta...v5.0.16-beta]]//
!! Incompatible Changes
These changes have the potential to break existing tiddlers.
* [[Changed|https://github.com/Jermolene/TiddlyWiki5/commit/112a9a95d95e9f62f110c97a4faaf537c5c100b1]] prefix/removeprefix filter operators to be case-sensitive
!! Usability Improvements
* [[Amended|https://github.com/Jermolene/TiddlyWiki5/commit/e47852cb141b384ad2a9097eca795545cb5b2494]] behaviour of the [[tw-browser-refresh|WidgetMessage: tw-browser-refresh]] message so that it no longer clears the location hash
!! Hackability Improvements
*
* [[Extend|https://github.com/Jermolene/TiddlyWiki5/commit/d2a5a12f2d6b6ccc36dd22a70ac2def08d1d3722]] TableOfContentsMacro to use the caption field if present
* [[Configurability|https://github.com/Jermolene/TiddlyWiki5/commit/b437f1b450f5f2a3104a9086f7c674299b53b9bc]] for the default tab shown in the tiddler info panel (see [[Configuring the default TiddlerInfo tab]])
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/dcf4e93a3283e3e93cc14e50366f9b0252870835]] [[suffix|FilterOperator: suffix]] and [[removesuffix|FilterOperator: removesuffix]] filter operators
!! Bug Fixes
*
* [[Reverted|https://github.com/Jermolene/TiddlyWiki5/commit/ad40223d6b9bed435d9381611cb9de1841b53df6]] incorrect refreshing of the tiddler widget
!! Contributors

View File

@ -12,4 +12,4 @@ For example:
|`[tag[task]!prefix[hidden]]` |Returns tiddlers tagged `task` whose titles do not start with `hidden` |
|`[prefix[$:/]]` |Equivalent to `[is[system]]` |
See also [[FilterOperator: removeprefix]].
See also [[FilterOperator: removeprefix]], [[FilterOperator: removesuffix]] and [[FilterOperator: removesuffix]].

View File

@ -11,4 +11,4 @@ For example:
|!Filter String |!Description |
|`tid-one tid-two three +[removeprefix[tid-]]` |Returns `one`, `two` |
See also [[FilterOperator: prefix]].
See also [[FilterOperator: prefix]], [[FilterOperator: suffix]] and [[FilterOperator: removesuffix]].

View File

@ -0,0 +1,14 @@
created: 20140828133830424
modified: 20140828133830424
tags: filters
title: FilterOperator: removesuffix
type: text/vnd.tiddlywiki
The ''removesuffix'' filter operator returns the titles in the current list that end with a specified suffix with the suffix removed.
For example:
|!Filter String |!Description |
|`tid-one tid-two three +[removeprefix[tid-]]` |Returns `one`, `two` |
See also [[FilterOperator: suffix]], [[FilterOperator: prefix]] and [[FilterOperator: removeprefix]].

View File

@ -0,0 +1,15 @@
created: 20140828133830424
modified: 20140828133830424
tags: filters
title: FilterOperator: suffix
type: text/vnd.tiddlywiki
The ''suffix'' filter operator returns the titles in the current list that end with a specified suffix. If the ''suffix'' operator is preceded by `!` then it returns the titles that do not end with the specified suffix.
For example:
|!Filter String |!Description |
|`[tag[task]!suffix[hidden]]` |Returns tiddlers tagged `task` whose titles do not end with `hidden` |
|`[suffix[.jpg]]` |Returns tiddlers whose titles end with `.jpg` |
See also [[FilterOperator: removesuffix]], [[FilterOperator: prefix]] and [[FilterOperator: removeprefix]].

View File

@ -6,7 +6,7 @@ type: text/vnd.tiddlywiki
Alerts are displayed as yellow boxes overlaying the main TiddlyWiki window. Each one corresponds to a tiddler with the tag [[$:/tags/Alert]]. Clicking the delete icon on an alert deletes the corresponding tiddler.
Here's a demo <$fieldmangler tiddler="SampleAlert"><$set name="currentTiddler" value="SampleAlert"><$button message="tw-add-tag" param="$:/tags/Alert" class="btn btn-inverse">alert</$button></$set></$fieldmangler>.
Here's a demo <$fieldmangler tiddler="SampleAlert"><$set name="currentTiddler" value="SampleAlert"><$button message="tw-add-tag" param="$:/tags/Alert">alert</$button></$set></$fieldmangler>.
Alert tiddlers should have the following fields:

View File

@ -1,10 +1,10 @@
title: SampleWizard
tags: demo
subtitle: I'm a modal wizard
footer: <$button message="tw-close-tiddler" class="btn btn-primary">Close</$button>
footer: <$button message="tw-close-tiddler">Close</$button>
This is a modal wizard dialogue, stored in the tiddler SampleWizard.
{{Motovun Jack.jpg}}
You can <$button message="tw-modal" param="SampleWizard2" class="btn btn-inverse">nest wizards</$button>.
You can <$button message="tw-modal" param="SampleWizard2">nest wizards</$button>.

View File

@ -1,8 +1,8 @@
title: SampleWizard2
tags: demo
subtitle: I'm another modal wizard
footer: <$button message="tw-close-tiddler" class="btn btn-primary">Close</$button>
footer: <$button message="tw-close-tiddler">Close</$button>
This is another modal wizard dialogue, stored in the tiddler SampleWizard2.
You can <$button message="tw-modal" param="SampleWizard" class="btn btn-inverse">nest wizards</$button>.
You can <$button message="tw-modal" param="SampleWizard">nest wizards</$button>.

View File

@ -1,7 +1,7 @@
title: $:/language/Modals/Download
type: text/vnd.tiddlywiki
subtitle: Änderungen Speichern
footer: <$button message="tw-close-tiddler" class="btn btn-primary">Schließen</$button>
footer: <$button message="tw-close-tiddler">Schließen</$button>
help: http://tiddlywiki.com/static/DownloadingChanges.html
Ihr Browser unterstützt nur manuelles Speichern.

View File

@ -1,7 +1,7 @@
title: $:/language/Modals/SaveInstructions
type: text/vnd.tiddlywiki
subtitle: Aktuellen Stand speichern
footer: <$button message="tw-close-tiddler" class="btn btn-primary">Schließen</$button>
footer: <$button message="tw-close-tiddler">Schließen</$button>
help: http://tiddlywiki.com/static/SavingChanges.html
Ihre Änderungen sollen als ~TiddlyWiki HTML Datei gespeichert werden.

View File

@ -1,7 +1,7 @@
title: $:/language/Modals/Download
type: text/vnd.tiddlywiki
subtitle: Télécharger vos modifications
footer: <$button message="tw-close-tiddler" class="btn btn-primary">Fermer</$button>
footer: <$button message="tw-close-tiddler">Fermer</$button>
help: http://tiddlywiki.com/static/DownloadingChanges.html
Votre navigateur ne supporte que l'enregistrement manuel.

View File

@ -1,7 +1,7 @@
title: $:/language/Modals/SaveInstructions
type: text/vnd.tiddlywiki
subtitle: Enregistrez votre travail
footer: <$button message="tw-close-tiddler" class="btn btn-primary">Fermer</$button>
footer: <$button message="tw-close-tiddler">Fermer</$button>
help: http://tiddlywiki.com/static/SavingChanges.html
Les modifications effectuées dans ce wiki doivent être sauvegardées sous forme de fichier ~TiddlyWiki HTML.

View File

@ -1,7 +1,7 @@
title: $:/language/Modals/Download
type: text/vnd.tiddlywiki
subtitle: Download changes
footer: <$button message="tw-close-tiddler" class="btn btn-primary">Chiudi</$button>
footer: <$button message="tw-close-tiddler">Chiudi</$button>
help: http://tiddlywiki.com/static/DownloadingChanges.html
Il tuo browser supporta solo il salvataggio manuale.

View File

@ -1,7 +1,7 @@
title: $:/language/Modals/SaveInstructions
type: text/vnd.tiddlywiki
subtitle: Save your work
footer: <$button message="tw-close-tiddler" class="btn btn-primary">Chiudi</$button>
footer: <$button message="tw-close-tiddler">Chiudi</$button>
help: http://tiddlywiki.com/static/SavingChanges.html
Le modifiche a questo wiki devono essere salvate come un file ~TiddlyWiki HTML.

View File

@ -1,7 +1,7 @@
title: $:/language/Modals/Download
type: text/vnd.tiddlywiki
subtitle: 変更のダウンロード
footer: <$button message="tw-close-tiddler" class="btn btn-primary">閉じる</$button>
footer: <$button message="tw-close-tiddler">閉じる</$button>
help: http://tiddlywiki.com/static/DownloadingChanges.html
このブラウザは手動での保存しかできません。

View File

@ -1,7 +1,7 @@
title: $:/language/Modals/SaveInstructions
type: text/vnd.tiddlywiki
subtitle: 作業内容を保存する
footer: <$button message="tw-close-tiddler" class="btn btn-primary">閉じる</$button>
footer: <$button message="tw-close-tiddler">閉じる</$button>
help: http://tiddlywiki.com/static/SavingChanges.html
この wiki への変更内容を ~TiddlyWiki HTML ファイルとして保存する必要があります。

View File

@ -1,7 +1,7 @@
title: $:/language/Modals/Download
type: text/vnd.tiddlywiki
subtitle: Download changes
footer: <$button message="tw-close-tiddler" class="btn btn-primary">关闭</$button>
footer: <$button message="tw-close-tiddler">关闭</$button>
help: http://tiddlywiki.com/
您的浏览器只支援手动保存。

View File

@ -1,7 +1,7 @@
title: $:/language/Modals/SaveInstructions
type: text/vnd.tiddlywiki
subtitle: Save your work
footer: <$button message="tw-close-tiddler" class="btn btn-primary">关闭</$button>
footer: <$button message="tw-close-tiddler">关闭</$button>
help: http://tiddlywiki.com/static/SavingChanges.html
您对此 wiki 的变更需被保存为 ~TiddlyWiki HTML 文件。

View File

@ -1,7 +1,7 @@
title: $:/language/Modals/SaveInstructions
type: text/vnd.tiddlywiki
subtitle: Save your work
footer: <$button message="tw-close-tiddler" class="btn btn-primary">關閉</$button>
footer: <$button message="tw-close-tiddler">關閉</$button>
help: http://tiddlywiki.com/static/SavingChanges.html
您對此 wiki 的變更需被儲存為 ~TiddlyWiki HTML 檔案。

View File

@ -3,10 +3,10 @@ caption: Server
tags: $:/tags/ControlPanel
<$reveal state="$:/status/IsLoggedIn" type="nomatch" text="yes">
Log in to ~TiddlyWeb: <$button message="tw-login" class="btn btn-info">Login</$button>
Log in to ~TiddlyWeb: <$button message="tw-login">Login</$button>
</$reveal>
<$reveal state="$:/status/IsLoggedIn" type="match" text="yes">
Logged in as {{$:/status/UserName}} <$button message="tw-logout" class="btn btn-warning">Logout</$button>
Logged in as {{$:/status/UserName}} <$button message="tw-logout">Logout</$button>
</$reveal>
----
@ -17,4 +17,4 @@ Host configuration: <$edit-text tiddler="$:/config/tiddlyweb/host" tag="input" d
----
<$button message="tw-server-refresh" class="btn btn-warning">Refresh</$button> to fetch changes from the server immediately
<$button message="tw-server-refresh">Refresh</$button> to fetch changes from the server immediately

View File

@ -594,7 +594,7 @@ button.tw-tag-label, span.tw-tag-label {
}
.tw-site-title,
.titlebar {
.tc-titlebar {
font-weight: 300;
font-size: 2.35em;
line-height: 1.2em;
@ -606,7 +606,7 @@ button.tw-tag-label, span.tw-tag-label {
color: <<colour muted-foreground>>;
}
.titlebar img {
.tc-titlebar img {
height: 1em;
}