1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-02-09 15:40:03 +00:00
This commit is contained in:
saqimtiaz 2020-11-02 22:48:36 +01:00
commit d1fbe28f4d
63 changed files with 268 additions and 139 deletions

View File

@ -267,8 +267,16 @@ $tw.utils.htmlDecode = function(s) {
Get the browser location.hash. We don't use location.hash because of the way that Firefox auto-urldecodes it (see http://stackoverflow.com/questions/1703552/encoding-of-window-location-hash) Get the browser location.hash. We don't use location.hash because of the way that Firefox auto-urldecodes it (see http://stackoverflow.com/questions/1703552/encoding-of-window-location-hash)
*/ */
$tw.utils.getLocationHash = function() { $tw.utils.getLocationHash = function() {
var parts = window.location.href.split('#'); var href = window.location.href;
return "#" + (parts.length > 1 ? parts[1] : ""); var idx = href.indexOf('#');
if(idx === -1) {
return "#";
} else if(idx < href.length-1 && href[idx+1] === '#') {
// Special case: ignore location hash if it itself starts with a #
return "#";
} else {
return href.substring(idx);
}
}; };
/* /*

View File

@ -15,8 +15,9 @@ Listing/Preview/Diff: Diff
Listing/Preview/DiffFields: Diff (Fields) Listing/Preview/DiffFields: Diff (Fields)
Listing/Rename/Tooltip: Rename tiddler before importing Listing/Rename/Tooltip: Rename tiddler before importing
Listing/Rename/Prompt: Rename to: Listing/Rename/Prompt: Rename to:
Listing/Rename/ConfirmRename : Rename tiddler Listing/Rename/ConfirmRename: Rename tiddler
Listing/Rename/CancelRename : Cancel Listing/Rename/CancelRename: Cancel
Listing/Rename/OverwriteWarning: A tiddler with this title already exists.
Upgrader/Plugins/Suppressed/Incompatible: Blocked incompatible or obsolete plugin Upgrader/Plugins/Suppressed/Incompatible: Blocked incompatible or obsolete plugin
Upgrader/Plugins/Suppressed/Version: Blocked plugin (due to incoming <<incoming>> being older than existing <<existing>>) Upgrader/Plugins/Suppressed/Version: Blocked plugin (due to incoming <<incoming>> being older than existing <<existing>>)
Upgrader/Plugins/Upgraded: Upgraded plugin from <<incoming>> to <<upgraded>> Upgrader/Plugins/Upgraded: Upgraded plugin from <<incoming>> to <<upgraded>>

View File

@ -64,7 +64,7 @@ OfficialPluginLibrary: Official ~TiddlyWiki Plugin Library
OfficialPluginLibrary/Hint: The official ~TiddlyWiki plugin library at tiddlywiki.com. Plugins, themes and language packs are maintained by the core team. OfficialPluginLibrary/Hint: The official ~TiddlyWiki plugin library at tiddlywiki.com. Plugins, themes and language packs are maintained by the core team.
PluginReloadWarning: Please save {{$:/core/ui/Buttons/save-wiki}} and reload {{$:/core/ui/Buttons/refresh}} to allow changes to ~JavaScript plugins to take effect PluginReloadWarning: Please save {{$:/core/ui/Buttons/save-wiki}} and reload {{$:/core/ui/Buttons/refresh}} to allow changes to ~JavaScript plugins to take effect
RecentChanges/DateFormat: DDth MMM YYYY RecentChanges/DateFormat: DDth MMM YYYY
Shortcuts/Input/AdvancedSearch/Hint: Open the AdvancedSearch panel from within the sidebar search field Shortcuts/Input/AdvancedSearch/Hint: Open the ~AdvancedSearch panel from within the sidebar search field
Shortcuts/Input/Accept/Hint: Accept the selected item Shortcuts/Input/Accept/Hint: Accept the selected item
Shortcuts/Input/AcceptVariant/Hint: Accept the selected item (variant) Shortcuts/Input/AcceptVariant/Hint: Accept the selected item (variant)
Shortcuts/Input/Cancel/Hint: Clear the input field Shortcuts/Input/Cancel/Hint: Clear the input field
@ -72,6 +72,7 @@ Shortcuts/Input/Down/Hint: Select the next item
Shortcuts/Input/Tab-Left/Hint: Select the previous Tab Shortcuts/Input/Tab-Left/Hint: Select the previous Tab
Shortcuts/Input/Tab-Right/Hint: Select the next Tab Shortcuts/Input/Tab-Right/Hint: Select the next Tab
Shortcuts/Input/Up/Hint: Select the previous item Shortcuts/Input/Up/Hint: Select the previous item
Shortcuts/SidebarLayout/Hint: Change the sidebar layout
SystemTiddler/Tooltip: This is a system tiddler SystemTiddler/Tooltip: This is a system tiddler
SystemTiddlers/Include/Prompt: Include system tiddlers SystemTiddlers/Include/Prompt: Include system tiddlers
TagManager/Colour/Heading: Colour TagManager/Colour/Heading: Colour

View File

@ -0,0 +1,30 @@
/*\
title: $:/core/modules/filterrunprefixes/intersection.js
type: application/javascript
module-type: filterrunprefix
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter prefix function
*/
exports.intersection = function(operationSubFunction) {
return function(results,source,widget) {
if(results.length !== 0) {
var secondRunResults = operationSubFunction(source,widget);
var firstRunResults = results.splice(0);
$tw.utils.each(firstRunResults,function(title) {
if(secondRunResults.indexOf(title) !== -1) {
results.push(title);
}
});
}
};
};
})();

View File

