mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-02-27 20:39:49 +00:00
Compare commits
5 Commits
super-safe
...
blockquote
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe3ac0b28a | ||
|
|
d93dcbea6c | ||
|
|
66d12c257c | ||
|
|
321b5bafda | ||
|
|
ba919fba7a |
@@ -1577,8 +1577,6 @@ $tw.Wiki.prototype.processSafeMode = function() {
|
||||
this.addTiddler(new $tw.Tiddler({title: titleReportTiddler, text: report.join("\n\n")}));
|
||||
// Set $:/DefaultTiddlers to point to our report
|
||||
this.addTiddler(new $tw.Tiddler({title: "$:/DefaultTiddlers", text: "[[" + titleReportTiddler + "]]"}));
|
||||
// Switch to the safe mode layout
|
||||
this.addTiddler({title: "$:/layout", text: "$:/core/ui/SafeLayout"});
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -59,7 +59,6 @@ Manager/Controls/Show/Option/Tiddlers: tiddlers
|
||||
Manager/Controls/Show/Prompt: Show:
|
||||
Manager/Controls/Sort/Prompt: Sort by:
|
||||
Manager/Item/Colour: Colour
|
||||
Manager/Item/Editor: Editor
|
||||
Manager/Item/Fields: Fields
|
||||
Manager/Item/Icon/None: (none)
|
||||
Manager/Item/Icon: Icon
|
||||
|
||||
@@ -107,7 +107,7 @@ exports.parseStringLiteral = function(source,pos) {
|
||||
type: "string",
|
||||
start: pos
|
||||
};
|
||||
var reString = /(?:"""([\s\S]*?)"""|"([^"]*)")|(?:'([^']*)')|\[\[((?:[^\]]|\](?!\]))*)\]\]/g;
|
||||
var reString = /(?:"""([\s\S]*?)"""|"([^"]*)")|(?:'([^']*)')|\[\[((?:[^\]]|\](?!\]))*)\]\]/y;
|
||||
reString.lastIndex = pos;
|
||||
var match = reString.exec(source);
|
||||
if(match && match.index === pos) {
|
||||
@@ -221,7 +221,7 @@ exports.parseMacroInvocationAsTransclusion = function(source,pos) {
|
||||
orderedAttributes: []
|
||||
};
|
||||
// Define our regexps
|
||||
var reVarName = /([^\s>"'=:]+)/g;
|
||||
var reVarName = /([^\s>"'=:]+)/y;
|
||||
// Skip whitespace
|
||||
pos = $tw.utils.skipWhiteSpace(source,pos);
|
||||
// Look for a double opening angle bracket
|
||||
@@ -237,9 +237,11 @@ exports.parseMacroInvocationAsTransclusion = function(source,pos) {
|
||||
}
|
||||
$tw.utils.addAttributeToParseTreeNode(node,"$variable",token.match[1]);
|
||||
pos = token.end;
|
||||
// Check that the tag is terminated by a space or >>
|
||||
if(!$tw.utils.parseWhiteSpace(source,pos) && !(source.charAt(pos) === ">" && source.charAt(pos + 1) === ">") ) {
|
||||
return null;
|
||||
// Check that the tag is terminated by a space or >>, and that there is a closing >> somewhere ahead
|
||||
if(!(source.charAt(pos) === ">" && source.charAt(pos + 1) === ">") ) {
|
||||
if(!$tw.utils.parseWhiteSpace(source,pos) || source.indexOf(">>",pos) === -1) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// Process attributes
|
||||
pos = $tw.utils.parseMacroParametersAsAttributes(node,source,pos);
|
||||
@@ -267,7 +269,7 @@ exports.parseMVVReferenceAsTransclusion = function(source,pos) {
|
||||
orderedAttributes: []
|
||||
};
|
||||
// Define our regexps
|
||||
var reVarName = /([^\s>"'=:)]+)/g;
|
||||
var reVarName = /([^\s>"'=:)]+)/y;
|
||||
// Skip whitespace
|
||||
pos = $tw.utils.skipWhiteSpace(source,pos);
|
||||
// Look for a double opening parenthesis
|
||||
@@ -323,17 +325,17 @@ exports.parseMacroParameterAsAttribute = function(source,pos) {
|
||||
start: pos
|
||||
};
|
||||
// Define our regexps
|
||||
var reAttributeName = /([^\/\s>"'`=:]+)/g,
|
||||
reUnquotedAttribute = /((?:(?:>(?!>))|[^\s>"'])+)/g,
|
||||
reFilteredValue = /\{\{\{([\S\s]+?)\}\}\}/g,
|
||||
reIndirectValue = /\{\{([^\}]+)\}\}/g,
|
||||
reSubstitutedValue = /(?:```([\s\S]*?)```|`([^`]|[\S\s]*?)`)/g;
|
||||
var reAttributeName = /([^\/\s>"'`=:]+)/y,
|
||||
reUnquotedAttribute = /((?:(?:>(?!>))|[^\s>"'])+)/y,
|
||||
reFilteredValue = /\{\{\{([\S\s]+?)\}\}\}/y,
|
||||
reIndirectValue = /\{\{([^\}]+)\}\}/y,
|
||||
reSubstitutedValue = /(?:```([\s\S]*?)```|`([^`]|[\S\s]*?)`)/y;
|
||||
// Skip whitespace
|
||||
pos = $tw.utils.skipWhiteSpace(source,pos);
|
||||
// Get the attribute name and the separator token
|
||||
var nameToken = $tw.utils.parseTokenRegExp(source,pos,reAttributeName),
|
||||
namePos = nameToken && $tw.utils.skipWhiteSpace(source,nameToken.end),
|
||||
separatorToken = nameToken && $tw.utils.parseTokenRegExp(source,namePos,/=|:/g),
|
||||
separatorToken = nameToken && $tw.utils.parseTokenRegExp(source,namePos,/=|:/y),
|
||||
isNewStyleSeparator = false; // If there is no separator then we don't allow new style values
|
||||
// If we have a name and a separator then we have a named attribute
|
||||
if(nameToken && separatorToken) {
|
||||
|
||||
@@ -221,7 +221,7 @@ function updateLocationHash(options) {
|
||||
$tw.utils.copyToClipboard(url,{successNotification: options.successNotification, failureNotification: options.failureNotification});
|
||||
}
|
||||
// Only change the location hash if we must, thus avoiding unnecessary onhashchange events
|
||||
if($tw.utils.getLocationHash() !== $tw.locationHash && !$tw.safeMode) {
|
||||
if($tw.utils.getLocationHash() !== $tw.locationHash) {
|
||||
if(options.updateHistory === "yes") {
|
||||
// Assign the location hash so that history is updated
|
||||
window.location.hash = $tw.locationHash;
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
title: $:/Manager/ItemMain/Editor
|
||||
tags: $:/tags/Manager/ItemMain
|
||||
caption: {{$:/language/Manager/Item/Editor}}
|
||||
|
||||
<$edit-text tag="textarea" class="tc-edit-texteditor tc-edit-texteditor-body tc-max-width"/>
|
||||
@@ -13,8 +13,3 @@ caption: {{$:/language/Manager/Item/Tools}}
|
||||
{{$:/core/images/edit-button}} edit
|
||||
</$button>
|
||||
</p>
|
||||
<p>
|
||||
<$button message="tm-delete-tiddler" param=<<currentTiddler>>>
|
||||
{{$:/core/images/delete-button}} delete
|
||||
</$button>
|
||||
</p>
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
title: $:/core/ui/SafeLayout
|
||||
tags: $:/tags/Layout
|
||||
name: Safe Mode Layout
|
||||
description: Safe Mode Layout
|
||||
icon: $:/core/images/list
|
||||
|
||||
\whitespace trim
|
||||
|
||||
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
|
||||
|
||||
\define tv-config-toolbar-class() tc-btn-invisible
|
||||
\define tv-config-toolbar-icons() yes
|
||||
\define tv-config-toolbar-text() no
|
||||
|
||||
<div style="margin: 1em;">
|
||||
|
||||
<$navigator story="$:/StoryList" history="$:/HistoryList">
|
||||
|
||||
<h2>Layout</h2>
|
||||
|
||||
{{$:/snippets/LayoutSwitcher}}
|
||||
|
||||
<h2>Controls</h2>
|
||||
|
||||
<div class="tc-page-controls">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]">
|
||||
<$transclude mode="inline"/>
|
||||
</$list>
|
||||
</div>
|
||||
|
||||
<h2>Tiddlers</h2>
|
||||
|
||||
<$transclude tiddler="$:/Manager" mode="block"/>
|
||||
|
||||
</$navigator>
|
||||
|
||||
</div>
|
||||
@@ -1,4 +1,3 @@
|
||||
title: $:/state/popup/manager/item/$:/Manager/
|
||||
|
||||
ItemMain/RawText: hide
|
||||
ItemMain/Editor: hide
|
||||
ItemMain/RawText: hide
|
||||
Reference in New Issue
Block a user