1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-01-25 12:23:42 +00:00

Compare commits

..

5 Commits

Author SHA1 Message Date
Jeremy Ruston
898b61a3a0 Experimental debug view 2023-08-31 09:18:36 +01:00
Saq Imtiaz
5bce35d90b Fix: add twEditor attribute to paste events handled by codemirror (#7281) 2023-02-28 08:35:15 +00:00
lin onetwo
8d39ce95eb FieldIndexer performance: use isShadowTiddler instead of allTitles (#7299)
* feat: use `isShadowTiddler` insteadof `allTitles`

* fix: use `tiddlerExists` instead
2023-02-27 17:32:20 +00:00
Jeremy Ruston
e313857822 Use sticky flag to improve regexp search performance (#7297) 2023-02-27 15:12:07 +00:00
Maurycy Zarzycki
ce988f909a Add PL translations to strings introduce in 7b7063a7b2 (#7300) 2023-02-27 15:03:03 +00:00
7 changed files with 81 additions and 7 deletions

View File

@@ -0,0 +1,54 @@
/*\
title: $:/core/modules/debug-view.js
type: application/javascript
module-type: global
debug-view module supports the optional external debug window
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var dm = $tw.utils.domMaker;
/*
Instantiate the debug view
*/
function DebugView(options) {
if($tw.browser) {
this.outputFilters = dm("div",{
text: "Yes"
})
this.container = dm("div",{
"class": "tc-debug-view",
children: [
dm("div",{
children: [
dm("h1",{
text: "TiddlyWiki Debug View"
}),
dm("h2",{
text: "Filter Execution"
}),
this.outputFilters
]
})
]
});
document.body.appendChild(this.container);
}
}
/*
Show a generic network error alert
*/
DebugView.prototype.displayError = function(msg,err) {
};
exports.DebugView = DebugView;
})();

View File

@@ -330,6 +330,14 @@ exports.compileFilter = function(filterString) {
}
})());
});
// If we're debugging then wrap each operation function with debug code
if(true) {
$tw.utils.each(operationFunctions,function(operationFunction,index) {
operationFunctions[index] = function(results,source,widget) {
return operationFunction(results,source,widget);
};
});
}
// Return a function that applies the operations to a source iterator of tiddler titles
var fnMeasured = $tw.perf.measure("filter: " + filterString,function filterFunction(source,widget) {
if(!source) {

View File

@@ -32,18 +32,18 @@ FieldIndexer.prototype.setMaxIndexedValueLength = function(length) {
FieldIndexer.prototype.addIndexMethods = function() {
var self = this;
// get all tiddlers, including those overwrite shadow tiddlers
this.wiki.each.byField = function(name,value) {
var titles = self.wiki.allTitles(),
lookup = self.lookup(name,value);
var lookup = self.lookup(name,value);
return lookup && lookup.filter(function(title) {
return titles.indexOf(title) !== -1;
return self.wiki.tiddlerExists(title)
});
};
// get shadow tiddlers, including shadow tiddlers that is overwritten
this.wiki.eachShadow.byField = function(name,value) {
var titles = self.wiki.allShadowTitles(),
lookup = self.lookup(name,value);
var lookup = self.lookup(name,value);
return lookup && lookup.filter(function(title) {
return titles.indexOf(title) !== -1;
return self.wiki.isShadowTiddler(title)
});
};
this.wiki.eachTiddlerPlusShadows.byField = function(name,value) {

View File

@@ -23,6 +23,8 @@ var PERFORMANCE_INSTRUMENTATION_CONFIG_TITLE = "$:/config/Performance/Instrument
var widget = require("$:/core/modules/widgets/widget.js");
exports.startup = function() {
// Debug view
$tw.debugView = new $tw.DebugView();
// Minimal browser detection
if($tw.browser) {
$tw.browser.isIE = (/msie|trident/i.test(navigator.userAgent));

View File

@@ -259,7 +259,7 @@ DropZoneWidget.prototype.handlePasteEvent = function(event) {
}
};
// Let the browser handle it if we're in a textarea or input box
if(["TEXTAREA","INPUT"].indexOf(event.target.tagName) == -1 && !event.target.isContentEditable) {
if(["TEXTAREA","INPUT"].indexOf(event.target.tagName) == -1 && !event.target.isContentEditable && !event.twEditor) {
var self = this,
items = event.clipboardData.items;
// Enumerate the clipboard items

View File

@@ -1,11 +1,13 @@
title: $:/language/Docs/Fields/
_canonical_uri: Pełny adres URL do zewnętrznego obrazu
author: Imię autora wtyczki
bag: Nazwa worka, z ktorego pochodzi tiddler
caption: Tekst wyświetlany na zakładce lub przycisku
code-body: Ustawienie wartości na ''tak'' spowoduje wyświetlanie tiddlera jako kod
color: Wartość koloru CSS powiążanego z tym tiddlerem
component: Nazwa komponentu odpowiedzialnego za [[alert|AlertMechanism]]
core-version: Wersja TiddlyWiki która jest wspierana przez wtyczkę
current-tiddler: Używane by zapamiętać ostatniego tiddlera w [[liście historii|HistoryMechanism]]
created: Data kiedy utworzono tiddlera
creator: Imię twórcy tiddlera
@@ -22,7 +24,9 @@ list-before: Jeżeli ustawione, nazwa tiddlera przed którym ten tiddler będzie
list-after: Jeżeli ustawione, nazwa tiddlera po którym ten tiddler będzie dodany w sortowanej liście nazw tiddlerów; lub na końcu listy jeżeli pole jest obecne ale puste
modified: Czas i data ostatniej modyfikacji
modifier: Tytuł tiddlera powiązanego z osobą, która ostatnio modyfikowała tego tiddlera
module-type: Rodzaj modułu używany przez wtyczki napisane w javascripcie
name: Czytelna nazwa powiązana z tiddlerem wtyczki
parent-plugin: Określa nadrzędną wtyczkę
plugin-priority: Numeryczna wartość określająca tiddlera wtyczki
plugin-type: Typ tiddlera wtyczki
revision: Numer rewizji tiddlera przechowywany na serwerze

View File

@@ -220,9 +220,15 @@ function CodeMirrorEngine(options) {
}
});
this.cm.on("paste",function(cm,event) {
event["twEditor"] = true;
self.widget.handlePasteEvent.call(self.widget,event);
});
} else {
this.cm.on("paste",function(cm,event){
event["twEditor"] = true;
});
}
;
}
/*