@ -56,14 +56,14 @@ exports.trim = function(source,operator,options) {
return result; return result;
}; };
// makeStringBinaryOperator(
// function(a) {return [$tw.utils.trim(a)];}
// );
exports.split = makeStringBinaryOperator( exports.split = makeStringBinaryOperator(
function(a,b) {return ("" + a).split(b);} function(a,b) {return ("" + a).split(b);}
); );
exports["enlist-input"] = makeStringBinaryOperator(
function(a) {return $tw.utils.parseStringArray("" + a);}
);
exports.join = makeStringReducingOperator( exports.join = makeStringReducingOperator(
function(accumulator,value,operand) { function(accumulator,value,operand) {
if(accumulator === null) { if(accumulator === null) {

View File

@ -87,8 +87,14 @@ ListWidget.prototype.getTiddlerList = function() {
}; };
ListWidget.prototype.getEmptyMessage = function() { ListWidget.prototype.getEmptyMessage = function() {
var emptyMessage = this.getAttribute("emptyMessage",""), var parser,
parser = this.wiki.parseText("text/vnd.tiddlywiki",emptyMessage,{parseAsInline: true}); emptyMessage = this.getAttribute("emptyMessage","");
// this.wiki.parseText() calls
// new Parser(..), which should only be done, if needed, because it's heavy!
if (emptyMessage === "") {
return [];
}
parser = this.wiki.parseText("text/vnd.tiddlywiki",emptyMessage,{parseAsInline: true});
if(parser) { if(parser) {
return parser.tree; return parser.tree;
} else { } else {

View File

@ -378,10 +378,10 @@ exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive,is
y = Number(b); y = Number(b);
if(isNumeric && (!isNaN(x) || !isNaN(y))) { if(isNumeric && (!isNaN(x) || !isNaN(y))) {
return compareNumbers(x,y); return compareNumbers(x,y);
} else if(isAlphaNumeric) {
return isDescending ? b.localeCompare(a,undefined,{numeric: true,sensitivity: "base"}) : a.localeCompare(b,undefined,{numeric: true,sensitivity: "base"});
} else if($tw.utils.isDate(a) && $tw.utils.isDate(b)) { } else if($tw.utils.isDate(a) && $tw.utils.isDate(b)) {
return isDescending ? b - a : a - b; return isDescending ? b - a : a - b;
} else if(isAlphaNumeric) {
return isDescending ? b.localeCompare(a,undefined,{numeric: true,sensitivity: "base"}) : a.localeCompare(b,undefined,{numeric: true,sensitivity: "base"});
} else { } else {
a = String(a); a = String(a);
b = String(b); b = String(b);

View File

@ -4,13 +4,23 @@ caption: {{$:/language/Search/Filter/Caption}}
\define lingo-base() $:/language/Search/ \define lingo-base() $:/language/Search/
\define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/advanced-search-results" tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" actions="""<$action-setfield $tiddler="$:/state/advancedsearch/currentTab" text=<<nextTab>>/>"""/> \define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/advanced-search-results" tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" actions="""<$action-setfield $tiddler="$:/state/advancedsearch/currentTab" text=<<nextTab>>/>"""/>
<$linkcatcher to="$:/temp/advancedsearch">
\define cancel-search-actions() <$list filter="[{$:/temp/advancedsearch/input}!match{$:/temp/advancedsearch}]" emptyMessage="""<$action-deletetiddler $filter="[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]" />"""><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/></$list>
\define input-accept-actions() <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>
\define input-accept-variant-actions() <$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list>
<<lingo Filter/Hint>> <<lingo Filter/Hint>>
<div class="tc-search tc-advanced-search"> <div class="tc-search tc-advanced-search">
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>> <$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>> <$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
<$edit-text tiddler="$:/temp/advancedsearch" type="search" tag="input" focus={{$:/config/Search/AutoFocus}}/> <$macrocall $name="keyboard-driven-input" tiddler="$:/temp/advancedsearch/input" storeTitle="$:/temp/advancedsearch"
refreshTitle="$:/temp/advancedsearch/refresh" selectionStateTitle="$:/temp/advancedsearch/selected-item" type="search"
tag="input" focus={{$:/config/Search/AutoFocus}} configTiddlerFilter="[[$:/temp/advancedsearch]]" firstSearchFilterField="text"
inputAcceptActions=<<input-accept-actions>> inputAcceptVariantActions=<<input-accept-variant-actions>>
inputCancelActions=<<cancel-search-actions>>/>
</$keyboard> </$keyboard>
</$keyboard> </$keyboard>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch/FilterButton]!has[draft.of]]"><$transclude/></$list> <$list filter="[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch/FilterButton]!has[draft.of]]"><$transclude/></$list>
@ -20,7 +30,11 @@ caption: {{$:/language/Search/Filter/Caption}}
<$set name="resultCount" value="""<$count filter={{$:/temp/advancedsearch}}/>"""> <$set name="resultCount" value="""<$count filter={{$:/temp/advancedsearch}}/>""">
<div class="tc-search-results"> <div class="tc-search-results">
<<lingo Filter/Matches>> <<lingo Filter/Matches>>
<$list filter={{$:/temp/advancedsearch}} template="$:/core/ui/ListItemTemplate"/> <$list filter={{$:/temp/advancedsearch}}>
<span class={{{[<currentTiddler>addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] +[then[]else[tc-list-item-selected]] }}}>
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
</span>
</$list>
</div> </div>
</$set> </$set>
</$reveal> </$reveal>

View File

@ -3,7 +3,8 @@ tags: $:/tags/AdvancedSearch/FilterButton
<$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> <$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$button class="tc-btn-invisible"> <$button class="tc-btn-invisible">
<$action-setfield $tiddler="$:/temp/advancedsearch" $field="text" $value=""/> <<cancel-search-actions>>
<$action-sendmessage $message="tm-focus-selector" $param=""".tc-advanced-search input""" />
{{$:/core/images/close-button}} {{$:/core/images/close-button}}
</$button> </$button>
</$reveal> </$reveal>

View File

@ -9,7 +9,7 @@ tags: $:/tags/AdvancedSearch/FilterButton
<$reveal state=<<qualify "$:/state/filterDropdown">> type="popup" position="belowleft" animate="yes"> <$reveal state=<<qualify "$:/state/filterDropdown">> type="popup" position="belowleft" animate="yes">
<$set name="tv-show-missing-links" value="yes"> <$set name="tv-show-missing-links" value="yes">
<$linkcatcher to="$:/temp/advancedsearch"> <$linkcatcher actions="""<$action-setfield $tiddler="$:/temp/advancedsearch" text=<<navigateTo>>/><$action-setfield $tiddler="$:/temp/advancedsearch/input" text=<<navigateTo>>/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/><$action-sendmessage $message="tm-focus-selector" $param='.tc-advanced-search input' />""">
<div class="tc-block-dropdown-wrapper"> <div class="tc-block-dropdown-wrapper">
<div class="tc-block-dropdown tc-edit-type-dropdown"> <div class="tc-block-dropdown tc-edit-type-dropdown">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Filter]]"><$link to={{!!filter}}><$transclude field="description"/></$link> <$list filter="[all[shadows+tiddlers]tag[$:/tags/Filter]]"><$link to={{!!filter}}><$transclude field="description"/></$link>

View File

@ -7,7 +7,7 @@ first-search-filter: [all[shadows]search<userInput>sort[title]limit[250]] -[[$:/
\define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/advanced-search-results" tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" actions="""<$action-setfield $tiddler="$:/state/advancedsearch/currentTab" text=<<nextTab>>/>"""/> \define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/advanced-search-results" tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" actions="""<$action-setfield $tiddler="$:/state/advancedsearch/currentTab" text=<<nextTab>>/>"""/>
\define cancel-search-actions() <$action-deletetiddler $filter="[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]" /> \define cancel-search-actions() <$list filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]" emptyMessage="""<$action-deletetiddler $filter="[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]" />"""><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/></$list><$action-sendmessage $message="tm-focus-selector" $param=""".tc-advanced-search input"""/>
\define input-accept-actions() <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> \define input-accept-actions() <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>
@ -18,11 +18,11 @@ first-search-filter: [all[shadows]search<userInput>sort[title]limit[250]] -[[$:/
<div class="tc-search"> <div class="tc-search">
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>> <$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>> <$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
<$macrocall $name="keyboard-driven-input" tiddler="$:/temp/advancedsearch" storeTitle="$:/temp/advancedsearch/input" <$macrocall $name="keyboard-driven-input" tiddler="$:/temp/advancedsearch/input" storeTitle="$:/temp/advancedsearch"
refreshTitle="$:/temp/advancedsearch/refresh" selectionStateTitle="$:/temp/advancedsearch/selected-item" type="search" refreshTitle="$:/temp/advancedsearch/refresh" selectionStateTitle="$:/temp/advancedsearch/selected-item" type="search"
tag="input" focus={{$:/config/Search/AutoFocus}} configTiddlerFilter="[[$:/core/ui/AdvancedSearch/Shadows]]" tag="input" focus={{$:/config/Search/AutoFocus}} configTiddlerFilter="[[$:/core/ui/AdvancedSearch/Shadows]]"
inputCancelActions=<<cancel-search-actions>> inputAcceptActions=<<input-accept-actions>> inputCancelActions=<<cancel-search-actions>> inputAcceptActions=<<input-accept-actions>>
inputAcceptVariantActions=<<input-accept-variant-actions>> /> inputAcceptVariantActions=<<input-accept-variant-actions>> filterMinLength={{$:/config/Search/MinLength}}/>
</$keyboard> </$keyboard>
</$keyboard> </$keyboard>
<$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> <$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
@ -33,17 +33,17 @@ first-search-filter: [all[shadows]search<userInput>sort[title]limit[250]] -[[$:/
</$reveal> </$reveal>
</div> </div>
<$reveal state="$:/temp/advancedsearch/input" type="nomatch" text=""> <$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$list filter="[{$:/temp/advancedsearch/input}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem"> <$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem">
<$set name="resultCount" value="""<$count filter="[all[shadows]search{$:/temp/advancedsearch/input}] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]]"/>"""> <$set name="resultCount" value="""<$count filter="[all[shadows]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]]"/>""">
<div class="tc-search-results"> <div class="tc-search-results">
<<lingo Shadows/Matches>> <<lingo Shadows/Matches>>
<$list filter="[all[shadows]search{$:/temp/advancedsearch/input}sort[title]limit[250]] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]]"> <$list filter="[all[shadows]search{$:/temp/advancedsearch}sort[title]limit[250]] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]]">
<span class={{{[<currentTiddler>addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] +[then[]else[tc-list-item-selected]] }}}> <span class={{{[<currentTiddler>addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] +[then[]else[tc-list-item-selected]] }}}>
<$transclude tiddler="$:/core/ui/ListItemTemplate"/> <$transclude tiddler="$:/core/ui/ListItemTemplate"/>
</span> </span>
@ -57,6 +57,6 @@ first-search-filter: [all[shadows]search<userInput>sort[title]limit[250]] -[[$:/
</$reveal> </$reveal>
<$reveal state="$:/temp/advancedsearch/input" type="match" text=""> <$reveal state="$:/temp/advancedsearch" type="match" text="">
</$reveal> </$reveal>

View File

@ -7,7 +7,7 @@ caption: {{$:/language/Search/Standard/Caption}}
\define next-search-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/search-results/advancedsearch" tag="$:/tags/SearchResults" beforeafter="$beforeafter$" defaultState={{$:/config/SearchResults/Default}} actions="""<$action-setfield $tiddler="$:/state/advancedsearch/standard/currentTab" text=<<nextTab>>/>"""/> \define next-search-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/search-results/advancedsearch" tag="$:/tags/SearchResults" beforeafter="$beforeafter$" defaultState={{$:/config/SearchResults/Default}} actions="""<$action-setfield $tiddler="$:/state/advancedsearch/standard/currentTab" text=<<nextTab>>/>"""/>
\define cancel-search-actions() <$action-deletetiddler $filter="[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]" /> \define cancel-search-actions() <$list filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]" emptyMessage="""<$action-deletetiddler $filter="[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]" />"""><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/></$list><$action-sendmessage $message="tm-focus-selector" $param=""".tc-advanced-search input"""/>
\define input-accept-actions() <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> \define input-accept-actions() <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>
@ -20,16 +20,17 @@ caption: {{$:/language/Search/Standard/Caption}}
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>> <$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
<$keyboard key="shift-alt-Right" actions=<<next-search-tab>>> <$keyboard key="shift-alt-Right" actions=<<next-search-tab>>>
<$keyboard key="shift-alt-Left" actions=<<next-search-tab "before">>> <$keyboard key="shift-alt-Left" actions=<<next-search-tab "before">>>
<$macrocall $name="keyboard-driven-input" tiddler="$:/temp/advancedsearch" storeTitle="$:/temp/advancedsearch/input" <$macrocall $name="keyboard-driven-input" tiddler="$:/temp/advancedsearch/input" storeTitle="$:/temp/advancedsearch"
refreshTitle="$:/temp/advancedsearch/refresh" selectionStateTitle="$:/temp/advancedsearch/selected-item" type="search" refreshTitle="$:/temp/advancedsearch/refresh" selectionStateTitle="$:/temp/advancedsearch/selected-item" type="search"
tag="input" focus={{$:/config/Search/AutoFocus}} inputCancelActions=<<cancel-search-actions>> tag="input" focus={{$:/config/Search/AutoFocus}} inputCancelActions=<<cancel-search-actions>>
inputAcceptActions=<<input-accept-actions>> inputAcceptVariantActions=<<input-accept-variant-actions>> inputAcceptActions=<<input-accept-actions>> inputAcceptVariantActions=<<input-accept-variant-actions>>
configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]"/> configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]"
filterMinLength={{$:/config/Search/MinLength}}/>
</$keyboard> </$keyboard>
</$keyboard> </$keyboard>
</$keyboard> </$keyboard>
</$keyboard> </$keyboard>
<$reveal state="$:/temp/advancedsearch/input" type="nomatch" text=""> <$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$button class="tc-btn-invisible"> <$button class="tc-btn-invisible">
<<cancel-search-actions>> <<cancel-search-actions>>
{{$:/core/images/close-button}} {{$:/core/images/close-button}}
@ -37,9 +38,9 @@ caption: {{$:/language/Search/Standard/Caption}}
</$reveal> </$reveal>
</div> </div>
<$reveal state="$:/temp/advancedsearch/input" type="nomatch" text=""> <$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$list filter="[{$:/temp/advancedsearch/input}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem"> <$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem">
<$vars userInput={{{ [[$:/temp/advancedsearch/input]get[text]] }}} configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}} searchListState="$:/temp/advancedsearch/selected-item"> <$vars userInput={{{ [[$:/temp/advancedsearch]get[text]] }}} configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}} searchListState="$:/temp/advancedsearch/selected-item">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]]" emptyMessage=""" <$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]]" emptyMessage="""
<$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]"> <$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]">
<$transclude/> <$transclude/>

View File

@ -6,7 +6,7 @@ first-search-filter: [is[system]search<userInput>sort[title]limit[250]] -[[$:/te
\define lingo-base() $:/language/Search/ \define lingo-base() $:/language/Search/
\define set-next-input-tab(beforeafter:"after",stateTitle,tag,defaultState,currentTabTiddler) <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/advanced-search-results" tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" actions="""<$action-setfield $tiddler="$:/state/advancedsearch/currentTab" text=<<nextTab>>/>"""/> \define set-next-input-tab(beforeafter:"after",stateTitle,tag,defaultState,currentTabTiddler) <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/advanced-search-results" tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" actions="""<$action-setfield $tiddler="$:/state/advancedsearch/currentTab" text=<<nextTab>>/>"""/>
\define cancel-search-actions() <$action-deletetiddler $filter="[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]" /> \define cancel-search-actions() <$list filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]" emptyMessage="""<$action-deletetiddler $filter="[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]" />"""><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/></$list><$action-sendmessage $message="tm-focus-selector" $param=""".tc-advanced-search input"""/>
\define input-accept-actions() <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> \define input-accept-actions() <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>
@ -17,11 +17,11 @@ first-search-filter: [is[system]search<userInput>sort[title]limit[250]] -[[$:/te
<div class="tc-search"> <div class="tc-search">
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>> <$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>> <$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
<$macrocall $name="keyboard-driven-input" tiddler="$:/temp/advancedsearch" storeTitle="$:/temp/advancedsearch/input" <$macrocall $name="keyboard-driven-input" tiddler="$:/temp/advancedsearch/input" storeTitle="$:/temp/advancedsearch"
refreshTitle="$:/temp/advancedsearch/refresh" selectionStateTitle="$:/temp/advancedsearch/selected-item" refreshTitle="$:/temp/advancedsearch/refresh" selectionStateTitle="$:/temp/advancedsearch/selected-item"
type="search" tag="input" focus={{$:/config/Search/AutoFocus}} configTiddlerFilter="[[$:/core/ui/AdvancedSearch/System]]" type="search" tag="input" focus={{$:/config/Search/AutoFocus}} configTiddlerFilter="[[$:/core/ui/AdvancedSearch/System]]"
inputCancelActions=<<cancel-search-actions>> inputAcceptActions=<<input-accept-actions>> inputCancelActions=<<cancel-search-actions>> inputAcceptActions=<<input-accept-actions>>
inputAcceptVariantActions=<<input-accept-variant-actions>>/> inputAcceptVariantActions=<<input-accept-variant-actions>> filterMinLength={{$:/config/Search/MinLength}}/>
</$keyboard> </$keyboard>
</$keyboard> </$keyboard>
<$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> <$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
@ -32,17 +32,17 @@ first-search-filter: [is[system]search<userInput>sort[title]limit[250]] -[[$:/te
</$reveal> </$reveal>
</div> </div>
<$reveal state="$:/temp/advancedsearch/input" type="nomatch" text=""> <$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$list filter="[{$:/temp/advancedsearch/input}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem"> <$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem">
<$set name="resultCount" value="""<$count filter="[is[system]search{$:/temp/advancedsearch/input}] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] -[[$:/temp/advancedsearch/selected-item]]"/>"""> <$set name="resultCount" value="""<$count filter="[is[system]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] -[[$:/temp/advancedsearch/selected-item]]"/>""">
<div class="tc-search-results"> <div class="tc-search-results">
<<lingo System/Matches>> <<lingo System/Matches>>
<$list filter="[is[system]search{$:/temp/advancedsearch/input}sort[title]limit[250]] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] -[[$:/temp/advancedsearch/selected-item]]"> <$list filter="[is[system]search{$:/temp/advancedsearch}sort[title]limit[250]] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] -[[$:/temp/advancedsearch/selected-item]]">
<span class={{{[<currentTiddler>addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] +[then[]else[tc-list-item-selected]] }}}> <span class={{{[<currentTiddler>addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] +[then[]else[tc-list-item-selected]] }}}>
<$transclude tiddler="$:/core/ui/ListItemTemplate"/> <$transclude tiddler="$:/core/ui/ListItemTemplate"/>
</span> </span>

View File

@ -23,12 +23,20 @@ $:/config/EditTemplateFields/Visibility/$(currentField)$
\define delete-state-tiddlers() <$action-deletetiddler $filter="[<newFieldNameTiddler>] [<storeTitle>] [<searchListState>]"/> \define delete-state-tiddlers() <$action-deletetiddler $filter="[<newFieldNameTiddler>] [<storeTitle>] [<searchListState>]"/>
\define cancel-search-actions() \define cancel-search-actions-inner()
<$list filter="[<__storeTitle__>has[text]] [<__tiddler__>has[text]]" variable="ignore" emptyMessage="""<<delete-state-tiddlers>><$action-sendmessage $message="tm-cancel-tiddler"/>"""> <$list filter="[<storeTitle>has[text]] [<newFieldNameTiddler>has[text]]" variable="ignore" emptyMessage="""<<delete-state-tiddlers>><$action-sendmessage $message="tm-cancel-tiddler"/>""">
<<delete-state-tiddlers>> <<delete-state-tiddlers>>
</$list> </$list>
\end \end
\define cancel-search-actions()
<$set name="userInput" value={{{ [<storeTitle>get[text]] }}}>
<$list filter="[<newFieldNameTiddler>get[text]!match<userInput>]" emptyMessage="""<<cancel-search-actions-inner>>""">
<$action-setfield $tiddler=<<newFieldNameTiddler>> text=<<userInput>>/><$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
</$list>
</$set>
\end
\define new-field() \define new-field()
<$vars name={{{ [<newFieldNameTiddler>get[text]] }}}> <$vars name={{{ [<newFieldNameTiddler>get[text]] }}}>
<$reveal type="nomatch" text="" default=<<name>>> <$reveal type="nomatch" text="" default=<<name>>>

View File

@ -7,7 +7,13 @@ title: $:/core/ui/EditorToolbar/link-dropdown
<$action-deletetiddler $filter="[<dropdown-state>] [<searchTiddler>] [<linkTiddler>] [<storeTitle>] [<searchListState>]"/> <$action-deletetiddler $filter="[<dropdown-state>] [<searchTiddler>] [<linkTiddler>] [<storeTitle>] [<searchListState>]"/>
\end \end
\define cancel-search-actions() <$action-deletetiddler $filter="[<searchTiddler>] [<linkTiddler>] [<storeTitle>] [<searchListState>]"/> \define get-focus-selector() [data-tiddler-title="$(cssEscapedTitle)$"] .tc-create-wikitext-link input
\define cancel-search-actions-inner()
<$set name="userInput" value={{{ [<storeTitle>get[text]] }}}><$list filter="[<searchTiddler>get[text]!match<userInput>]" emptyMessage="""<$action-deletetiddler $filter="[<searchTiddler>] [<linkTiddler>] [<storeTitle>] [<searchListState>]"/>"""><$action-setfield $tiddler=<<searchTiddler>> text=<<userInput>>/><$action-setfield $tiddler=<<refreshTitle>> text="yes"/></$list></$set>
\end
\define cancel-search-actions() <$list filter="[<storeTitle>!has[text]] +[<searchTiddler>!has[text]]" emptyMessage="""<<cancel-search-actions-inner>>"""><$action-sendmessage $message="tm-edit-text-operation" $param="wrap-selection" prefix="" suffix=""/></$list>
\define external-link() \define external-link()
<$button class="tc-btn-invisible" style="width: auto; display: inline-block; background-colour: inherit;" actions=<<add-link-actions>>> <$button class="tc-btn-invisible" style="width: auto; display: inline-block; background-colour: inherit;" actions=<<add-link-actions>>>
@ -24,9 +30,9 @@ title: $:/core/ui/EditorToolbar/link-dropdown
<$vars linkTiddler=<<searchTiddler>>> <$vars linkTiddler=<<searchTiddler>>>
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>> <$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>> <$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">> class="tc-create-wikitext-link">
<$macrocall $name="keyboard-driven-input" tiddler=<<searchTiddler>> storeTitle=<<storeTitle>> <$macrocall $name="keyboard-driven-input" tiddler=<<searchTiddler>> storeTitle=<<storeTitle>>
selectionStateTitle=<<searchListState>> refreshTitle=<<refreshTitle>> type="search" selectionStateTitle=<<searchListState>> refreshTitle=<<refreshTitle>> type="search" filterMinLength="1"
tag="input" focus="true" class="tc-popup-handle" inputCancelActions=<<cancel-search-actions>> tag="input" focus="true" class="tc-popup-handle" inputCancelActions=<<cancel-search-actions>>
inputAcceptActions=<<add-link-actions>> placeholder={{$:/language/Search/Search}} default="" inputAcceptActions=<<add-link-actions>> placeholder={{$:/language/Search/Search}} default=""
configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]" /> configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]" />
@ -35,7 +41,7 @@ title: $:/core/ui/EditorToolbar/link-dropdown
<$reveal tag="span" state=<<storeTitle>> type="nomatch" text=""> <$reveal tag="span" state=<<storeTitle>> type="nomatch" text="">
<<external-link>> <<external-link>>
<$button class="tc-btn-invisible" style="width: auto; display: inline-block; background-colour: inherit;"> <$button class="tc-btn-invisible" style="width: auto; display: inline-block; background-colour: inherit;">
<$action-setfield $tiddler=<<searchTiddler>> text="" /> <<cancel-search-actions>><$set name="cssEscapedTitle" value={{{ [<storyTiddler>escapecss[]] }}}><$action-sendmessage $message="tm-focus-selector" $param=<<get-focus-selector>>/></$set>
{{$:/core/images/close-button}} {{$:/core/images/close-button}}
</$button> </$button>
</$reveal> </$reveal>

View File

@ -2,27 +2,23 @@ title: $:/core/ui/ImportListing
\define lingo-base() $:/language/Import/ \define lingo-base() $:/language/Import/
\define messageField() \define messageField() message-$(payloadTiddler)$
message-$(payloadTiddler)$
\define payloadTitleFilter() [<currentTiddler>get<renameField>minlength[1]else<payloadTiddler>]
\define overWriteWarning()
<$text text={{{[subfilter<payloadTitleFilter>!is[tiddler]then[]] ~[<lingo-base>addsuffix[Listing/Rename/OverwriteWarning]get[text]]}}}/>
\end \end
\define selectionField() \define selectionField() selection-$(payloadTiddler)$
selection-$(payloadTiddler)$
\end
\define renameField() \define renameField() rename-$(payloadTiddler)$
rename-$(payloadTiddler)$
\end
\define newImportTitleTiddler() $:/temp/NewImportTitle-$(payloadTiddler)$ \define newImportTitleTiddler() $:/temp/NewImportTitle-$(payloadTiddler)$
\define previewPopupState() \define previewPopupState() $(currentTiddler)$!!popup-$(payloadTiddler)$
$(currentTiddler)$!!popup-$(payloadTiddler)$
\end
\define renameFieldState() \define renameFieldState() $(currentTiddler)$!!state-rename-$(payloadTiddler)$
$(currentTiddler)$!!state-rename-$(payloadTiddler)$
\end
\define select-all-actions() \define select-all-actions()
<$list filter="[all[current]plugintiddlers[]sort[title]]" variable="payloadTiddler"> <$list filter="[all[current]plugintiddlers[]sort[title]]" variable="payloadTiddler">
@ -54,13 +50,13 @@ $(currentTiddler)$!!state-rename-$(payloadTiddler)$
<$reveal type="nomatch" state=<<renameFieldState>> text="yes" tag="div"> <$reveal type="nomatch" state=<<renameFieldState>> text="yes" tag="div">
<$reveal type="nomatch" state=<<previewPopupState>> text="yes" tag="div" class="tc-flex"> <$reveal type="nomatch" state=<<previewPopupState>> text="yes" tag="div" class="tc-flex">
<$button class="tc-btn-invisible tc-btn-dropdown tc-flex-grow-1" set=<<previewPopupState>> setTo="yes"> <$button class="tc-btn-invisible tc-btn-dropdown tc-flex-grow-1" set=<<previewPopupState>> setTo="yes">
<span class="tc-small-gap-right">{{$:/core/images/right-arrow}}</span><$text text={{{[<currentTiddler>get<renameField>minlength[1]else<payloadTiddler>]}}}/> <span class="tc-small-gap-right">{{$:/core/images/right-arrow}}</span><$text text={{{[subfilter<payloadTitleFilter>]}}}/>
</$button> </$button>
<$button class="tc-btn-invisible tc-small-gap-left" set=<<renameFieldState>> setTo="yes" tooltip={{{[<lingo-base>addsuffix[Listing/Rename/Tooltip]get[text]]}}}>{{$:/core/images/edit-button}}</$button> <$button class="tc-btn-invisible tc-small-gap-left" set=<<renameFieldState>> setTo="yes" tooltip={{{[<lingo-base>addsuffix[Listing/Rename/Tooltip]get[text]]}}}>{{$:/core/images/edit-button}}</$button>
</$reveal> </$reveal>
<$reveal type="match" state=<<previewPopupState>> text="yes" tag="div"> <$reveal type="match" state=<<previewPopupState>> text="yes" tag="div">
<$button class="tc-btn-invisible tc-btn-dropdown" set=<<previewPopupState>> setTo="no"> <$button class="tc-btn-invisible tc-btn-dropdown" set=<<previewPopupState>> setTo="no">
<span class="tc-small-gap-right">{{$:/core/images/down-arrow}}</span><$text text={{{[<currentTiddler>get<renameField>minlength[1]else<payloadTiddler>]}}}/> <span class="tc-small-gap-right">{{$:/core/images/down-arrow}}</span><$text text={{{[subfilter<payloadTitleFilter>]}}}/>
</$button> </$button>
</$reveal> </$reveal>
</$reveal> </$reveal>
@ -70,12 +66,13 @@ $(currentTiddler)$!!state-rename-$(payloadTiddler)$
</td> </td>
<td> <td>
<$view field=<<messageField>>/> <$view field=<<messageField>>/>
<<overWriteWarning>>
</td> </td>
</tr> </tr>
<$reveal type="match" state=<<renameFieldState>> text="yes" tag="tr"> <$reveal type="match" state=<<renameFieldState>> text="yes" tag="tr">
<td colspan="3"> <td colspan="3">
<div class="tc-flex"> <div class="tc-flex">
<$edit-text tiddler=<<newImportTitleTiddler>> default={{{[<currentTiddler>get<renameField>minlength[1]else<payloadTiddler>]}}} tag="input" class="tc-import-rename tc-flex-grow-1"/><span class="tc-small-gap-left"><$button class="tc-btn-invisible" set=<<renameFieldState>> setTo="no" tooltip={{{[<lingo-base>addsuffix[Listing/Rename/CancelRename]get[text]]}}}>{{$:/core/images/close-button}}<$action-deletetiddler $tiddler=<<newImportTitleTiddler>>/></$button><span class="tc-small-gap-right"/></span><$button class="tc-btn-invisible" set=<<renameFieldState>> setTo="no" tooltip={{{[<lingo-base>addsuffix[Listing/Rename/ConfirmRename]get[text]]}}}>{{$:/core/images/done-button}}<$action-setfield $field=<<renameField>> $value={{{[<newImportTitleTiddler>get[text]minlength[1]else<payloadTiddler>]}}} /><$action-deletetiddler $tiddler=<<newImportTitleTiddler>>/></$button> <$edit-text tiddler=<<newImportTitleTiddler>> default={{{[subfilter<payloadTitleFilter>]}}} tag="input" class="tc-import-rename tc-flex-grow-1"/><span class="tc-small-gap-left"><$button class="tc-btn-invisible" set=<<renameFieldState>> setTo="no" tooltip={{{[<lingo-base>addsuffix[Listing/Rename/CancelRename]get[text]]}}}>{{$:/core/images/close-button}}<$action-deletetiddler $tiddler=<<newImportTitleTiddler>>/></$button><span class="tc-small-gap-right"/></span><$button class="tc-btn-invisible" set=<<renameFieldState>> setTo="no" tooltip={{{[<lingo-base>addsuffix[Listing/Rename/ConfirmRename]get[text]]}}}>{{$:/core/images/done-button}}<$action-setfield $field=<<renameField>> $value={{{[<newImportTitleTiddler>get[text]minlength[1]else<payloadTiddler>]}}} /><$action-deletetiddler $tiddler=<<newImportTitleTiddler>>/></$button>
</div> </div>
</td> </td>
</$reveal> </$reveal>
@ -91,4 +88,3 @@ $(currentTiddler)$!!state-rename-$(payloadTiddler)$
</$list> </$list>
</tbody> </tbody>
</table> </table>

View File

@ -4,5 +4,5 @@ key: ((advanced-search))
<$navigator story="$:/StoryList" history="$:/HistoryList"> <$navigator story="$:/StoryList" history="$:/HistoryList">
<$action-navigate $to="$:/AdvancedSearch"/> <$action-navigate $to="$:/AdvancedSearch"/>
<$action-sendmessage $message="tm-focus-selector" $param="""[data-tiddler-title="$:/AdvancedSearch"] .tc-search input"""/> <$action-sendmessage $message="tm-focus-selector" $param="""[data-tiddler-title="$:/AdvancedSearch"] .tc-search input""" preventScroll="true"/>
</$navigator> </$navigator>

View File

@ -0,0 +1,8 @@
title: $:/core/ui/KeyboardShortcuts/change-sidebar-layout
tags: $:/tags/KeyboardShortcut
key: ((change-sidebar-layout))
<$list filter="[{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]]"
emptyMessage="""<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/options/sidebarlayout" text="fixed-fluid"/>""">
<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/options/sidebarlayout" text="fluid-fixed"/>
</$list>

View File

@ -1,4 +1,4 @@
title: $:/core/ui/KeyboardShortcut/toggle-sidebar title: $:/core/ui/KeyboardShortcuts/toggle-sidebar
tags: $:/tags/KeyboardShortcut tags: $:/tags/KeyboardShortcut
key: ((toggle-sidebar)) key: ((toggle-sidebar))

View File

@ -32,9 +32,7 @@ tags: $:/tags/SideBarSegment
</$vars> </$vars>
\end \end
\define delete-state-tiddlers() <$action-deletetiddler $filter="[[$:/temp/search]] [<searchTiddler>] [<searchListState>]"/> \define cancel-search-actions() <$list filter="[<searchTiddler>get[text]!match{$:/temp/search}]" emptyMessage="""<$action-deletetiddler $filter="[[$:/temp/search]] [<searchTiddler>] [<searchListState>]"/>"""><$action-setfield $tiddler="$:/temp/search" text={{{ [<searchTiddler>get[text]] }}}/><$action-setfield $tiddler="$:/temp/search/refresh" text="yes"/></$list>
\define cancel-search-actions() <$action-deletetiddler $filter="[<__storeTitle__>] [<__tiddler__>] [<__selectionStateTitle__>]"/>
\define input-accept-actions() <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> \define input-accept-actions() <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>
@ -42,7 +40,7 @@ tags: $:/tags/SideBarSegment
\define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/search-results/sidebar" tag="$:/tags/SearchResults" beforeafter="$beforeafter$" defaultState={{$:/config/SearchResults/Default}} actions="""<$action-setfield $tiddler="$:/state/search/currentTab" text=<<nextTab>>/>"""/> \define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/search-results/sidebar" tag="$:/tags/SearchResults" beforeafter="$beforeafter$" defaultState={{$:/config/SearchResults/Default}} actions="""<$action-setfield $tiddler="$:/state/search/currentTab" text=<<nextTab>>/>"""/>
\define advanced-search-actions() <$action-setfield $tiddler="$:/temp/advancedsearch" text={{$:/temp/search/input}}/><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/search/input}}/><<delete-state-tiddlers>><$action-navigate $to="$:/AdvancedSearch"/> \define advanced-search-actions() <$action-setfield $tiddler="$:/temp/advancedsearch" text={{$:/temp/search/input}}/><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/search/input}}/><<delete-state-tiddlers>><$action-navigate $to="$:/AdvancedSearch"/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/><$action-sendmessage $message="tm-focus-selector" $param="""[data-tiddler-title="$:/AdvancedSearch"] .tc-search input""" preventScroll="true"/>
<div class="tc-sidebar-lists tc-sidebar-search"> <div class="tc-sidebar-lists tc-sidebar-search">
@ -66,7 +64,7 @@ tags: $:/tags/SideBarSegment
{{$:/core/images/advanced-search-button}} {{$:/core/images/advanced-search-button}}
</$button> </$button>
<$button class="tc-btn-invisible"> <$button class="tc-btn-invisible">
<<delete-state-tiddlers>> <<cancel-search-actions>><$action-sendmessage $message="tm-focus-selector" $param=".tc-search input"/>
{{$:/core/images/close-button}} {{$:/core/images/close-button}}
</$button> </$button>
<<count-popup-button>> <<count-popup-button>>

View File

@ -5,6 +5,7 @@ advanced-search: {{$:/language/Buttons/AdvancedSearch/Hint}}
advanced-search-sidebar: {{$:/language/Shortcuts/Input/AdvancedSearch/Hint}} advanced-search-sidebar: {{$:/language/Shortcuts/Input/AdvancedSearch/Hint}}
bold: {{$:/language/Buttons/Bold/Hint}} bold: {{$:/language/Buttons/Bold/Hint}}
cancel-edit-tiddler: {{$:/language/Buttons/Cancel/Hint}} cancel-edit-tiddler: {{$:/language/Buttons/Cancel/Hint}}
change-sidebar-layout: {{$:/language/Shortcuts/SidebarLayout/Hint}}
excise: {{$:/language/Buttons/Excise/Hint}} excise: {{$:/language/Buttons/Excise/Hint}}
heading-1: {{$:/language/Buttons/Heading1/Hint}} heading-1: {{$:/language/Buttons/Heading1/Hint}}
heading-2: {{$:/language/Buttons/Heading2/Hint}} heading-2: {{$:/language/Buttons/Heading2/Hint}}

View File

@ -4,6 +4,7 @@ add-field: enter
advanced-search: ctrl-shift-A advanced-search: ctrl-shift-A
advanced-search-sidebar: alt-Enter advanced-search-sidebar: alt-Enter
cancel-edit-tiddler: escape cancel-edit-tiddler: escape
change-sidebar-layout: shift-alt-Down
excise: ctrl-E excise: ctrl-E
sidebar-search: ctrl-shift-F sidebar-search: ctrl-shift-F
heading-1: ctrl-1 heading-1: ctrl-1

View File

@ -25,10 +25,10 @@ $actions$
<$list filter="[<__storeTitle__>get[text]minlength<__filterMinLength__>] [<__filterMinLength__>match[0]] +[limit[1]]" variable="ignore"> <$list filter="[<__storeTitle__>get[text]minlength<__filterMinLength__>] [<__filterMinLength__>match[0]] +[limit[1]]" variable="ignore">
<$vars userInput={{{ [<__storeTitle__>get[text]] }}} selectedItem={{{ [<__selectionStateTitle__>get[text]] }}}> <$vars userInput={{{ [<__storeTitle__>get[text]] }}} selectedItem={{{ [<__selectionStateTitle__>get[text]] }}}>
<$set name="configTiddler" value={{{ [subfilter<__configTiddlerFilter__>] }}}> <$set name="configTiddler" value={{{ [subfilter<__configTiddlerFilter__>] }}}>
<$vars primaryListFilter={{{ [<configTiddler>get[first-search-filter]] }}} secondaryListFilter={{{ [<configTiddler>get[second-search-filter]] }}}> <$vars primaryListFilter={{{ [<configTiddler>get<__firstSearchFilterField__>] }}} secondaryListFilter={{{ [<configTiddler>get<__secondSearchFilterField__>] }}}>
<$set name="filteredList" filter="[subfilter<primaryListFilter>addsuffix[-primaryList]] =[subfilter<secondaryListFilter>addsuffix[-secondaryList]]"> <$set name="filteredList" filter="[subfilter<primaryListFilter>addsuffix[-primaryList]] =[subfilter<secondaryListFilter>addsuffix[-secondaryList]]">
<$set name="nextItem" value={{{ [enlist<filteredList>$afterOrBefore$<selectedItem>] ~[enlist<filteredList>$reverse$nth[1]] }}}> <$set name="nextItem" value={{{ [enlist<filteredList>$afterOrBefore$<selectedItem>] ~[enlist<filteredList>$reverse$nth[1]] }}}>
<$list filter="[<nextItem>minlength[1]]"> <$list filter="[<nextItem>minlength[1]]" variable="ignore">
<$action-setfield $tiddler=<<__selectionStateTitle__>> text=<<nextItem>>/> <$action-setfield $tiddler=<<__selectionStateTitle__>> text=<<nextItem>>/>
<$list filter="[<__index__>match[]]"> <$list filter="[<__index__>match[]]">
<$action-setfield $tiddler=<<__tiddler__>> $field=<<__field__>> $value={{{ [<nextItem>] +[splitregexp[(?:.(?!-))+$]] }}}/> <$action-setfield $tiddler=<<__tiddler__>> $field=<<__field__>> $value={{{ [<nextItem>] +[splitregexp[(?:.(?!-))+$]] }}}/>
@ -46,7 +46,8 @@ $actions$
</$list> </$list>
\end \end
\define keyboard-driven-input(tiddler,storeTitle,field:"text",index:"",tag:"input",type,focus:"",inputAcceptActions,inputAcceptVariantActions,inputCancelActions,placeholder:"",default:"",class,focusPopup,rows,minHeight,tabindex,size,autoHeight,filterMinLength:"0",refreshTitle,selectionStateTitle,cancelPopups:"",configTiddlerFilter) \define keyboard-driven-input(tiddler,storeTitle,field:"text",index:"",tag:"input",type,focus:"",inputAcceptActions,inputAcceptVariantActions,inputCancelActions,placeholder:"",default:"",class,focusPopup,rows,minHeight,tabindex,size,autoHeight,filterMinLength:"0",refreshTitle,selectionStateTitle,cancelPopups:"",configTiddlerFilter,firstSearchFilterField:"first-search-filter",secondSearchFilterField:"second-search-filter")
\whitespace trim
<$keyboard key="((input-accept))" actions=<<__inputAcceptActions__>>> <$keyboard key="((input-accept))" actions=<<__inputAcceptActions__>>>
<$keyboard key="((input-accept-variant))" actions=<<__inputAcceptVariantActions__>>> <$keyboard key="((input-accept-variant))" actions=<<__inputAcceptVariantActions__>>>
<$keyboard key="((input-up))" actions=<<input-next-actions "before" "reverse[]">>> <$keyboard key="((input-up))" actions=<<input-next-actions "before" "reverse[]">>>

View File

@ -3,6 +3,8 @@ tags: $:/tags/Macro
first-search-filter: [tags[]!is[system]search:title<userInput>sort[]] first-search-filter: [tags[]!is[system]search:title<userInput>sort[]]
second-search-filter: [tags[]is[system]search:title<userInput>sort[]] second-search-filter: [tags[]is[system]search:title<userInput>sort[]]
\define get-tagpicker-focus-selector() [data-tiddler-title="$(currentTiddlerCSSEscaped)$"] .tc-add-tag-name input
\define delete-tag-state-tiddlers() <$action-deletetiddler $filter="[<newTagNameTiddler>] [<storeTitle>] [<tagSelectionState>]"/> \define delete-tag-state-tiddlers() <$action-deletetiddler $filter="[<newTagNameTiddler>] [<storeTitle>] [<tagSelectionState>]"/>
\define add-tag-actions(actions) \define add-tag-actions(actions)
@ -27,12 +29,20 @@ $actions$
</$button> </$button>
\end \end
\define clear-tags-actions() \define clear-tags-actions-inner()
<$list filter="[<__storeTitle__>has[text]] [<__tiddler__>has[text]]" variable="ignore" emptyMessage="""<<delete-tag-state-tiddlers>><$action-sendmessage $message="tm-cancel-tiddler"/>"""> <$list filter="[<storeTitle>has[text]] [<newTagNameTiddler>has[text]]" variable="ignore" emptyMessage="""<<delete-tag-state-tiddlers>><$action-sendmessage $message="tm-cancel-tiddler"/>""">
<<delete-tag-state-tiddlers>> <<delete-tag-state-tiddlers>>
</$list> </$list>
\end \end
\define clear-tags-actions()
<$set name="userInput" value={{{ [<storeTitle>get[text]] }}}>
<$list filter="[<newTagNameTiddler>get[text]!match<userInput>]" emptyMessage="""<<clear-tags-actions-inner>>""">
<$action-setfield $tiddler=<<newTagNameTiddler>> text=<<userInput>>/><$action-setfield $tiddler=<<refreshTitle>> text="yes"/>
</$list>
</$set>
\end
\define tag-picker-inner(actions) \define tag-picker-inner(actions)
\whitespace trim \whitespace trim
<$vars tagSelectionState=<<qualify "$:/state/selected-tag">> storeTitle=<<qualify "$:/temp/NewTagName/input">> refreshTitle=<<qualify "$:/temp/NewTagName/refresh">> nonSystemTagsFilter="[tags[]!is[system]search:title<userInput>sort[]]" systemTagsFilter="[tags[]is[system]search:title<userInput>sort[]]"> <$vars tagSelectionState=<<qualify "$:/state/selected-tag">> storeTitle=<<qualify "$:/temp/NewTagName/input">> refreshTitle=<<qualify "$:/temp/NewTagName/refresh">> nonSystemTagsFilter="[tags[]!is[system]search:title<userInput>sort[]]" systemTagsFilter="[tags[]is[system]search:title<userInput>sort[]]">
@ -50,7 +60,9 @@ $actions$
<$button set=<<newTagNameTiddler>> setTo="" class=""> <$button set=<<newTagNameTiddler>> setTo="" class="">
<$action-sendmessage $message="tm-add-tag" $param=<<tag>>/> <$action-sendmessage $message="tm-add-tag" $param=<<tag>>/>
$actions$ $actions$
<<delete-tag-state-tiddlers>> <$set name="currentTiddlerCSSEscaped" value={{{ [<currentTiddler>escapecss[]] }}}>
<<delete-tag-state-tiddlers>><$action-sendmessage $message="tm-focus-selector" $param=<<get-tagpicker-focus-selector>>/>
</$set>
{{$:/language/EditTemplate/Tags/Add/Button}} {{$:/language/EditTemplate/Tags/Add/Button}}
</$button> </$button>
</$set> </$set>

View File

@ -160,6 +160,13 @@ function runTests(wiki) {
expect(wiki.filterTiddlers("[enlist[one two three]addsuffix[!]]").join(",")).toBe("one!,two!,three!"); expect(wiki.filterTiddlers("[enlist[one two three]addsuffix[!]]").join(",")).toBe("one!,two!,three!");
}); });
it("should handle the enlist-input operator", function() {
expect(wiki.filterTiddlers("[[one two three]enlist-input[]]").join(",")).toBe("one,two,three");
expect(wiki.filterTiddlers("[[one two three]] [[four five six]] +[enlist-input[]]").join(",")).toBe("one,two,three,four,five,six");
expect(wiki.filterTiddlers("[[one two three]] [[four five six]] [[seven eight]] +[enlist-input[]]").join(",")).toBe("one,two,three,four,five,six,seven,eight");
expect(wiki.filterTiddlers("[[]] +[enlist-input[]]").join(",")).toBe("");
});
it("should handle the then and else operators", function() { it("should handle the then and else operators", function() {
expect(wiki.filterTiddlers("[modifier[JoeBloggs]then[Susi]]").join(",")).toBe("Susi"); expect(wiki.filterTiddlers("[modifier[JoeBloggs]then[Susi]]").join(",")).toBe("Susi");
expect(wiki.filterTiddlers("[!modifier[JoeBloggs]then[Susi]]").join(",")).toBe("Susi,Susi,Susi,Susi,Susi,Susi,Susi,Susi"); expect(wiki.filterTiddlers("[!modifier[JoeBloggs]then[Susi]]").join(",")).toBe("Susi,Susi,Susi,Susi,Susi,Susi,Susi,Susi");
@ -685,6 +692,17 @@ function runTests(wiki) {
expect(wiki.filterTiddlers("b a b c +[sortby[b a c b]]").join(",")).toBe("b,a,c"); expect(wiki.filterTiddlers("b a b c +[sortby[b a c b]]").join(",")).toBe("b,a,c");
}); });
it("should handle the sortan operator", function() {
expect(wiki.filterTiddlers("b a c +[sortan[]]").join(",")).toBe("a,b,c");
expect(wiki.filterTiddlers("b2 a3 a1 b1 c2 a2 c3 b3 c1 +[sortan[]]").join(",")).toBe("a1,a2,a3,b1,b2,b3,c1,c2,c3");
expect(wiki.filterTiddlers("b2 a10 c10 a1 b1 c2 a2 b10 c1 +[sortan[]]").join(",")).toBe("a1,a2,a10,b1,b2,b10,c1,c2,c10");
expect(wiki.filterTiddlers("TiddlerOne $:/TiddlerTwo [[Tiddler Three]] +[sortan[]]").join(",")).toBe("$:/TiddlerTwo,Tiddler Three,TiddlerOne");
});
it("should handle the sortan operator sorting on date fields", function() {
expect(wiki.filterTiddlers("TiddlerOne $:/TiddlerTwo [[Tiddler Three]] +[sortan[modified]]").join(",")).toBe("$:/TiddlerTwo,TiddlerOne,Tiddler Three");
});
it("should handle the slugify operator", function() { it("should handle the slugify operator", function() {
expect(wiki.filterTiddlers("[[Joe Bloggs]slugify[]]").join(",")).toBe("joe-bloggs"); expect(wiki.filterTiddlers("[[Joe Bloggs]slugify[]]").join(",")).toBe("joe-bloggs");
expect(wiki.filterTiddlers("[[Joe Bloggs2]slugify[]]").join(",")).toBe("joe-bloggs2"); expect(wiki.filterTiddlers("[[Joe Bloggs2]slugify[]]").join(",")).toBe("joe-bloggs2");

View File

@ -16,4 +16,7 @@ The additional parameters are:
|inputAcceptVariantActions |the actions that get processed when the user hits <kbd>{{$:/config/shortcuts/input-accept-variant}}</kbd> | |inputAcceptVariantActions |the actions that get processed when the user hits <kbd>{{$:/config/shortcuts/input-accept-variant}}</kbd> |
|inputCancelActions |the actions that get processed when the user hits <kbd>{{$:/config/shortcuts/input-cancel}}</kbd> | |inputCancelActions |the actions that get processed when the user hits <kbd>{{$:/config/shortcuts/input-cancel}}</kbd> |
|configTiddlerFilter |a ''filter'' that specifies the tiddler that stores the first item-filter in its <<.field first-search-filter>> field and the second item-filter in its <<.field second-search-filter>> field | |configTiddlerFilter |a ''filter'' that specifies the tiddler that stores the first item-filter in its <<.field first-search-filter>> field and the second item-filter in its <<.field second-search-filter>> field |
|firstSearchFilterField |the field of the configTiddler where the first search-filter is stored. Defaults to <<.field first-search-filter>> |
|secondSearchFilterField |the field of the configTiddler where the second search-filter is stored. Defaults to <<.field second-search-filter>> |
|filterMinLength |the minimum length of the user input after which items are filtered |

View File

@ -13,9 +13,11 @@ Listing/Preview/TextRaw: 文本 (原始)
Listing/Preview/Fields: 字段 Listing/Preview/Fields: 字段
Listing/Preview/Diff: 差异 Listing/Preview/Diff: 差异
Listing/Preview/DiffFields: 差异 (字段) Listing/Preview/DiffFields: 差异 (字段)
Listing/Rename/Prompt: 重新命名为:
Listing/Rename/Tooltip: 导入前重新命名条目 Listing/Rename/Tooltip: 导入前重新命名条目
Listing/Rename/ConfirmRename : 重新命名条目 Listing/Rename/ConfirmRename: 重新命名条目
Listing/Rename/CancelRename : 取消 Listing/Rename/CancelRename: 取消
Listing/Rename/OverwriteWarning: 具有此标题的条目已存在。
Upgrader/Plugins/Suppressed/Incompatible: 封锁的不兼容或过时插件 Upgrader/Plugins/Suppressed/Incompatible: 封锁的不兼容或过时插件
Upgrader/Plugins/Suppressed/Version: 封锁的插件 (由于传入的 <<incoming>> 较现有版本 <<existing>> 旧) Upgrader/Plugins/Suppressed/Version: 封锁的插件 (由于传入的 <<incoming>> 较现有版本 <<existing>> 旧)
Upgrader/Plugins/Upgraded: 升级插件,从 <<incoming>> 到 <<upgraded>> Upgrader/Plugins/Upgraded: 升级插件,从 <<incoming>> 到 <<upgraded>>

View File

@ -72,6 +72,7 @@ Shortcuts/Input/Down/Hint: 选择下一个项目
Shortcuts/Input/Tab-Left/Hint: 选择上一个页签 Shortcuts/Input/Tab-Left/Hint: 选择上一个页签
Shortcuts/Input/Tab-Right/Hint: 选择下一个页签 Shortcuts/Input/Tab-Right/Hint: 选择下一个页签
Shortcuts/Input/Up/Hint: 选择前一个项目 Shortcuts/Input/Up/Hint: 选择前一个项目
Shortcuts/SidebarLayout/Hint: 更改侧边栏布局
SystemTiddler/Tooltip: 此为系统条目 SystemTiddler/Tooltip: 此为系统条目
SystemTiddlers/Include/Prompt: 包括系统条目 SystemTiddlers/Include/Prompt: 包括系统条目
TagManager/Colour/Heading: 颜色 TagManager/Colour/Heading: 颜色

View File

@ -13,9 +13,11 @@ Listing/Preview/TextRaw: 文字 (原始)
Listing/Preview/Fields: 欄位 Listing/Preview/Fields: 欄位
Listing/Preview/Diff: 差異 Listing/Preview/Diff: 差異
Listing/Preview/DiffFields: 差異 (欄位) Listing/Preview/DiffFields: 差異 (欄位)
Listing/Rename/Prompt: 重新命名為:
Listing/Rename/Tooltip: 導入前重新命名條目 Listing/Rename/Tooltip: 導入前重新命名條目
Listing/Rename/ConfirmRename : 重新命名條目 Listing/Rename/ConfirmRename: 重新命名條目
Listing/Rename/CancelRename : 取消 Listing/Rename/CancelRename: 取消
Listing/Rename/OverwriteWarning: 具有此標題的條目已存在。
Upgrader/Plugins/Suppressed/Incompatible: 封鎖的不相容或過時插件 Upgrader/Plugins/Suppressed/Incompatible: 封鎖的不相容或過時插件
Upgrader/Plugins/Suppressed/Version: 封鎖的插件 (由於傳入的 <<incoming>> 較現有版本 <<existing>> 舊) Upgrader/Plugins/Suppressed/Version: 封鎖的插件 (由於傳入的 <<incoming>> 較現有版本 <<existing>> 舊)
Upgrader/Plugins/Upgraded: 升級插件,從 <<incoming>> 到 <<upgraded>> Upgrader/Plugins/Upgraded: 升級插件,從 <<incoming>> 到 <<upgraded>>

View File

@ -72,6 +72,7 @@ Shortcuts/Input/Down/Hint: 選擇下一個項目
Shortcuts/Input/Tab-Left/Hint: 選擇上一個頁籤 Shortcuts/Input/Tab-Left/Hint: 選擇上一個頁籤
Shortcuts/Input/Tab-Right/Hint: 選擇下一個頁籤 Shortcuts/Input/Tab-Right/Hint: 選擇下一個頁籤
Shortcuts/Input/Up/Hint: 選擇前一個項目 Shortcuts/Input/Up/Hint: 選擇前一個項目
Shortcuts/SidebarLayout/Hint: 更改側邊欄版面
SystemTiddler/Tooltip: 此為系統條目 SystemTiddler/Tooltip: 此為系統條目
SystemTiddlers/Include/Prompt: 包括系統條目 SystemTiddlers/Include/Prompt: 包括系統條目
TagManager/Colour/Heading: 顏色 TagManager/Colour/Heading: 顏色

View File

@ -1,3 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others // CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE // Distributed under an MIT license: https://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var r=/[\w$]+/;e.registerHelper("hint","anyword",function(t,o){for(var i=o&&o.word||r,n=o&&o.range||500,f=t.getCursor(),s=t.getLine(f.line),a=f.ch,c=a;c&&i.test(s.charAt(c-1));)--c;for(var l=c!=a&&s.slice(c,a),d=o&&o.list||[],u={},p=new RegExp(i.source,"g"),g=-1;g<=1;g+=2)for(var h=f.line,m=Math.min(Math.max(h+g*n,t.firstLine()),t.lastLine())+g;h!=m;h+=g)for(var y,b=t.getLine(h);y=p.exec(b);)h==f.line&&y[0]===l||l&&0!=y[0].lastIndexOf(l,0)||Object.prototype.hasOwnProperty.call(u,y[0])||(u[y[0]]=!0,d.push(y[0]));return{list:d,from:e.Pos(f.line,c),to:e.Pos(f.line,a)}})}); !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(y){"use strict";var b=/[\w$]+/;y.registerHelper("hint","anyword",function(e,r){for(var t=r&&r.word||b,o=r&&r.range||500,i=e.getCursor(),n=e.getLine(i.line),f=i.ch,s=f;s&&t.test(n.charAt(s-1));)--s;for(var a=s!=f&&n.slice(s,f),c=r&&r.list||[],l={},d=new RegExp(t.source,"g"),u=-1;u<=1;u+=2)for(var p=i.line,g=Math.min(Math.max(p+u*o,e.firstLine()),e.lastLine())+u;p!=g;p+=u)for(var h,m=e.getLine(p);h=d.exec(m);)p==i.line&&h[0]===a||a&&0!=h[0].lastIndexOf(a,0)||Object.prototype.hasOwnProperty.call(l,h[0])||(l[h[0]]=!0,c.push(h[0]));return{list:c,from:y.Pos(i.line,s),to:y.Pos(i.line,f)}})});

View File

@ -1,3 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others // CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE // Distributed under an MIT license: https://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../../mode/css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/css/css"],e):e(CodeMirror)}(function(e){"use strict";var r={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};e.registerHelper("hint","css",function(t){var o=t.getCursor(),s=t.getTokenAt(o),i=e.innerMode(t.getMode(),s.state);if("css"==i.mode.name){if("keyword"==s.type&&0=="!important".indexOf(s.string))return{list:["!important"],from:e.Pos(o.line,s.start),to:e.Pos(o.line,s.end)};var n=s.start,a=o.ch,d=s.string.slice(0,a-n);/[^\w$_-]/.test(d)&&(d="",n=a=o.ch);var c=e.resolveMode("text/css"),f=[],l=i.state.state;return"pseudo"==l||"variable-3"==s.type?p(r):"block"==l||"maybeprop"==l?p(c.propertyKeywords):"prop"==l||"parens"==l||"at"==l||"params"==l?(p(c.valueKeywords),p(c.colorKeywords)):"media"!=l&&"media_parens"!=l||(p(c.mediaTypes),p(c.mediaFeatures)),f.length?{list:f,from:e.Pos(o.line,n),to:e.Pos(o.line,a)}:void 0}function p(e){for(var r in e)d&&0!=r.lastIndexOf(d,0)||f.push(r)}})}); !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../../mode/css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/css/css"],e):e(CodeMirror)}(function(f){"use strict";var p={active:1,after:1,before:1,checked:1,default:1,disabled:1,empty:1,enabled:1,"first-child":1,"first-letter":1,"first-line":1,"first-of-type":1,focus:1,hover:1,"in-range":1,indeterminate:1,invalid:1,lang:1,"last-child":1,"last-of-type":1,link:1,not:1,"nth-child":1,"nth-last-child":1,"nth-last-of-type":1,"nth-of-type":1,"only-of-type":1,"only-child":1,optional:1,"out-of-range":1,placeholder:1,"read-only":1,"read-write":1,required:1,root:1,selection:1,target:1,valid:1,visited:1};f.registerHelper("hint","css",function(e){var t=e.getCursor(),r=e.getTokenAt(t),o=f.innerMode(e.getMode(),r.state);if("css"==o.mode.name){if("keyword"==r.type&&0=="!important".indexOf(r.string))return{list:["!important"],from:f.Pos(t.line,r.start),to:f.Pos(t.line,r.end)};var i=r.start,s=t.ch,n=r.string.slice(0,s-i);/[^\w$_-]/.test(n)&&(n="",i=s=t.ch);var a=f.resolveMode("text/css"),d=[],l=o.state.state;return"pseudo"==l||"variable-3"==r.type?c(p):"block"==l||"maybeprop"==l?c(a.propertyKeywords):"prop"==l||"parens"==l||"at"==l||"params"==l?(c(a.valueKeywords),c(a.colorKeywords)):"media"!=l&&"media_parens"!=l||(c(a.mediaTypes),c(a.mediaFeatures)),d.length?{list:d,from:f.Pos(t.line,i),to:f.Pos(t.line,s)}:void 0}function c(e){for(var t in e)n&&0!=t.lastIndexOf(n,0)||d.push(t)}})});

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others // CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE // Distributed under an MIT license: https://codemirror.net/LICENSE
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){var e=t.Pos;function r(t,e){for(var r=0,n=t.length;r<n;++r)e(t[r])}function n(n,i,l,f){var c=n.getCursor(),p=l(n,c);if(!/\b(?:string|comment)\b/.test(p.type)){var u=t.innerMode(n.getMode(),p.state);if("json"!==u.mode.helperType){p.state=u.state,/^[\w$_]*$/.test(p.string)?p.end>c.ch&&(p.end=c.ch,p.string=p.string.slice(0,c.ch-p.start)):p={start:c.ch,end:c.ch,string:"",state:p.state,type:"."==p.string?"property":null};for(var d=p;"property"==d.type;){if("."!=(d=l(n,e(c.line,d.start))).string)return;if(d=l(n,e(c.line,d.start)),!g)var g=[];g.push(d)}return{list:function(t,e,n,i){var l=[],f=t.string,c=i&&i.globalScope||window;function p(t){0!=t.lastIndexOf(f,0)||function(t,e){if(!Array.prototype.indexOf){for(var r=t.length;r--;)if(t[r]===e)return!0;return!1}return-1!=t.indexOf(e)}(l,t)||l.push(t)}function u(t){"string"==typeof t?r(o,p):t instanceof Array?r(s,p):t instanceof Function&&r(a,p),function(t,e){if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(var r=t;r;r=Object.getPrototypeOf(r))Object.getOwnPropertyNames(r).forEach(e);else for(var n in t)e(n)}(t,p)}if(e&&e.length){var d,g=e.pop();for(g.type&&0===g.type.indexOf("variable")?(i&&i.additionalContext&&(d=i.additionalContext[g.string]),i&&!1===i.useGlobalScope||(d=d||c[g.string])):"string"==g.type?d="":"atom"==g.type?d=1:"function"==g.type&&(null==c.jQuery||"$"!=g.string&&"jQuery"!=g.string||"function"!=typeof c.jQuery?null!=c._&&"_"==g.string&&"function"==typeof c._&&(d=c._()):d=c.jQuery());null!=d&&e.length;)d=d[e.pop().string];null!=d&&u(d)}else{for(var y=t.state.localVars;y;y=y.next)p(y.name);for(var y=t.state.globalVars;y;y=y.next)p(y.name);i&&!1===i.useGlobalScope||u(c),r(n,p)}return l}(p,g,i,f),from:e(c.line,p.start),to:e(c.line,p.end)}}}}function i(t,e){var r=t.getTokenAt(e);return e.ch==r.start+1&&"."==r.string.charAt(0)?(r.end=r.start,r.string=".",r.type="property"):/^\.[\w$_]*$/.test(r.string)&&(r.type="property",r.start++,r.string=r.string.replace(/\./,"")),r}t.registerHelper("hint","javascript",function(t,e){return n(t,l,function(t,e){return t.getTokenAt(e)},e)}),t.registerHelper("hint","coffeescript",function(t,e){return n(t,f,i,e)});var o="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),s="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),a="prototype apply call bind".split(" "),l="break case catch class const continue debugger default delete do else export extends false finally for function if in import instanceof new null return super switch this throw true try typeof var void while with yield".split(" "),f="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ")}); !function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(f){var c=f.Pos;function g(t,e){for(var r=0,n=t.length;r<n;++r)e(t[r])}function r(t,e,r,n){var i=t.getCursor(),o=r(t,i);if(!/\b(?:string|comment)\b/.test(o.type)){var s=f.innerMode(t.getMode(),o.state);if("json"!==s.mode.helperType){o.state=s.state,/^[\w$_]*$/.test(o.string)?o.end>i.ch&&(o.end=i.ch,o.string=o.string.slice(0,i.ch-o.start)):o={start:i.ch,end:i.ch,string:"",state:o.state,type:"."==o.string?"property":null};for(var a=o;"property"==a.type;){if("."!=(a=r(t,c(i.line,a.start))).string)return;a=r(t,c(i.line,a.start));var l=l||[];l.push(a)}return{list:function(t,e,r,n){var i=[],o=t.string,s=n&&n.globalScope||window;function a(t){0!=t.lastIndexOf(o,0)||function(t,e){if(Array.prototype.indexOf)return-1!=t.indexOf(e);for(var r=t.length;r--;)if(t[r]===e)return 1}(i,t)||i.push(t)}function l(t){"string"==typeof t?g(y,a):t instanceof Array?g(h,a):t instanceof Function&&g(v,a),function(t,e){if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(var r=t;r;r=Object.getPrototypeOf(r))Object.getOwnPropertyNames(r).forEach(e);else for(var n in t)e(n)}(t,a)}if(e&&e.length){var f,c=e.pop();for(c.type&&0===c.type.indexOf("variable")?(n&&n.additionalContext&&(f=n.additionalContext[c.string]),n&&!1===n.useGlobalScope||(f=f||s[c.string])):"string"==c.type?f="":"atom"==c.type?f=1:"function"==c.type&&(null==s.jQuery||"$"!=c.string&&"jQuery"!=c.string||"function"!=typeof s.jQuery?null!=s._&&"_"==c.string&&"function"==typeof s._&&(f=s._()):f=s.jQuery());null!=f&&e.length;)f=f[e.pop().string];null!=f&&l(f)}else{for(var p=t.state.localVars;p;p=p.next)a(p.name);for(var u=t.state.context;u;u=u.prev)for(p=u.vars;p;p=p.next)a(p.name);for(p=t.state.globalVars;p;p=p.next)a(p.name);if(n&&null!=n.additionalContext)for(var d in n.additionalContext)a(d);n&&!1===n.useGlobalScope||l(s),g(r,a)}return i}(o,l,e,n),from:c(i.line,o.start),to:c(i.line,o.end)}}}}function n(t,e){var r=t.getTokenAt(e);return e.ch==r.start+1&&"."==r.string.charAt(0)?(r.end=r.start,r.string=".",r.type="property"):/^\.[\w$_]*$/.test(r.string)&&(r.type="property",r.start++,r.string=r.string.replace(/\./,"")),r}f.registerHelper("hint","javascript",function(t,e){return r(t,i,function(t,e){return t.getTokenAt(e)},e)}),f.registerHelper("hint","coffeescript",function(t,e){return r(t,o,n,e)});var y="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),h="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),v="prototype apply call bind".split(" "),i="break case catch class const continue debugger default delete do else export extends false finally for function if in import instanceof new null return super switch this throw true try typeof var void while with yield".split(" "),o="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ")});

View File

@ -1,6 +1,6 @@
.CodeMirror-hints { .CodeMirror-hints {
position: absolute; position: absolute;
z-index: 999; z-index: 10;
overflow: hidden; overflow: hidden;
list-style: none; list-style: none;

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others // CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE // Distributed under an MIT license: https://codemirror.net/LICENSE
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";var e=t.Pos;t.registerHelper("hint","xml",function(r,s){var n=s&&s.schemaInfo,a=s&&s.quoteChar||'"';if(n){var i=r.getCursor(),o=r.getTokenAt(i);o.end>i.ch&&(o.end=i.ch,o.string=o.string.slice(0,i.ch-o.start));var l=t.innerMode(r.getMode(),o.state);if("xml"==l.mode.name){var f,g,c=[],h=!1,p=/\btag\b/.test(o.type)&&!/>$/.test(o.string),u=p&&/^\w/.test(o.string);if(u){var d=r.getLine(i.line).slice(Math.max(0,o.start-2),o.start),m=/<\/$/.test(d)?"close":/<$/.test(d)?"open":null;m&&(g=o.start-("close"==m?2:1))}else p&&"<"==o.string?m="open":p&&"</"==o.string&&(m="close");if(!p&&!l.state.tagName||m){u&&(f=o.string),h=m;var v=l.state.context,y=v&&n[v.tagName],x=v?y&&y.children:n["!top"];if(x&&"close"!=m)for(var O=0;O<x.length;++O)f&&0!=x[O].lastIndexOf(f,0)||c.push("<"+x[O]);else if("close"!=m)for(var b in n)!n.hasOwnProperty(b)||"!top"==b||"!attrs"==b||f&&0!=b.lastIndexOf(f,0)||c.push("<"+b);v&&(!f||"close"==m&&0==v.tagName.lastIndexOf(f,0))&&c.push("</"+v.tagName+">")}else{var w=(y=n[l.state.tagName])&&y.attrs,I=n["!attrs"];if(!w&&!I)return;if(w){if(I){var P={};for(var A in I)I.hasOwnProperty(A)&&(P[A]=I[A]);for(var A in w)w.hasOwnProperty(A)&&(P[A]=w[A]);w=P}}else w=I;if("string"==o.type||"="==o.string){var M,N=(d=r.getRange(e(i.line,Math.max(0,i.ch-60)),e(i.line,"string"==o.type?o.start:o.end))).match(/([^\s\u00a0=<>\"\']+)=$/);if(!N||!w.hasOwnProperty(N[1])||!(M=w[N[1]]))return;if("function"==typeof M&&(M=M.call(this,r)),"string"==o.type){f=o.string;var $=0;/['"]/.test(o.string.charAt(0))&&(a=o.string.charAt(0),f=o.string.slice(1),$++);var C=o.string.length;/['"]/.test(o.string.charAt(C-1))&&(a=o.string.charAt(C-1),f=o.string.substr($,C-2)),h=!0}for(O=0;O<M.length;++O)f&&0!=M[O].lastIndexOf(f,0)||c.push(a+M[O]+a)}else for(var j in"attribute"==o.type&&(f=o.string,h=!0),w)!w.hasOwnProperty(j)||f&&0!=j.lastIndexOf(f,0)||c.push(j)}return{list:c,from:h?e(i.line,null==g?o.start:g):i,to:h?e(i.line,o.end):i}}}})}); !function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(H){"use strict";var R=H.Pos;function z(t,e,r){return r?0<=t.indexOf(e):0==t.lastIndexOf(e,0)}H.registerHelper("hint","xml",function(t,e){var r=e&&e.schemaInfo,n=e&&e.quoteChar||'"',s=e&&e.matchInMiddle;if(r){var i=t.getCursor(),o=t.getTokenAt(i);if(o.end>i.ch&&(o.end=i.ch,o.string=o.string.slice(0,i.ch-o.start)),(p=H.innerMode(t.getMode(),o.state)).mode.xmlCurrentTag){var a,l,g,c=[],f=!1,h=/\btag\b/.test(o.type)&&!/>$/.test(o.string),u=h&&/^\w/.test(o.string);u?(M=t.getLine(i.line).slice(Math.max(0,o.start-2),o.start),(g=/<\/$/.test(M)?"close":/<$/.test(M)?"open":null)&&(l=o.start-("close"==g?2:1))):h&&"<"==o.string?g="open":h&&"</"==o.string&&(g="close");var d=p.mode.xmlCurrentTag(p.state);if(!h&&!d||g){u&&(a=o.string),f=g;var p,m=p.mode.xmlCurrentContext?p.mode.xmlCurrentContext(p.state):[],v=(p=m.length&&m[m.length-1])&&r[p],y=p?v&&v.children:r["!top"];if(y&&"close"!=g)for(var x=0;x<y.length;++x)a&&!z(y[x],a,s)||c.push("<"+y[x]);else if("close"!=g)for(var C in r)!r.hasOwnProperty(C)||"!top"==C||"!attrs"==C||a&&!z(C,a,s)||c.push("<"+C);p&&(!a||"close"==g&&z(p,a,s))&&c.push("</"+p+">")}else{var b=(v=d&&r[d.name])&&v.attrs,O=r["!attrs"];if(!b&&!O)return;if(b){if(O){var w={};for(var A in O)O.hasOwnProperty(A)&&(w[A]=O[A]);for(var A in b)b.hasOwnProperty(A)&&(w[A]=b[A]);b=w}}else b=O;if("string"==o.type||"="==o.string){var M,P,$,I,T,j=(M=t.getRange(R(i.line,Math.max(0,i.ch-60)),R(i.line,"string"==o.type?o.start:o.end))).match(/([^\s\u00a0=<>\"\']+)=$/);if(!j||!b.hasOwnProperty(j[1])||!(P=b[j[1]]))return;"function"==typeof P&&(P=P.call(this,t)),"string"==o.type&&(a=o.string,$=0,/['"]/.test(o.string.charAt(0))&&(n=o.string.charAt(0),a=o.string.slice(1),$++),I=o.string.length,/['"]/.test(o.string.charAt(I-1))&&(n=o.string.charAt(I-1),a=o.string.substr($,I-2)),!$||(T=t.getLine(i.line)).length>o.end&&T.charAt(o.end)==n&&o.end++,f=!0);var q=function(t){if(t)for(var e=0;e<t.length;++e)a&&!z(t[e],a,s)||c.push(n+t[e]+n);return k()};return P&&P.then?P.then(q):q(P)}for(var L in"attribute"==o.type&&(a=o.string,f=!0),b)!b.hasOwnProperty(L)||a&&!z(L,a,s)||c.push(L)}return k()}}function k(){return{list:c,from:f?R(i.line,null==l?o.start:l):i,to:f?R(i.line,o.end):i}}})});

View File

@ -1,3 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others // CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE // Distributed under an MIT license: https://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){var t={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},r=e.Pos;function n(e,r){return"pairs"==r&&"string"==typeof e?e:"object"==typeof e&&null!=e[r]?e[r]:t[r]}e.defineOption("autoCloseBrackets",!1,function(t,r,o){o&&o!=e.Init&&(t.removeKeyMap(i),t.state.closeBrackets=null),r&&(a(n(r,"pairs")),t.state.closeBrackets=r,t.addKeyMap(i))});var i={Backspace:function(t){var i=s(t);if(!i||t.getOption("disableInput"))return e.Pass;for(var a=n(i,"pairs"),o=t.listSelections(),c=0;c<o.length;c++){if(!o[c].empty())return e.Pass;var f=l(t,o[c].head);if(!f||a.indexOf(f)%2!=0)return e.Pass}for(var c=o.length-1;c>=0;c--){var h=o[c].head;t.replaceRange("",r(h.line,h.ch-1),r(h.line,h.ch+1),"+delete")}},Enter:function(t){var r=s(t),i=r&&n(r,"explode");if(!i||t.getOption("disableInput"))return e.Pass;for(var a=t.listSelections(),o=0;o<a.length;o++){if(!a[o].empty())return e.Pass;var c=l(t,a[o].head);if(!c||i.indexOf(c)%2!=0)return e.Pass}t.operation(function(){var e=t.lineSeparator()||"\n";t.replaceSelection(e+e,null),t.execCommand("goCharLeft"),a=t.listSelections();for(var r=0;r<a.length;r++){var n=a[r].head.line;t.indentLine(n,null,!0),t.indentLine(n+1,null,!0)}})}};function a(e){for(var t=0;t<e.length;t++){var r=e.charAt(t),n="'"+r+"'";i[n]||(i[n]=o(r))}}function o(t){return function(i){return function(t,i){var a=s(t);if(!a||t.getOption("disableInput"))return e.Pass;var o=n(a,"pairs"),l=o.indexOf(i);if(-1==l)return e.Pass;for(var c,f=n(a,"triples"),h=o.charAt(l+1)==i,d=t.listSelections(),u=l%2==0,g=0;g<d.length;g++){var p,v=d[g],m=v.head,b=t.getRange(m,r(m.line,m.ch+1));if(u&&!v.empty())p="surround";else if(!h&&u||b!=i)if(h&&m.ch>1&&f.indexOf(i)>=0&&t.getRange(r(m.line,m.ch-2),m)==i+i){if(m.ch>2&&/\bstring/.test(t.getTokenTypeAt(r(m.line,m.ch-2))))return e.Pass;p="addFour"}else if(h){var C=0==m.ch?" ":t.getRange(r(m.line,m.ch-1),m);if(e.isWordChar(b)||C==i||e.isWordChar(C))return e.Pass;p="both"}else{if(!u||!(t.getLine(m.line).length==m.ch||(x=b,P=o,void 0,k=P.lastIndexOf(x),k>-1&&k%2==1)||/\s/.test(b)))return e.Pass;p="both"}else p=!h||(S=m,void 0,O=(y=t).getTokenAt(r(S.line,S.ch+1)),!/\bstring/.test(O.type)||O.start!=S.ch||0!=S.ch&&/\bstring/.test(y.getTokenTypeAt(S)))?f.indexOf(i)>=0&&t.getRange(m,r(m.line,m.ch+3))==i+i+i?"skipThree":"skip":"both";if(c){if(c!=p)return e.Pass}else c=p}var x,P,k;var y,S,O;var R=l%2?o.charAt(l-1):i,A=l%2?i:o.charAt(l+1);t.operation(function(){if("skip"==c)t.execCommand("goCharRight");else if("skipThree"==c)for(var n=0;n<3;n++)t.execCommand("goCharRight");else if("surround"==c){for(var i=t.getSelections(),n=0;n<i.length;n++)i[n]=R+i[n]+A;t.replaceSelections(i,"around"),i=t.listSelections().slice();for(var n=0;n<i.length;n++)i[n]=(a=i[n],void 0,o=e.cmpPos(a.anchor,a.head)>0,{anchor:new r(a.anchor.line,a.anchor.ch+(o?-1:1)),head:new r(a.head.line,a.head.ch+(o?1:-1))});t.setSelections(i)}else"both"==c?(t.replaceSelection(R+A,null),t.triggerElectric(R+A),t.execCommand("goCharLeft")):"addFour"==c&&(t.replaceSelection(R+R+R+R,"before"),t.execCommand("goCharRight"));var a,o})}(i,t)}}function s(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function l(e,t){var n=e.getRange(r(t.line,t.ch-1),r(t.line,t.ch+1));return 2==n.length?n:null}a(t.pairs+"`")}); !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(C){var r={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},x=C.Pos;function P(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:r[t]}C.defineOption("autoCloseBrackets",!1,function(e,t,r){r&&r!=C.Init&&(e.removeKeyMap(i),e.state.closeBrackets=null),t&&(n(P(t,"pairs")),e.state.closeBrackets=t,e.addKeyMap(i))});var i={Backspace:function(e){var t=k(e);if(!t||e.getOption("disableInput"))return C.Pass;for(var r=P(t,"pairs"),n=e.listSelections(),i=0;i<n.length;i++){if(!n[i].empty())return C.Pass;var a=s(e,n[i].head);if(!a||r.indexOf(a)%2!=0)return C.Pass}for(i=n.length-1;0<=i;i--){var o=n[i].head;e.replaceRange("",x(o.line,o.ch-1),x(o.line,o.ch+1),"+delete")}},Enter:function(n){var e=k(n),t=e&&P(e,"explode");if(!t||n.getOption("disableInput"))return C.Pass;for(var i=n.listSelections(),r=0;r<i.length;r++){if(!i[r].empty())return C.Pass;var a=s(n,i[r].head);if(!a||t.indexOf(a)%2!=0)return C.Pass}n.operation(function(){var e=n.lineSeparator()||"\n";n.replaceSelection(e+e,null),n.execCommand("goCharLeft"),i=n.listSelections();for(var t=0;t<i.length;t++){var r=i[t].head.line;n.indentLine(r,null,!0),n.indentLine(r+1,null,!0)}})}};function n(e){for(var t=0;t<e.length;t++){var r=e.charAt(t),n="'"+r+"'";i[n]||(i[n]=function(t){return function(e){return function(i,e){var t=k(i);if(!t||i.getOption("disableInput"))return C.Pass;var r=P(t,"pairs"),n=r.indexOf(e);if(-1==n)return C.Pass;for(var a,o=P(t,"closeBefore"),s=P(t,"triples"),l=r.charAt(n+1)==e,c=i.listSelections(),f=n%2==0,h=0;h<c.length;h++){var u,d=c[h],p=d.head,g=i.getRange(p,x(p.line,p.ch+1));if(f&&!d.empty())u="surround";else if(!l&&f||g!=e)if(l&&1<p.ch&&0<=s.indexOf(e)&&i.getRange(x(p.line,p.ch-2),p)==e+e){if(2<p.ch&&/\bstring/.test(i.getTokenTypeAt(x(p.line,p.ch-2))))return C.Pass;u="addFour"}else if(l){var v=0==p.ch?" ":i.getRange(x(p.line,p.ch-1),p);if(C.isWordChar(g)||v==e||C.isWordChar(v))return C.Pass;u="both"}else{if(!f||!(0===g.length||/\s/.test(g)||-1<o.indexOf(g)))return C.Pass;u="both"}else u=l&&function(e,t){var r=e.getTokenAt(x(t.line,t.ch+1));return/\bstring/.test(r.type)&&r.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}(i,p)?"both":0<=s.indexOf(e)&&i.getRange(p,x(p.line,p.ch+3))==e+e+e?"skipThree":"skip";if(a){if(a!=u)return C.Pass}else a=u}var m=n%2?r.charAt(n-1):e,b=n%2?e:r.charAt(n+1);i.operation(function(){if("skip"==a)i.execCommand("goCharRight");else if("skipThree"==a)for(var e=0;e<3;e++)i.execCommand("goCharRight");else if("surround"==a){for(var t=i.getSelections(),e=0;e<t.length;e++)t[e]=m+t[e]+b;i.replaceSelections(t,"around"),t=i.listSelections().slice();for(e=0;e<t.length;e++)t[e]=(r=t[e],n=0<C.cmpPos(r.anchor,r.head),{anchor:new x(r.anchor.line,r.anchor.ch+(n?-1:1)),head:new x(r.head.line,r.head.ch+(n?1:-1))});i.setSelections(t)}else"both"==a?(i.replaceSelection(m+b,null),i.triggerElectric(m+b),i.execCommand("goCharLeft")):"addFour"==a&&(i.replaceSelection(m+m+m+m,"before"),i.execCommand("goCharRight"));var r,n})}(e,t)}}(r))}}function k(e){var t=e.state.closeBrackets;return t&&!t.override&&e.getModeAt(e.getCursor()).closeBrackets||t}function s(e,t){var r=e.getRange(x(t.line,t.ch-1),x(t.line,t.ch+1));return 2==r.length?r:null}n(r.pairs+"`")});

View File

@ -1,3 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others // CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE // Distributed under an MIT license: https://codemirror.net/LICENSE
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){var e=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=t.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function i(t,e,i){var c=t.getLineHandle(e.line),o=e.ch-1,l=i&&i.afterCursor;null==l&&(l=/(^| )cm-fat-cursor($| )/.test(t.getWrapperElement().className));var h=!l&&o>=0&&r[c.text.charAt(o)]||r[c.text.charAt(++o)];if(!h)return null;var s=">"==h.charAt(1)?1:-1;if(i&&i.strict&&s>0!=(o==e.ch))return null;var u=t.getTokenTypeAt(n(e.line,o+1)),f=a(t,n(e.line,o+(s>0?1:0)),s,u||null,i);return null==f?null:{from:n(e.line,o),to:f&&f.pos,match:f&&f.ch==h.charAt(0),forward:s>0}}function a(t,e,i,a,c){for(var o=c&&c.maxScanLineLength||1e4,l=c&&c.maxScanLines||1e3,h=[],s=c&&c.bracketRegex?c.bracketRegex:/[(){}[\]]/,u=i>0?Math.min(e.line+l,t.lastLine()+1):Math.max(t.firstLine()-1,e.line-l),f=e.line;f!=u;f+=i){var m=t.getLine(f);if(m){var g=i>0?0:m.length-1,d=i>0?m.length:-1;if(!(m.length>o))for(f==e.line&&(g=e.ch-(i<0?1:0));g!=d;g+=i){var k=m.charAt(g);if(s.test(k)&&(void 0===a||t.getTokenTypeAt(n(f,g+1))==a))if(">"==r[k].charAt(1)==i>0)h.push(k);else{if(!h.length)return{pos:n(f,g),ch:k};h.pop()}}}}return f-i!=(i>0?t.lastLine():t.firstLine())&&null}function c(t,r,a){for(var c=t.state.matchBrackets.maxHighlightLineLength||1e3,o=[],l=t.listSelections(),h=0;h<l.length;h++){var s=l[h].empty()&&i(t,l[h].head,a);if(s&&t.getLine(s.from.line).length<=c){var u=s.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";o.push(t.markText(s.from,n(s.from.line,s.from.ch+1),{className:u})),s.to&&t.getLine(s.to.line).length<=c&&o.push(t.markText(s.to,n(s.to.line,s.to.ch+1),{className:u}))}}if(o.length){e&&t.state.focused&&t.focus();var f=function(){t.operation(function(){for(var t=0;t<o.length;t++)o[t].clear()})};if(!r)return f;setTimeout(f,800)}}function o(t){t.operation(function(){t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null),t.state.matchBrackets.currentlyHighlighted=c(t,!1,t.state.matchBrackets)})}t.defineOption("matchBrackets",!1,function(e,n,r){r&&r!=t.Init&&(e.off("cursorActivity",o),e.state.matchBrackets&&e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null)),n&&(e.state.matchBrackets="object"==typeof n?n:{},e.on("cursorActivity",o))}),t.defineExtension("matchBrackets",function(){c(this,!0)}),t.defineExtension("findMatchingBracket",function(t,e,n){return(n||"boolean"==typeof e)&&(n?(n.strict=e,e=n):e=e?{strict:!0}:null),i(this,t,e)}),t.defineExtension("scanForBracket",function(t,e,n,r){return a(this,t,e,n,r)})}); !function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(i){var h=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),k=i.Pos,p={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function v(t){return t&&t.bracketRegex||/[(){}[\]]/}function u(t,e,n){var r=t.getLineHandle(e.line),i=e.ch-1,c=n&&n.afterCursor;null==c&&(c=/(^| )cm-fat-cursor($| )/.test(t.getWrapperElement().className));var a=v(n),o=!c&&0<=i&&a.test(r.text.charAt(i))&&p[r.text.charAt(i)]||a.test(r.text.charAt(i+1))&&p[r.text.charAt(++i)];if(!o)return null;var l=">"==o.charAt(1)?1:-1;if(n&&n.strict&&0<l!=(i==e.ch))return null;var s=t.getTokenTypeAt(k(e.line,i+1)),h=f(t,k(e.line,i+(0<l?1:0)),l,s||null,n);return null==h?null:{from:k(e.line,i),to:h&&h.pos,match:h&&h.ch==o.charAt(0),forward:0<l}}function f(t,e,n,r,i){for(var c=i&&i.maxScanLineLength||1e4,a=i&&i.maxScanLines||1e3,o=[],l=v(i),s=0<n?Math.min(e.line+a,t.lastLine()+1):Math.max(t.firstLine()-1,e.line-a),h=e.line;h!=s;h+=n){var u=t.getLine(h);if(u){var f=0<n?0:u.length-1,m=0<n?u.length:-1;if(!(u.length>c))for(h==e.line&&(f=e.ch-(n<0?1:0));f!=m;f+=n){var g=u.charAt(f);if(l.test(g)&&(void 0===r||t.getTokenTypeAt(k(h,f+1))==r)){var d=p[g];if(d&&">"==d.charAt(1)==0<n)o.push(g);else{if(!o.length)return{pos:k(h,f),ch:g};o.pop()}}}}}return h-n!=(0<n?t.lastLine():t.firstLine())&&null}function e(t,e,n){for(var r=t.state.matchBrackets.maxHighlightLineLength||1e3,i=[],c=t.listSelections(),a=0;a<c.length;a++){var o,l=c[a].empty()&&u(t,c[a].head,n);l&&t.getLine(l.from.line).length<=r&&(o=l.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",i.push(t.markText(l.from,k(l.from.line,l.from.ch+1),{className:o})),l.to&&t.getLine(l.to.line).length<=r&&i.push(t.markText(l.to,k(l.to.line,l.to.ch+1),{className:o})))}if(i.length){h&&t.state.focused&&t.focus();function s(){t.operation(function(){for(var t=0;t<i.length;t++)i[t].clear()})}if(!e)return s;setTimeout(s,800)}}function c(t){t.operation(function(){t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null),t.state.matchBrackets.currentlyHighlighted=e(t,!1,t.state.matchBrackets)})}i.defineOption("matchBrackets",!1,function(t,e,n){function r(t){t.state.matchBrackets&&t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null)}n&&n!=i.Init&&(t.off("cursorActivity",c),t.off("focus",c),t.off("blur",r),r(t)),e&&(t.state.matchBrackets="object"==typeof e?e:{},t.on("cursorActivity",c),t.on("focus",c),t.on("blur",r))}),i.defineExtension("matchBrackets",function(){e(this,!0)}),i.defineExtension("findMatchingBracket",function(t,e,n){return!n&&"boolean"!=typeof e||(e=n?(n.strict=e,n):e?{strict:!0}:null),u(this,t,e)}),i.defineExtension("scanForBracket",function(t,e,n,r){return f(this,t,e,n,r)})});

View File

@ -1,3 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others // CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE // Distributed under an MIT license: https://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){e.defineOption("autoCloseTags",!1,function(i,s,l){if(l!=e.Init&&l&&i.removeKeyMap("autoCloseTags"),s){var d={name:"autoCloseTags"};("object"!=typeof s||s.whenClosing)&&(d["'/'"]=function(t){return(n=t).getOption("disableInput")?e.Pass:o(n,!0);var n}),("object"!=typeof s||s.whenOpening)&&(d["'>'"]=function(o){return function(o){if(o.getOption("disableInput"))return e.Pass;for(var i=o.listSelections(),s=[],l=o.getOption("autoCloseTags"),d=0;d<i.length;d++){if(!i[d].empty())return e.Pass;var c=i[d].head,f=o.getTokenAt(c),g=e.innerMode(o.getMode(),f.state),u=g.state;if("xml"!=g.mode.name||!u.tagName)return e.Pass;var m="html"==g.mode.configuration,h="object"==typeof l&&l.dontCloseTags||m&&t,p="object"==typeof l&&l.indentTags||m&&n,v=u.tagName;f.end>c.ch&&(v=v.slice(0,v.length-f.end+c.ch));var b=v.toLowerCase();if(!v||"string"==f.type&&(f.end!=c.ch||!/[\"\']/.test(f.string.charAt(f.string.length-1))||1==f.string.length)||"tag"==f.type&&"closeTag"==u.type||f.string.indexOf("/")==f.string.length-1||h&&a(h,b)>-1||r(o,v,c,u,!0))return e.Pass;var y=p&&a(p,b)>-1;s[d]={indent:y,text:">"+(y?"\n\n":"")+"</"+v+">",newPos:y?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var x="object"==typeof l&&l.dontIndentOnAutoClose,d=i.length-1;d>=0;d--){var P=s[d];o.replaceRange(P.text,i[d].head,i[d].anchor,"+insert");var T=o.listSelections().slice(0);T[d]={head:P.newPos,anchor:P.newPos},o.setSelections(T),!x&&P.indent&&(o.indentLine(P.newPos.line,null,!0),o.indentLine(P.newPos.line+1,null,!0))}}(o)}),i.addKeyMap(d)}});var t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],n=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function o(t,n){for(var o=t.listSelections(),a=[],i=n?"/":"</",s=t.getOption("autoCloseTags"),l="object"==typeof s&&s.dontIndentOnSlash,d=0;d<o.length;d++){if(!o[d].empty())return e.Pass;var c,f=o[d].head,g=t.getTokenAt(f),u=e.innerMode(t.getMode(),g.state),m=u.state;if(n&&("string"==g.type||"<"!=g.string.charAt(0)||g.start!=f.ch-1))return e.Pass;if("xml"!=u.mode.name)if("htmlmixed"==t.getMode().name&&"javascript"==u.mode.name)c=i+"script";else{if("htmlmixed"!=t.getMode().name||"css"!=u.mode.name)return e.Pass;c=i+"style"}else{if(!m.context||!m.context.tagName||r(t,m.context.tagName,f,m))return e.Pass;c=i+m.context.tagName}">"!=t.getLine(f.line).charAt(g.end)&&(c+=">"),a[d]=c}if(t.replaceSelections(a),o=t.listSelections(),!l)for(d=0;d<o.length;d++)(d==o.length-1||o[d].head.line<o[d+1].head.line)&&t.indentLine(o[d].head.line)}function a(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,o=e.length;n<o;++n)if(e[n]==t)return n;return-1}function r(t,n,o,a,r){if(!e.scanForClosingTag)return!1;var i=Math.min(t.lastLine()+1,o.line+500),s=e.scanForClosingTag(t,o,null,i);if(!s||s.tag!=n)return!1;for(var l=a.context,d=r?1:0;l&&l.tagName==n;l=l.prev)++d;o=s.to;for(var c=1;c<d;c++){var f=e.scanForClosingTag(t,o,null,i);if(!f||f.tag!=n)return!1;o=f.to}return!0}e.commands.closeTag=function(e){return o(e)}}); !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(y){y.defineOption("autoCloseTags",!1,function(e,t,n){var o;n!=y.Init&&n&&e.removeKeyMap("autoCloseTags"),t&&(o={name:"autoCloseTags"},"object"==typeof t&&!1===t.whenClosing||(o["'/'"]=function(e){return(t=e).getOption("disableInput")?y.Pass:r(t,!0);var t}),"object"==typeof t&&!1===t.whenOpening||(o["'>'"]=function(e){if(e.getOption("disableInput"))return y.Pass;for(var t=e.listSelections(),n=[],o=e.getOption("autoCloseTags"),r=0;r<t.length;r++){if(!t[r].empty())return y.Pass;var a=t[r].head,i=e.getTokenAt(a),l=y.innerMode(e.getMode(),i.state),s=l.state,d=l.mode.xmlCurrentTag&&l.mode.xmlCurrentTag(s),c=d&&d.name;if(!c)return y.Pass;var f="html"==l.mode.configuration,g="object"==typeof o&&o.dontCloseTags||f&&x,u="object"==typeof o&&o.indentTags||f&&P;i.end>a.ch&&(c=c.slice(0,c.length-i.end+a.ch));var m=c.toLowerCase();if(!c||"string"==i.type&&(i.end!=a.ch||!/[\"\']/.test(i.string.charAt(i.string.length-1))||1==i.string.length)||"tag"==i.type&&d.close||i.string.indexOf("/")==a.ch-i.start-1||g&&-1<T(g,m)||j(e,l.mode.xmlCurrentContext&&l.mode.xmlCurrentContext(s)||[],c,a,!0))return y.Pass;var h,p="object"==typeof o&&o.emptyTags;p&&-1<T(p,c)?n[r]={text:"/>",newPos:y.Pos(a.line,a.ch+2)}:(h=u&&-1<T(u,m),n[r]={indent:h,text:">"+(h?"\n\n":"")+"</"+c+">",newPos:h?y.Pos(a.line+1,0):y.Pos(a.line,a.ch+1)})}for(var C="object"==typeof o&&o.dontIndentOnAutoClose,r=t.length-1;0<=r;r--){var b=n[r];e.replaceRange(b.text,t[r].head,t[r].anchor,"+insert");var v=e.listSelections().slice(0);v[r]={head:b.newPos,anchor:b.newPos},e.setSelections(v),!C&&b.indent&&(e.indentLine(b.newPos.line,null,!0),e.indentLine(b.newPos.line+1,null,!0))}}),e.addKeyMap(o))});var x=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function r(e,t){for(var n=e.listSelections(),o=[],r=t?"/":"</",a=e.getOption("autoCloseTags"),i="object"==typeof a&&a.dontIndentOnSlash,l=0;l<n.length;l++){if(!n[l].empty())return y.Pass;var s=n[l].head,d=e.getTokenAt(s),c=y.innerMode(e.getMode(),d.state),f=c.state;if(t&&("string"==d.type||"<"!=d.string.charAt(0)||d.start!=s.ch-1))return y.Pass;var g,u="xml"!=c.mode.name&&"htmlmixed"==e.getMode().name;if(u&&"javascript"==c.mode.name)g=r+"script";else if(u&&"css"==c.mode.name)g=r+"style";else{var m=c.mode.xmlCurrentContext&&c.mode.xmlCurrentContext(f);if(!m||m.length&&j(e,m,m[m.length-1],s))return y.Pass;g=r+m[m.length-1]}">"!=e.getLine(s.line).charAt(d.end)&&(g+=">"),o[l]=g}if(e.replaceSelections(o),n=e.listSelections(),!i)for(l=0;l<n.length;l++)(l==n.length-1||n[l].head.line<n[l+1].head.line)&&e.indentLine(n[l].head.line)}function T(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,o=e.length;n<o;++n)if(e[n]==t)return n;return-1}function j(e,t,n,o,r){if(y.scanForClosingTag){var a=Math.min(e.lastLine()+1,o.line+500),i=y.scanForClosingTag(e,o,null,a);if(i&&i.tag==n){for(var l=r?1:0,s=t.length-1;0<=s&&t[s]==n;s--)++l;o=i.to;for(s=1;s<l;s++){var d=y.scanForClosingTag(e,o,null,a);if(!d||d.tag!=n)return;o=d.to}return 1}}}y.commands.closeTag=function(e){return r(e)}});

View File

@ -1,3 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others // CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE // Distributed under an MIT license: https://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var n=e.Pos;function t(e,n){return e.line-n.line||e.ch-n.ch}var i="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",r=new RegExp("<(/?)(["+i+"][A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function u(e,n,t,i){this.line=n,this.ch=t,this.cm=e,this.text=e.getLine(n),this.min=i?Math.max(i.from,e.firstLine()):e.firstLine(),this.max=i?Math.min(i.to-1,e.lastLine()):e.lastLine()}function f(e,t){var i=e.cm.getTokenTypeAt(n(e.line,t));return i&&/\btag\b/.test(i)}function o(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function l(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function c(e){for(;;){var n=e.text.indexOf(">",e.ch);if(-1==n){if(o(e))continue;return}if(f(e,n+1)){var t=e.text.lastIndexOf("/",n),i=t>-1&&!/\S/.test(e.text.slice(t+1,n));return e.ch=n+1,i?"selfClose":"regular"}e.ch=n+1}}function a(e){for(;;){var n=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==n){if(l(e))continue;return}if(f(e,n+1)){r.lastIndex=n,e.ch=n;var t=r.exec(e.text);if(t&&t.index==n)return t}else e.ch=n}}function s(e){for(;;){r.lastIndex=e.ch;var n=r.exec(e.text);if(!n){if(o(e))continue;return}if(f(e,n.index+1))return e.ch=n.index+n[0].length,n;e.ch=n.index+1}}function h(e){for(;;){var n=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==n){if(l(e))continue;return}if(f(e,n+1)){var t=e.text.lastIndexOf("/",n),i=t>-1&&!/\S/.test(e.text.slice(t+1,n));return e.ch=n+1,i?"selfClose":"regular"}e.ch=n}}function F(e,t){for(var i=[];;){var r,u=s(e),f=e.line,o=e.ch-(u?u[0].length:0);if(!u||!(r=c(e)))return;if("selfClose"!=r)if(u[1]){for(var l=i.length-1;l>=0;--l)if(i[l]==u[2]){i.length=l;break}if(l<0&&(!t||t==u[2]))return{tag:u[2],from:n(f,o),to:n(e.line,e.ch)}}else i.push(u[2])}}function x(e,t){for(var i=[];;){var r=h(e);if(!r)return;if("selfClose"!=r){var u=e.line,f=e.ch,o=a(e);if(!o)return;if(o[1])i.push(o[2]);else{for(var l=i.length-1;l>=0;--l)if(i[l]==o[2]){i.length=l;break}if(l<0&&(!t||t==o[2]))return{tag:o[2],from:n(e.line,e.ch),to:n(u,f)}}}else a(e)}}e.registerHelper("fold","xml",function(e,i){for(var r=new u(e,i.line,0);;){var f=s(r);if(!f||r.line!=i.line)return;var o=c(r);if(!o)return;if(!f[1]&&"selfClose"!=o){var l=n(r.line,r.ch),a=F(r,f[2]);return a&&t(a.from,l)>0?{from:l,to:a.from}:null}}}),e.findMatchingTag=function(e,i,r){var f=new u(e,i.line,i.ch,r);if(-1!=f.text.indexOf(">")||-1!=f.text.indexOf("<")){var o=c(f),l=o&&n(f.line,f.ch),s=o&&a(f);if(o&&s&&!(t(f,i)>0)){var h={from:n(f.line,f.ch),to:l,tag:s[2]};return"selfClose"==o?{open:h,close:null,at:"open"}:s[1]?{open:x(f,s[2]),close:h,at:"close"}:{open:h,close:F(f=new u(e,l.line,l.ch,r),s[2]),at:"open"}}}},e.findEnclosingTag=function(e,n,t,i){for(var r=new u(e,n.line,n.ch,t);;){var f=x(r,i);if(!f)break;var o=F(new u(e,n.line,n.ch,t),f.tag);if(o)return{open:f,close:o}}},e.scanForClosingTag=function(e,n,t,i){return F(new u(e,n.line,n.ch,i?{from:0,to:i}:null),t)}}); !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var l=e.Pos;function c(e,n){return e.line-n.line||e.ch-n.ch}var n="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i=new RegExp("<(/?)(["+n+"][A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function a(e,n,t,i){this.line=n,this.ch=t,this.cm=e,this.text=e.getLine(n),this.min=i?Math.max(i.from,e.firstLine()):e.firstLine(),this.max=i?Math.min(i.to-1,e.lastLine()):e.lastLine()}function s(e,n){var t=e.cm.getTokenTypeAt(l(e.line,n));return t&&/\btag\b/.test(t)}function r(e){return!(e.line>=e.max)&&(e.ch=0,e.text=e.cm.getLine(++e.line),1)}function h(e){return!(e.line<=e.min)&&(e.text=e.cm.getLine(--e.line),e.ch=e.text.length,1)}function F(e){for(;;){var n=e.text.indexOf(">",e.ch);if(-1==n){if(r(e))continue;return}if(s(e,n+1)){var t=e.text.lastIndexOf("/",n),i=-1<t&&!/\S/.test(e.text.slice(t+1,n));return e.ch=n+1,i?"selfClose":"regular"}e.ch=n+1}}function x(e){for(;;){var n=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==n){if(h(e))continue;return}if(s(e,n+1)){i.lastIndex=n,e.ch=n;var t=i.exec(e.text);if(t&&t.index==n)return t}else e.ch=n}}function g(e){for(;;){i.lastIndex=e.ch;var n=i.exec(e.text);if(!n){if(r(e))continue;return}if(s(e,n.index+1))return e.ch=n.index+n[0].length,n;e.ch=n.index+1}}function v(e,n){for(var t=[];;){var i,r=g(e),u=e.line,f=e.ch-(r?r[0].length:0);if(!r||!(i=F(e)))return;if("selfClose"!=i)if(r[1]){for(var o=t.length-1;0<=o;--o)if(t[o]==r[2]){t.length=o;break}if(o<0&&(!n||n==r[2]))return{tag:r[2],from:l(u,f),to:l(e.line,e.ch)}}else t.push(r[2])}}function d(e,n){for(var t=[];;){var i=function(e){for(;;){var n=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==n){if(h(e))continue;return}if(s(e,n+1)){var t=e.text.lastIndexOf("/",n),i=-1<t&&!/\S/.test(e.text.slice(t+1,n));return e.ch=n+1,i?"selfClose":"regular"}e.ch=n}}(e);if(!i)return;if("selfClose"!=i){var r=e.line,u=e.ch,f=x(e);if(!f)return;if(f[1])t.push(f[2]);else{for(var o=t.length-1;0<=o;--o)if(t[o]==f[2]){t.length=o;break}if(o<0&&(!n||n==f[2]))return{tag:f[2],from:l(e.line,e.ch),to:l(r,u)}}}else x(e)}}e.registerHelper("fold","xml",function(e,n){for(var t=new a(e,n.line,0);;){var i=g(t);if(!i||t.line!=n.line)return;var r=F(t);if(!r)return;if(!i[1]&&"selfClose"!=r){var u=l(t.line,t.ch),f=v(t,i[2]);return f&&0<c(f.from,u)?{from:u,to:f.from}:null}}}),e.findMatchingTag=function(e,n,t){var i=new a(e,n.line,n.ch,t);if(-1!=i.text.indexOf(">")||-1!=i.text.indexOf("<")){var r=F(i),u=r&&l(i.line,i.ch),f=r&&x(i);if(r&&f&&!(0<c(i,n))){var o={from:l(i.line,i.ch),to:u,tag:f[2]};return"selfClose"==r?{open:o,close:null,at:"open"}:f[1]?{open:d(i,f[2]),close:o,at:"close"}:{open:o,close:v(i=new a(e,u.line,u.ch,t),f[2]),at:"open"}}}},e.findEnclosingTag=function(e,n,t,i){for(var r=new a(e,n.line,n.ch,t);;){var u=d(r,i);if(!u)break;var f=v(new a(e,n.line,n.ch,t),u.tag);if(f)return{open:u,close:f}}},e.scanForClosingTag=function(e,n,t,i){return v(new a(e,n.line,n.ch,i?{from:0,to:i}:null),t)}});

View File

@ -1,3 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others // CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE // Distributed under an MIT license: https://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineOption("fullScreen",!1,function(t,l,o){var r,n;(o==e.Init&&(o=!1),!o!=!l)&&(l?(n=(r=t).getWrapperElement(),r.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:n.style.width,height:n.style.height},n.style.width="",n.style.height="auto",n.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",r.refresh()):function(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var l=e.state.fullScreenRestore;t.style.width=l.width,t.style.height=l.height,window.scrollTo(l.scrollLeft,l.scrollTop),e.refresh()}(t))}),e.toggleFullscreen=function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},e.commands.togglefullscreen=e.toggleFullscreen}); !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(i){"use strict";i.defineOption("fullScreen",!1,function(e,t,o){var r,l;o==i.Init&&(o=!1),!o!=!t&&(t?(l=(r=e).getWrapperElement(),r.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:l.style.width,height:l.style.height},l.style.width="",l.style.height="auto",l.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",r.refresh()):function(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var o=e.state.fullScreenRestore;t.style.width=o.width,t.style.height=o.height,window.scrollTo(o.scrollLeft,o.scrollTop),e.refresh()}(e))})});

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others // CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE // Distributed under an MIT license: https://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var S={},y=/[^\s\u00a0]/,E=e.Pos,u=e.cmpPos;function f(e){var n=e.search(y);return-1==n?0:n}function M(e,n){var t=e.getMode();return!1!==t.useInnerComments&&t.innerMode?e.getModeAt(n):t}e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",function(e){e=e||S;for(var n=this,t=1/0,i=this.listSelections(),l=null,o=i.length-1;0<=o;o--){var r=i[o].from(),m=i[o].to();r.line>=t||(m.line>=t&&(m=E(t,0)),t=r.line,null==l?l=n.uncomment(r,m,e)?"un":(n.lineComment(r,m,e),"line"):"un"==l?n.uncomment(r,m,e):n.lineComment(r,m,e))}}),e.defineExtension("lineComment",function(o,e,r){r=r||S;var n,t,m,a,c,g,s=this,i=M(s,o),l=s.getLine(o.line);null!=l&&(n=o,t=l,!/\bstring\b/.test(s.getTokenTypeAt(E(n.line,0)))||/^[\'\"\`]/.test(t))&&((m=r.lineComment||i.lineComment)?(a=Math.min(0!=e.ch||e.line==o.line?e.line+1:e.line,s.lastLine()+1),c=null==r.padding?" ":r.padding,g=r.commentBlankLines||o.line==e.line,s.operation(function(){if(r.indent){for(var e=null,n=o.line;n<a;++n){var t=(i=s.getLine(n)).slice(0,f(i));(null==e||e.length>t.length)&&(e=t)}for(n=o.line;n<a;++n){var i=s.getLine(n),l=e.length;(g||y.test(i))&&(i.slice(0,l)!=e&&(l=f(i)),s.replaceRange(e+m+c,E(n,0),E(n,l)))}}else for(n=o.line;n<a;++n)(g||y.test(s.getLine(n)))&&s.replaceRange(m+c,E(n,0))})):(r.blockCommentStart||i.blockCommentStart)&&(r.fullLines=!0,s.blockComment(o,e,r)))}),e.defineExtension("blockComment",function(o,r,m){m=m||S;var a,c,g=this,s=M(g,o),f=m.blockCommentStart||s.blockCommentStart,d=m.blockCommentEnd||s.blockCommentEnd;f&&d?/\bcomment\b/.test(g.getTokenTypeAt(E(o.line,0)))||((a=Math.min(r.line,g.lastLine()))!=o.line&&0==r.ch&&y.test(g.getLine(a))&&--a,c=null==m.padding?" ":m.padding,o.line>a||g.operation(function(){if(0!=m.fullLines){var e=y.test(g.getLine(a));g.replaceRange(c+d,E(a)),g.replaceRange(f+c,E(o.line,0));var n=m.blockCommentLead||s.blockCommentLead;if(null!=n)for(var t=o.line+1;t<=a;++t)t==a&&!e||g.replaceRange(n+c,E(t,0))}else{var i=0==u(g.getCursor("to"),r),l=!g.somethingSelected();g.replaceRange(d,r),i&&g.setSelection(l?r:g.getCursor("from"),r),g.replaceRange(f,o)}})):(m.lineComment||s.lineComment)&&0!=m.fullLines&&g.lineComment(o,r,m)}),e.defineExtension("uncomment",function(e,n,t){t=t||S;var l,o=this,i=M(o,e),r=Math.min(0!=n.ch||n.line==e.line?n.line:n.line-1,o.lastLine()),m=Math.min(e.line,r),a=t.lineComment||i.lineComment,c=[],g=null==t.padding?" ":t.padding;e:if(a){for(var s=m;s<=r;++s){var f=o.getLine(s),d=f.indexOf(a);if(-1<d&&!/comment/.test(o.getTokenTypeAt(E(s,d+1)))&&(d=-1),-1==d&&y.test(f))break e;if(-1<d&&y.test(f.slice(0,d)))break e;c.push(f)}if(o.operation(function(){for(var e=m;e<=r;++e){var n=c[e-m],t=n.indexOf(a),i=t+a.length;t<0||(n.slice(i,i+g.length)==g&&(i+=g.length),l=!0,o.replaceRange("",E(e,t),E(e,i)))}}),l)return!0}var u=t.blockCommentStart||i.blockCommentStart,h=t.blockCommentEnd||i.blockCommentEnd;if(!u||!h)return!1;var C=t.blockCommentLead||i.blockCommentLead,p=o.getLine(m),v=p.indexOf(u);if(-1==v)return!1;var b=r==m?p:o.getLine(r),k=b.indexOf(h,r==m?v+u.length:0),L=E(m,v+1),x=E(r,k+1);if(-1==k||!/comment/.test(o.getTokenTypeAt(L))||!/comment/.test(o.getTokenTypeAt(x))||-1<o.getRange(L,x,"\n").indexOf(h))return!1;var R=-1==(T=p.lastIndexOf(u,e.ch))?-1:p.slice(0,e.ch).indexOf(h,T+u.length);if(-1!=T&&-1!=R&&R+h.length!=e.ch)return!1;R=b.indexOf(h,n.ch);var O=b.slice(n.ch).lastIndexOf(u,R-n.ch),T=-1==R||-1==O?-1:n.ch+O;return(-1==R||-1==T||T==n.ch)&&(o.operation(function(){o.replaceRange("",E(r,k-(g&&b.slice(k-g.length,k)==g?g.length:0)),E(r,k+h.length));var e=v+u.length;if(g&&p.slice(e,e+g.length)==g&&(e+=g.length),o.replaceRange("",E(m,v),E(m,e)),C)for(var n=m+1;n<=r;++n){var t,i=o.getLine(n),l=i.indexOf(C);-1==l||y.test(i.slice(0,l))||(t=l+C.length,g&&i.slice(t,t+g.length)==g&&(t+=g.length),o.replaceRange("",E(n,l),E(n,t)))}}),!0)})});
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var y={},E=/[^\s\u00a0]/,M=e.Pos;function s(e){var n=e.search(E);return-1==n?0:n}function S(e,n){var t=e.getMode();return!1!==t.useInnerComments&&t.innerMode?e.getModeAt(n):t}e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",function(e){e=e||y;for(var n=this,t=1/0,i=this.listSelections(),l=null,o=i.length-1;0<=o;o--){var r=i[o].from(),m=i[o].to();r.line>=t||(m.line>=t&&(m=M(t,0)),t=r.line,null==l?l=n.uncomment(r,m,e)?"un":(n.lineComment(r,m,e),"line"):"un"==l?n.uncomment(r,m,e):n.lineComment(r,m,e))}}),e.defineExtension("lineComment",function(o,e,r){r=r||y;var n,t,m,a,c,g,f=this,i=S(f,o),l=f.getLine(o.line);null!=l&&(n=o,t=l,!/\bstring\b/.test(f.getTokenTypeAt(M(n.line,0)))||/^[\'\"\`]/.test(t))&&((m=r.lineComment||i.lineComment)?(a=Math.min(0!=e.ch||e.line==o.line?e.line+1:e.line,f.lastLine()+1),c=null==r.padding?" ":r.padding,g=r.commentBlankLines||o.line==e.line,f.operation(function(){if(r.indent){for(var e=null,n=o.line;n<a;++n){var t=(i=f.getLine(n)).slice(0,s(i));(null==e||e.length>t.length)&&(e=t)}for(n=o.line;n<a;++n){var i=f.getLine(n),l=e.length;(g||E.test(i))&&(i.slice(0,l)!=e&&(l=s(i)),f.replaceRange(e+m+c,M(n,0),M(n,l)))}}else for(n=o.line;n<a;++n)(g||E.test(f.getLine(n)))&&f.replaceRange(m+c,M(n,0))})):(r.blockCommentStart||i.blockCommentStart)&&(r.fullLines=!0,f.blockComment(o,e,r)))}),e.defineExtension("blockComment",function(i,l,o){o=o||y;var r,m,a=this,c=S(a,i),g=o.blockCommentStart||c.blockCommentStart,f=o.blockCommentEnd||c.blockCommentEnd;g&&f?/\bcomment\b/.test(a.getTokenTypeAt(M(i.line,0)))||((r=Math.min(l.line,a.lastLine()))!=i.line&&0==l.ch&&E.test(a.getLine(r))&&--r,m=null==o.padding?" ":o.padding,i.line>r||a.operation(function(){if(0!=o.fullLines){var e=E.test(a.getLine(r));a.replaceRange(m+f,M(r)),a.replaceRange(g+m,M(i.line,0));var n=o.blockCommentLead||c.blockCommentLead;if(null!=n)for(var t=i.line+1;t<=r;++t)t==r&&!e||a.replaceRange(n+m,M(t,0))}else a.replaceRange(f,l),a.replaceRange(g,i)})):(o.lineComment||c.lineComment)&&0!=o.fullLines&&a.lineComment(i,l,o)}),e.defineExtension("uncomment",function(e,n,t){t=t||y;var l,o=this,i=S(o,e),r=Math.min(0!=n.ch||n.line==e.line?n.line:n.line-1,o.lastLine()),m=Math.min(e.line,r),a=t.lineComment||i.lineComment,c=[],g=null==t.padding?" ":t.padding;e:if(a){for(var f=m;f<=r;++f){var s=o.getLine(f),d=s.indexOf(a);if(-1<d&&!/comment/.test(o.getTokenTypeAt(M(f,d+1)))&&(d=-1),-1==d&&E.test(s))break e;if(-1<d&&E.test(s.slice(0,d)))break e;c.push(s)}if(o.operation(function(){for(var e=m;e<=r;++e){var n=c[e-m],t=n.indexOf(a),i=t+a.length;t<0||(n.slice(i,i+g.length)==g&&(i+=g.length),l=!0,o.replaceRange("",M(e,t),M(e,i)))}}),l)return!0}var u=t.blockCommentStart||i.blockCommentStart,h=t.blockCommentEnd||i.blockCommentEnd;if(!u||!h)return!1;var p=t.blockCommentLead||i.blockCommentLead,C=o.getLine(m),b=C.indexOf(u);if(-1==b)return!1;var v=r==m?C:o.getLine(r),k=v.indexOf(h,r==m?b+u.length:0),L=M(m,b+1),x=M(r,k+1);if(-1==k||!/comment/.test(o.getTokenTypeAt(L))||!/comment/.test(o.getTokenTypeAt(x))||-1<o.getRange(L,x,"\n").indexOf(h))return!1;var R=-1==(T=C.lastIndexOf(u,e.ch))?-1:C.slice(0,e.ch).indexOf(h,T+u.length);if(-1!=T&&-1!=R&&R+h.length!=e.ch)return!1;R=v.indexOf(h,n.ch);var O=v.slice(n.ch).lastIndexOf(u,R-n.ch),T=-1==R||-1==O?-1:n.ch+O;return(-1==R||-1==T||T==n.ch)&&(o.operation(function(){o.replaceRange("",M(r,k-(g&&v.slice(k-g.length,k)==g?g.length:0)),M(r,k+h.length));var e=b+u.length;if(g&&C.slice(e,e+g.length)==g&&(e+=g.length),o.replaceRange("",M(m,b),M(m,e)),p)for(var n=m+1;n<=r;++n){var t,i=o.getLine(n),l=i.indexOf(p);-1==l||E.test(i.slice(0,l))||(t=l+p.length,g&&i.slice(t,t+g.length)==g&&(t+=g.length),o.replaceRange("",M(n,l),M(n,t)))}}),!0)})});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others // CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE // Distributed under an MIT license: https://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.multiplexingMode=function(n){var i=Array.prototype.slice.call(arguments,1);function t(e,n,i,t){if("string"==typeof n){var r=e.indexOf(n,i);return t&&r>-1?r+n.length:r}var o=n.exec(i?e.slice(i):e);return o?o.index+i+(t?o[0].length:0):-1}return{startState:function(){return{outer:e.startState(n),innerActive:null,inner:null}},copyState:function(i){return{outer:e.copyState(n,i.outer),innerActive:i.innerActive,inner:i.innerActive&&e.copyState(i.innerActive.mode,i.inner)}},token:function(r,o){if(o.innerActive){var c=o.innerActive;a=r.string;if(!c.close&&r.sol())return o.innerActive=o.inner=null,this.token(r,o);if((v=c.close?t(a,c.close,r.pos,c.parseDelimiters):-1)==r.pos&&!c.parseDelimiters)return r.match(c.close),o.innerActive=o.inner=null,c.delimStyle&&c.delimStyle+" "+c.delimStyle+"-close";v>-1&&(r.string=a.slice(0,v));var l=c.mode.token(r,o.inner);return v>-1&&(r.string=a),v==r.pos&&c.parseDelimiters&&(o.innerActive=o.inner=null),c.innerStyle&&(l=l?l+" "+c.innerStyle:c.innerStyle),l}for(var s=1/0,a=r.string,u=0;u<i.length;++u){var v,d=i[u];if((v=t(a,d.open,r.pos))==r.pos){d.parseDelimiters||r.match(d.open),o.innerActive=d;var f=0;if(n.indent){var m=n.indent(o.outer,"");m!==e.Pass&&(f=m)}return o.inner=e.startState(d.mode,f),d.delimStyle&&d.delimStyle+" "+d.delimStyle+"-open"}-1!=v&&v<s&&(s=v)}s!=1/0&&(r.string=a.slice(0,s));var p=n.token(r,o.outer);return s!=1/0&&(r.string=a),p},indent:function(i,t){var r=i.innerActive?i.innerActive.mode:n;return r.indent?r.indent(i.innerActive?i.inner:i.outer,t):e.Pass},blankLine:function(t){var r=t.innerActive?t.innerActive.mode:n;if(r.blankLine&&r.blankLine(t.innerActive?t.inner:t.outer),t.innerActive)"\n"===t.innerActive.close&&(t.innerActive=t.inner=null);else for(var o=0;o<i.length;++o){var c=i[o];"\n"===c.open&&(t.innerActive=c,t.inner=e.startState(c.mode,r.indent?r.indent(t.outer,""):0))}},electricChars:n.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:n}}}}}); !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(p){"use strict";p.multiplexingMode=function(d){var f=Array.prototype.slice.call(arguments,1);function m(e,n,t,i){if("string"==typeof n){var r=e.indexOf(n,t);return i&&-1<r?r+n.length:r}var o=n.exec(t?e.slice(t):e);return o?o.index+t+(i?o[0].length:0):-1}return{startState:function(){return{outer:p.startState(d),innerActive:null,inner:null}},copyState:function(e){return{outer:p.copyState(d,e.outer),innerActive:e.innerActive,inner:e.innerActive&&p.copyState(e.innerActive.mode,e.inner)}},token:function(e,n){if(n.innerActive){var t=n.innerActive,i=e.string;if(!t.close&&e.sol())return n.innerActive=n.inner=null,this.token(e,n);if((l=t.close?m(i,t.close,e.pos,t.parseDelimiters):-1)==e.pos&&!t.parseDelimiters)return e.match(t.close),n.innerActive=n.inner=null,t.delimStyle&&t.delimStyle+" "+t.delimStyle+"-close";-1<l&&(e.string=i.slice(0,l));var r=t.mode.token(e,n.inner);return-1<l&&(e.string=i),l==e.pos&&t.parseDelimiters&&(n.innerActive=n.inner=null),t.innerStyle&&(r=r?r+" "+t.innerStyle:t.innerStyle),r}for(var o=1/0,i=e.string,c=0;c<f.length;++c){var l,s=f[c];if((l=m(i,s.open,e.pos))==e.pos){s.parseDelimiters||e.match(s.open),n.innerActive=s;var a,u=0;return!d.indent||(a=d.indent(n.outer,"",""))!==p.Pass&&(u=a),n.inner=p.startState(s.mode,u),s.delimStyle&&s.delimStyle+" "+s.delimStyle+"-open"}-1!=l&&l<o&&(o=l)}o!=1/0&&(e.string=i.slice(0,o));var v=d.token(e,n.outer);return o!=1/0&&(e.string=i),v},indent:function(e,n,t){var i=e.innerActive?e.innerActive.mode:d;return i.indent?i.indent(e.innerActive?e.inner:e.outer,n,t):p.Pass},blankLine:function(e){var n=e.innerActive?e.innerActive.mode:d;if(n.blankLine&&n.blankLine(e.innerActive?e.inner:e.outer),e.innerActive)"\n"===e.innerActive.close&&(e.innerActive=e.inner=null);else for(var t=0;t<f.length;++t){var i=f[t];"\n"===i.open&&(e.innerActive=i,e.inner=p.startState(i.mode,n.indent?n.indent(e.outer,"",""):0))}},electricChars:d.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:d}}}}});

View File

@ -1,3 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others // CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE // Distributed under an MIT license: https://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/multiplex")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/multiplex"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("htmlembedded",function(i,t){var d=t.closeComment||"--%>";return e.multiplexingMode(e.getMode(i,"htmlmixed"),{open:t.openComment||"<%--",close:d,delimStyle:"comment",mode:{token:function(e){return e.skipTo(d)||e.skipToEnd(),"comment"}}},{open:t.open||t.scriptStartRegex||"<%",close:t.close||t.scriptEndRegex||"%>",mode:e.getMode(i,t.scriptingModeSpec)})},"htmlmixed"),e.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),e.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),e.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),e.defineMIME("application/x-erb",{name:"htmlembedded",scriptingModeSpec:"ruby"})}); !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/multiplex")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/multiplex"],e):e(CodeMirror)}(function(d){"use strict";d.defineMode("htmlembedded",function(e,i){var t=i.closeComment||"--%>";return d.multiplexingMode(d.getMode(e,"htmlmixed"),{open:i.openComment||"<%--",close:t,delimStyle:"comment",mode:{token:function(e){return e.skipTo(t)||e.skipToEnd(),"comment"}}},{open:i.open||i.scriptStartRegex||"<%",close:i.close||i.scriptEndRegex||"%>",mode:d.getMode(e,i.scriptingModeSpec)})},"htmlmixed"),d.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),d.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),d.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),d.defineMIME("application/x-erb",{name:"htmlembedded",scriptingModeSpec:"ruby"})});

View File

@ -1,3 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others // CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE // Distributed under an MIT license: https://codemirror.net/LICENSE
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],t):t(CodeMirror)}(function(t){"use strict";var e={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};var a={};function n(t,e){var n,l=t.match(a[n=e]||(a[n]=new RegExp("\\s+"+n+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")));return l?/^\s*(.*?)\s*$/.exec(l[2])[1]:""}function l(t,e){return new RegExp((e?"^":"")+"</s*"+t+"s*>","i")}function r(t,e){for(var a in t)for(var n=e[a]||(e[a]=[]),l=t[a],r=l.length-1;r>=0;r--)n.unshift(l[r])}t.defineMode("htmlmixed",function(a,o){var c=t.getMode(a,{name:"xml",htmlMode:!0,multilineTagIndentFactor:o.multilineTagIndentFactor,multilineTagIndentPastTag:o.multilineTagIndentPastTag}),i={},s=o&&o.tags,u=o&&o.scriptTypes;if(r(e,i),s&&r(s,i),u)for(var m=u.length-1;m>=0;m--)i.script.unshift(["type",u[m].matches,u[m].mode]);function d(e,r){var o,s=c.token(e,r.htmlState),u=/\btag\b/.test(s);if(u&&!/[<>\s\/]/.test(e.current())&&(o=r.htmlState.tagName&&r.htmlState.tagName.toLowerCase())&&i.hasOwnProperty(o))r.inTag=o+" ";else if(r.inTag&&u&&/>$/.test(e.current())){var m=/^([\S]+) (.*)/.exec(r.inTag);r.inTag=null;var p=">"==e.current()&&function(t,e){for(var a=0;a<t.length;a++){var l=t[a];if(!l[0]||l[1].test(n(e,l[0])))return l[2]}}(i[m[1]],m[2]),f=t.getMode(a,p),g=l(m[1],!0),h=l(m[1],!1);r.token=function(t,e){return t.match(g,!1)?(e.token=d,e.localState=e.localMode=null,null):(a=t,n=h,l=e.localMode.token(t,e.localState),r=a.current(),(o=r.search(n))>-1?a.backUp(r.length-o):r.match(/<\/?$/)&&(a.backUp(r.length),a.match(n,!1)||a.match(r)),l);var a,n,l,r,o},r.localMode=f,r.localState=t.startState(f,c.indent(r.htmlState,""))}else r.inTag&&(r.inTag+=e.current(),e.eol()&&(r.inTag+=" "));return s}return{startState:function(){return{token:d,inTag:null,localMode:null,localState:null,htmlState:t.startState(c)}},copyState:function(e){var a;return e.localState&&(a=t.copyState(e.localMode,e.localState)),{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:a,htmlState:t.copyState(c,e.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(e,a,n){return!e.localMode||/^\s*<\//.test(a)?c.indent(e.htmlState,a):e.localMode.indent?e.localMode.indent(e.localState,a,n):t.Pass},innerMode:function(t){return{state:t.localState||t.htmlState,mode:t.localMode||c}}}},"xml","javascript","css"),t.defineMIME("text/html","htmlmixed")}); !function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],t):t(CodeMirror)}(function(p){"use strict";var l={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};var o={};function f(t,e){var a,n=t.match(o[a=e]||(o[a]=new RegExp("\\s+"+a+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function h(t,e){return new RegExp((e?"^":"")+"</s*"+t+"s*>","i")}function r(t,e){for(var a in t)for(var n=e[a]||(e[a]=[]),l=t[a],o=l.length-1;0<=o;o--)n.unshift(l[o])}p.defineMode("htmlmixed",function(u,t){var m=p.getMode(u,{name:"xml",htmlMode:!0,multilineTagIndentFactor:t.multilineTagIndentFactor,multilineTagIndentPastTag:t.multilineTagIndentPastTag,allowMissingTagName:t.allowMissingTagName}),d={},e=t&&t.tags,a=t&&t.scriptTypes;if(r(l,d),e&&r(e,d),a)for(var n=a.length-1;0<=n;n--)d.script.unshift(["type",a[n].matches,a[n].mode]);function g(t,e){var a,n,l,o,i,c,r=m.token(t,e.htmlState),s=/\btag\b/.test(r);return s&&!/[<>\s\/]/.test(t.current())&&(a=e.htmlState.tagName&&e.htmlState.tagName.toLowerCase())&&d.hasOwnProperty(a)?e.inTag=a+" ":e.inTag&&s&&/>$/.test(t.current())?(n=/^([\S]+) (.*)/.exec(e.inTag),e.inTag=null,l=">"==t.current()&&function(t,e){for(var a=0;a<t.length;a++){var n=t[a];if(!n[0]||n[1].test(f(e,n[0])))return n[2]}}(d[n[1]],n[2]),o=p.getMode(u,l),i=h(n[1],!0),c=h(n[1],!1),e.token=function(t,e){return t.match(i,!1)?(e.token=g,e.localState=e.localMode=null):(a=t,n=c,l=e.localMode.token(t,e.localState),o=a.current(),-1<(r=o.search(n))?a.backUp(o.length-r):o.match(/<\/?$/)&&(a.backUp(o.length),a.match(n,!1)||a.match(o)),l);var a,n,l,o,r},e.localMode=o,e.localState=p.startState(o,m.indent(e.htmlState,"",""))):e.inTag&&(e.inTag+=t.current(),t.eol()&&(e.inTag+=" ")),r}return{startState:function(){return{token:g,inTag:null,localMode:null,localState:null,htmlState:p.startState(m)}},copyState:function(t){var e;return t.localState&&(e=p.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:e,htmlState:p.copyState(m,t.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(t,e,a){return!t.localMode||/^\s*<\//.test(e)?m.indent(t.htmlState,e,a):t.localMode.indent?t.localMode.indent(t.localState,e,a):p.Pass},innerMode:function(t){return{state:t.localState||t.htmlState,mode:t.localMode||m}}}},"xml","javascript","css"),p.defineMIME("text/html","htmlmixed")});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others // CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE // Distributed under an MIT license: https://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function o(e,o){var r=Number(o);return/^[-+]/.test(o)?e.getCursor().line+r:r-1}e.commands.jumpToLine=function(e){var r,i,t,s,n,l=e.getCursor();r=e,i='Jump to line: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use line:column or scroll% syntax)</span>',t="Jump to line:",s=l.line+1+":"+l.ch,n=function(r){var i;if(r)if(i=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(r))e.setCursor(o(e,i[1]),Number(i[2]));else if(i=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(r)){var t=Math.round(e.lineCount()*Number(i[1])/100);/^[-+]/.test(i[1])&&(t=l.line+t+1),e.setCursor(t-1,l.ch)}else(i=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(r))&&e.setCursor(o(e,i[1]),l.ch)},r.openDialog?r.openDialog(i,n,{value:s,selectValueOnOpen:!0}):n(prompt(t,s))},e.keyMap.default["Alt-G"]="jumpToLine"}); !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function u(e,o){var r=Number(o);return/^[-+]/.test(o)?e.getCursor().line+r:r-1}e.commands.jumpToLine=function(t){var e,o,r,s,i,n,l=t.getCursor();o=(n=e=t).phrase("Jump to line:")+' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">'+n.phrase("(Use line:column or scroll% syntax)")+"</span>",r=t.phrase("Jump to line:"),s=l.line+1+":"+l.ch,i=function(e){var o,r;e&&((o=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(e))?t.setCursor(u(t,o[1]),Number(o[2])):(o=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(e))?(r=Math.round(t.lineCount()*Number(o[1])/100),/^[-+]/.test(o[1])&&(r=l.line+r+1),t.setCursor(r-1,l.ch)):(o=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(e))&&t.setCursor(u(t,o[1]),l.ch))},e.openDialog?e.openDialog(o,i,{value:s,selectValueOnOpen:!0}):i(prompt(r,s))},e.keyMap.default["Alt-G"]="jumpToLine"});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function o(e,o,n){var t;return(t=e.getWrapperElement().appendChild(document.createElement("div"))).className=n?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof o?t.innerHTML=o:t.appendChild(o),t}function n(e,o){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=o}e.defineExtension("openDialog",function(t,i,r){r||(r={}),n(this,null);var u=o(this,t,r.bottom),l=!1,c=this;function a(e){if("string"==typeof e)s.value=e;else{if(l)return;l=!0,u.parentNode.removeChild(u),c.focus(),r.onClose&&r.onClose(u)}}var f,s=u.getElementsByTagName("input")[0];return s?(s.focus(),r.value&&(s.value=r.value,!1!==r.selectValueOnOpen&&s.select()),r.onInput&&e.on(s,"input",function(e){r.onInput(e,s.value,a)}),r.onKeyUp&&e.on(s,"keyup",function(e){r.onKeyUp(e,s.value,a)}),e.on(s,"keydown",function(o){r&&r.onKeyDown&&r.onKeyDown(o,s.value,a)||((27==o.keyCode||!1!==r.closeOnEnter&&13==o.keyCode)&&(s.blur(),e.e_stop(o),a()),13==o.keyCode&&i(s.value,o))}),!1!==r.closeOnBlur&&e.on(s,"blur",a)):(f=u.getElementsByTagName("button")[0])&&(e.on(f,"click",function(){a(),c.focus()}),!1!==r.closeOnBlur&&e.on(f,"blur",a),f.focus()),a}),e.defineExtension("openConfirm",function(t,i,r){n(this,null);var u=o(this,t,r&&r.bottom),l=u.getElementsByTagName("button"),c=!1,a=this,f=1;function s(){c||(c=!0,u.parentNode.removeChild(u),a.focus())}l[0].focus();for(var d=0;d<l.length;++d){var p=l[d];!function(o){e.on(p,"click",function(n){e.e_preventDefault(n),s(),o&&o(a)})}(i[d]),e.on(p,"blur",function(){--f,setTimeout(function(){f<=0&&s()},200)}),e.on(p,"focus",function(){++f})}}),e.defineExtension("openNotification",function(t,i){n(this,a);var r,u=o(this,t,i&&i.bottom),l=!1,c=i&&void 0!==i.duration?i.duration:5e3;function a(){l||(l=!0,clearTimeout(r),u.parentNode.removeChild(u))}return e.on(u,"click",function(o){e.e_preventDefault(o),a()}),c&&(r=setTimeout(a,c)),a})}); !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(s){function f(e,o,n){var t=e.getWrapperElement(),i=t.appendChild(document.createElement("div"));return i.className=n?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof o?i.innerHTML=o:i.appendChild(o),s.addClass(t,"dialog-opened"),i}function p(e,o){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=o}s.defineExtension("openDialog",function(e,o,n){n=n||{},p(this,null);var t=f(this,e,n.bottom),i=!1,r=this;function u(e){if("string"==typeof e)a.value=e;else{if(i)return;i=!0,s.rmClass(t.parentNode,"dialog-opened"),t.parentNode.removeChild(t),r.focus(),n.onClose&&n.onClose(t)}}var l,a=t.getElementsByTagName("input")[0];return a?(a.focus(),n.value&&(a.value=n.value,!1!==n.selectValueOnOpen&&a.select()),n.onInput&&s.on(a,"input",function(e){n.onInput(e,a.value,u)}),n.onKeyUp&&s.on(a,"keyup",function(e){n.onKeyUp(e,a.value,u)}),s.on(a,"keydown",function(e){n&&n.onKeyDown&&n.onKeyDown(e,a.value,u)||((27==e.keyCode||!1!==n.closeOnEnter&&13==e.keyCode)&&(a.blur(),s.e_stop(e),u()),13==e.keyCode&&o(a.value,e))}),!1!==n.closeOnBlur&&s.on(t,"focusout",function(e){null!==e.relatedTarget&&u()})):(l=t.getElementsByTagName("button")[0])&&(s.on(l,"click",function(){u(),r.focus()}),!1!==n.closeOnBlur&&s.on(l,"blur",u),l.focus()),u}),s.defineExtension("openConfirm",function(e,o,n){p(this,null);var t=f(this,e,n&&n.bottom),i=t.getElementsByTagName("button"),r=!1,u=this,l=1;function a(){r||(r=!0,s.rmClass(t.parentNode,"dialog-opened"),t.parentNode.removeChild(t),u.focus())}i[0].focus();for(var c=0;c<i.length;++c){var d=i[c];!function(o){s.on(d,"click",function(e){s.e_preventDefault(e),a(),o&&o(u)})}(o[c]),s.on(d,"blur",function(){--l,setTimeout(function(){l<=0&&a()},200)}),s.on(d,"focus",function(){++l})}}),s.defineExtension("openNotification",function(e,o){p(this,u);var n,t=f(this,e,o&&o.bottom),i=!1,r=o&&void 0!==o.duration?o.duration:5e3;function u(){i||(i=!0,clearTimeout(n),s.rmClass(t.parentNode,"dialog-opened"),t.parentNode.removeChild(t))}return s.on(t,"click",function(e){s.e_preventDefault(e),u()}),r&&(n=setTimeout(u,r)),u})});

View File

@ -1 +1 @@
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t="CodeMirror-activeline",n="CodeMirror-activeline-background",i="CodeMirror-activeline-gutter";function r(e){for(var r=0;r<e.state.activeLines.length;r++)e.removeLineClass(e.state.activeLines[r],"wrap",t),e.removeLineClass(e.state.activeLines[r],"background",n),e.removeLineClass(e.state.activeLines[r],"gutter",i)}function o(e,o){for(var a=[],s=0;s<o.length;s++){var c=o[s],l=e.getOption("styleActiveLine");if("object"==typeof l&&l.nonEmpty?c.anchor.line==c.head.line:c.empty()){var f=e.getLineHandleVisualStart(c.head.line);a[a.length-1]!=f&&a.push(f)}}(function(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0})(e.state.activeLines,a)||e.operation(function(){r(e);for(var o=0;o<a.length;o++)e.addLineClass(a[o],"wrap",t),e.addLineClass(a[o],"background",n),e.addLineClass(a[o],"gutter",i);e.state.activeLines=a})}function a(e,t){o(e,t.ranges)}e.defineOption("styleActiveLine",!1,function(t,n,i){var s=i!=e.Init&&i;n!=s&&(s&&(t.off("beforeSelectionChange",a),r(t),delete t.state.activeLines),n&&(t.state.activeLines=[],o(t,t.listSelections()),t.on("beforeSelectionChange",a)))})}); !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(r){"use strict";var s="CodeMirror-activeline",c="CodeMirror-activeline-background",l="CodeMirror-activeline-gutter";function f(e){for(var t=0;t<e.state.activeLines.length;t++)e.removeLineClass(e.state.activeLines[t],"wrap",s),e.removeLineClass(e.state.activeLines[t],"background",c),e.removeLineClass(e.state.activeLines[t],"gutter",l)}function o(t,e){for(var n=[],i=0;i<e.length;i++){var r,o=e[i],a=t.getOption("styleActiveLine");("object"==typeof a&&a.nonEmpty?o.anchor.line==o.head.line:o.empty())&&(r=t.getLineHandleVisualStart(o.head.line),n[n.length-1]!=r&&n.push(r))}!function(e,t){if(e.length==t.length){for(var n=0;n<e.length;n++)if(e[n]!=t[n])return;return 1}}(t.state.activeLines,n)&&t.operation(function(){f(t);for(var e=0;e<n.length;e++)t.addLineClass(n[e],"wrap",s),t.addLineClass(n[e],"background",c),t.addLineClass(n[e],"gutter",l);t.state.activeLines=n})}function a(e,t){o(e,t.ranges)}r.defineOption("styleActiveLine",!1,function(e,t,n){var i=n!=r.Init&&n;t!=i&&(i&&(e.off("beforeSelectionChange",a),f(e),delete e.state.activeLines),t&&(e.state.activeLines=[],o(e,e.listSelections()),e.on("beforeSelectionChange",a)))})});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4,4 +4,4 @@ This plugin provides an enhanced text editor component based on [[CodeMirror|htt
[[Source code|https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/codemirror]] [[Source code|https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/codemirror]]
Based on ~CodeMirror version 5.37.0 Based on ~CodeMirror version 5.58.2

View File

@ -4,7 +4,13 @@ description: Search
caption: Search caption: Search
tags: $:/tags/MenuBar tags: $:/tags/MenuBar
\define cancel-search-actions() <$action-deletetiddler $filter="[<__storeTitle__>] [<__tiddler__>] [<__selectionStateTitle__>]"/> \define cancel-search-actions()
<$set name="userInput" value={{{ [<__storeTitle__>get[text]] }}}>
<$list filter="[<__tiddler__>get[text]!match<userInput>]" emptyMessage="""<$action-deletetiddler $filter="[<__storeTitle__>] [<__tiddler__>] [<__selectionStateTitle__>]"/>""">
<$action-setfield $tiddler=<<__tiddler__>> text=<<userInput>>/><$action-setfield $tiddler=<<__refreshTitle__>> text="yes"/>
</$list>
</$set>
\end
\define input-accept-actions() <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> \define input-accept-actions() <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>

View File

@ -1143,6 +1143,10 @@ canvas.tc-edit-bitmapeditor {
overflow: hidden; /* https://github.com/Jermolene/TiddlyWiki5/issues/282 */ overflow: hidden; /* https://github.com/Jermolene/TiddlyWiki5/issues/282 */
} }
.tc-tiddler-title.tc-tiddler-edit-title {
line-height: 3em;
}
html body.tc-body.tc-single-tiddler-window { html body.tc-body.tc-single-tiddler-window {
margin: 1em; margin: 1em;
background: <<colour tiddler-background>>; background: <<colour tiddler-background>>;