[Pkg-mozext-maintainers] Bug#1116547: trixie-pu: package xnote/4.5.48-1~deb13u1
Mechtilde Stehmann
mechtilde at debian.org
Sun Sep 28 13:49:54 BST 2025
Package: release.debian.org
Severity: normal
Tags: trixie
X-Debbugs-Cc: xnote at packages.debian.org, mechtilde at debian.org
Control: affects -1 + src:xnote
User: release.debian.org at packages.debian.org
Usertags: pu
[ Reason ]
Thunderbird will come with a new version (>=140.3) into stable. This need an
update for the Add-Ons (here: xnote) too.
[ Impact ]
If the update isn't approved the user can't anymore use it
in recent thunderbird.
[ Tests ]
The same upstream code works with thunderbird >= 140.3 in testing.
[ Risks ]
Code is trivial so no risk
[ Checklist ]
[X] *all* changes are documented in the d/changelog
[X] I reviewed all changes and I approve them
[X] attach debdiff against the package in (old)stable
[X] the issue is verified as fixed in unstable
[ Changes ]
The new version of thunderbird needs a new version of webext-xnote
[ Other info ]
The only reason is the new upcoming version of the thunderbird.
-------------- next part --------------
diffstat for xnote-4.1.12 xnote-4.5.48
_locales/de/messages.json | 2
_locales/en_US/messages.json | 6
_locales/fr_FR/messages.json | 6
_locales/gl/messages.json | 6
_locales/it_IT/messages.json | 6
_locales/ja_JP/messages.json | 6
_locales/nl_NL/messages.json | 6
chrome/content/autosize.js | 231 ++
chrome/content/scripts/notifyTools.js | 2
chrome/content/scripts/xn-xnote-aboutOverlay.js | 10
chrome/content/scripts/xn-xnote-overlay.js | 5
chrome/content/skin/iconmonstr-trash-can-10.svg | 1
chrome/content/testwin.xhtml | 21
chrome/content/tooltip/tippy/popper.js | 6
chrome/content/tooltip/tippy/tippy-debug.js | 2614 +++++++++++++++++++++++
chrome/content/tooltip/tippy/tippy.js | 2
chrome/content/xnote-about-columnnoteTest.js | 126 -
chrome/content/xnote-about-overlay.js | 113
chrome/content/xnote-columnnote.js | 108
chrome/content/xnote-overlay.js | 139 -
chrome/content/xnote-window.js | 184 +
chrome/content/xnote-window.xhtml | 186 -
chrome/modules/commons.jsm | 4
chrome/modules/commons.sys.mjs | 130 +
chrome/modules/dateformat.jsm | 2
chrome/modules/dateformat.sys.mjs | 55
chrome/modules/xnote.jsm | 61
chrome/modules/xnote.sys.mjs | 343 +++
chrome/skin/xnote-window.css | 26
debian/changelog | 26
debian/control | 5
debian/copyright | 2
debian/dpb.conf | 18
debian/gbp.conf | 21
debian/upstream/metadata | 1
debian/watch | 2
experiment-apis/LegacyPrefs/legacyprefs.js | 7
experiment-apis/NotifyTools/implementation.js | 12
experiment-apis/WindowListener/implementation.js | 37
experiment-apis/WindowListener/schema.json | 1
experiment-apis/customColumn/implementation.js | 98
experiment-apis/customColumn/schema.json | 39
experiment-apis/files/files-api.js | 18
experiment-apis/xnote/xnote-experiments.js | 222 +
experiment-apis/xnote/xnote-experiments.json | 57
mDisplay.js | 8
manifest.json | 29
options/options.html | 6
options/options.js | 1
popup/ExprSearch.html | 24
popup/donations.html | 32
popup/donations1.html | 23
popup/update.html | 17
scripts/listener.js | 7
xn-background.js | 422 +++
55 files changed, 4831 insertions(+), 711 deletions(-)
diff -Nru xnote-4.1.12/chrome/content/autosize.js xnote-4.5.48/chrome/content/autosize.js
--- xnote-4.1.12/chrome/content/autosize.js 1970-01-01 01:00:00.000000000 +0100
+++ xnote-4.5.48/chrome/content/autosize.js 2025-01-19 11:43:56.000000000 +0100
@@ -0,0 +1,231 @@
+(function (global, factory) {
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+ typeof define === 'function' && define.amd ? define(factory) :
+ (global = global || self, global.autosize = factory());
+}(this, (function () {
+ var assignedElements = new Map();
+
+ function assign(ta) {
+ if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || assignedElements.has(ta)) return;
+ var previousHeight = null;
+
+ function cacheScrollTops(el) {
+ var arr = [];
+
+ while (el && el.parentNode && el.parentNode instanceof Element) {
+ if (el.parentNode.scrollTop) {
+ arr.push([el.parentNode, el.parentNode.scrollTop]);
+ }
+
+ el = el.parentNode;
+ }
+
+ return function () {
+ return arr.forEach(function (_ref) {
+ var node = _ref[0],
+ scrollTop = _ref[1];
+ node.style.scrollBehavior = 'auto';
+ node.scrollTop = scrollTop;
+ node.style.scrollBehavior = null;
+ });
+ };
+ }
+
+ var computed = window.getComputedStyle(ta);
+
+ function setHeight(_ref2) {
+ var _ref2$restoreTextAlig = _ref2.restoreTextAlign,
+ restoreTextAlign = _ref2$restoreTextAlig === void 0 ? null : _ref2$restoreTextAlig,
+ _ref2$testForHeightRe = _ref2.testForHeightReduction,
+ testForHeightReduction = _ref2$testForHeightRe === void 0 ? true : _ref2$testForHeightRe;
+ var initialOverflowY = computed.overflowY;
+
+ if (ta.scrollHeight === 0) {
+ // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM.
+ return;
+ } // disallow vertical resizing
+
+
+ if (computed.resize === 'vertical') {
+ ta.style.resize = 'none';
+ } else if (computed.resize === 'both') {
+ ta.style.resize = 'horizontal';
+ }
+
+ var restoreScrollTops; // remove inline height style to accurately measure situations where the textarea should shrink
+ // however, skip this step if the new value appends to the previous value, as textarea height should only have grown
+
+ if (testForHeightReduction) {
+ // ensure the scrollTop values of parent elements are not modified as a consequence of shrinking the textarea height
+ restoreScrollTops = cacheScrollTops(ta);
+ ta.style.height = '';
+ }
+
+ var newHeight;
+
+ if (computed.boxSizing === 'content-box') {
+ newHeight = ta.scrollHeight - (parseFloat(computed.paddingTop) + parseFloat(computed.paddingBottom));
+ } else {
+ newHeight = ta.scrollHeight + parseFloat(computed.borderTopWidth) + parseFloat(computed.borderBottomWidth);
+ }
+
+ if (computed.maxHeight !== 'none' && newHeight > parseFloat(computed.maxHeight)) {
+ if (computed.overflowY === 'hidden') {
+ ta.style.overflow = 'scroll';
+ }
+
+ newHeight = parseFloat(computed.maxHeight);
+ } else if (computed.overflowY !== 'hidden') {
+ ta.style.overflow = 'hidden';
+ }
+
+ ta.style.height = newHeight + 'px';
+
+ if (restoreTextAlign) {
+ ta.style.textAlign = restoreTextAlign;
+ }
+
+ if (restoreScrollTops) {
+ restoreScrollTops();
+ }
+
+ if (previousHeight !== newHeight) {
+ ta.dispatchEvent(new Event('autosize:resized', {
+ bubbles: true
+ }));
+ previousHeight = newHeight;
+ }
+
+ if (initialOverflowY !== computed.overflow && !restoreTextAlign) {
+ var textAlign = computed.textAlign;
+
+ if (computed.overflow === 'hidden') {
+ // Webkit fails to reflow text after overflow is hidden,
+ // even if hiding overflow would allow text to fit more compactly.
+ // The following is intended to force the necessary text reflow.
+ ta.style.textAlign = textAlign === 'start' ? 'end' : 'start';
+ }
+
+ setHeight({
+ restoreTextAlign: textAlign,
+ testForHeightReduction: true
+ });
+ }
+ }
+
+ function fullSetHeight() {
+ setHeight({
+ testForHeightReduction: true,
+ restoreTextAlign: null
+ });
+ }
+
+ var handleInput = function () {
+ var previousValue = ta.value;
+ return function () {
+ setHeight({
+ // if previousValue is '', check for height shrinkage because the placeholder may be taking up space instead
+ // if new value is merely appending to previous value, skip checking for height deduction
+ testForHeightReduction: previousValue === '' || !ta.value.startsWith(previousValue),
+ restoreTextAlign: null
+ });
+ previousValue = ta.value;
+ };
+ }();
+
+ var destroy = function (style) {
+ ta.removeEventListener('autosize:destroy', destroy);
+ ta.removeEventListener('autosize:update', fullSetHeight);
+ ta.removeEventListener('input', handleInput);
+ window.removeEventListener('resize', fullSetHeight); // future todo: consider replacing with ResizeObserver
+
+ Object.keys(style).forEach(function (key) {
+ return ta.style[key] = style[key];
+ });
+ assignedElements["delete"](ta);
+ }.bind(ta, {
+ height: ta.style.height,
+ resize: ta.style.resize,
+ textAlign: ta.style.textAlign,
+ overflowY: ta.style.overflowY,
+ overflowX: ta.style.overflowX,
+ wordWrap: ta.style.wordWrap
+ });
+
+ ta.addEventListener('autosize:destroy', destroy);
+ ta.addEventListener('autosize:update', fullSetHeight);
+ ta.addEventListener('input', handleInput);
+ window.addEventListener('resize', fullSetHeight); // future todo: consider replacing with ResizeObserver
+
+ ta.style.overflowX = 'hidden';
+ ta.style.wordWrap = 'break-word';
+ assignedElements.set(ta, {
+ destroy: destroy,
+ update: fullSetHeight
+ });
+ fullSetHeight();
+ }
+
+ function destroy(ta) {
+ var methods = assignedElements.get(ta);
+
+ if (methods) {
+ methods.destroy();
+ }
+ }
+
+ function update(ta) {
+ var methods = assignedElements.get(ta);
+
+ if (methods) {
+ methods.update();
+ }
+ }
+
+ var autosize = null; // Do nothing in Node.js environment
+
+ if (typeof window === 'undefined') {
+ autosize = function autosize(el) {
+ return el;
+ };
+
+ autosize.destroy = function (el) {
+ return el;
+ };
+
+ autosize.update = function (el) {
+ return el;
+ };
+ } else {
+ autosize = function autosize(el, options) {
+ if (el) {
+ Array.prototype.forEach.call(el.length ? el : [el], function (x) {
+ return assign(x);
+ });
+ }
+
+ return el;
+ };
+
+ autosize.destroy = function (el) {
+ if (el) {
+ Array.prototype.forEach.call(el.length ? el : [el], destroy);
+ }
+
+ return el;
+ };
+
+ autosize.update = function (el) {
+ if (el) {
+ Array.prototype.forEach.call(el.length ? el : [el], update);
+ }
+
+ return el;
+ };
+ }
+
+ var autosize$1 = autosize;
+
+ return autosize$1;
+
+})));
diff -Nru xnote-4.1.12/chrome/content/scripts/notifyTools.js xnote-4.5.48/chrome/content/scripts/notifyTools.js
--- xnote-4.1.12/chrome/content/scripts/notifyTools.js 2023-09-22 22:00:30.000000000 +0200
+++ xnote-4.5.48/chrome/content/scripts/notifyTools.js 2025-03-11 09:59:42.000000000 +0100
@@ -27,7 +27,7 @@
*/
//var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
+//var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
var notifyTools = {
registeredCallbacks: {},
diff -Nru xnote-4.1.12/chrome/content/scripts/xn-xnote-aboutOverlay.js xnote-4.5.48/chrome/content/scripts/xn-xnote-aboutOverlay.js
--- xnote-4.1.12/chrome/content/scripts/xn-xnote-aboutOverlay.js 2024-01-09 21:31:24.000000000 +0100
+++ xnote-4.5.48/chrome/content/scripts/xn-xnote-aboutOverlay.js 2025-03-11 09:59:54.000000000 +0100
@@ -1,6 +1,6 @@
-console.log("start xn-xnote-aboutOverlay");
+//console.log("start xn-xnote-aboutOverlay");
//var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
+//var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
// Load xnoteOverlayObj into the window.
Services.scriptloader.loadSubScript("chrome://xnote/content/xnote-about-overlay.js", window, "UTF-8");
@@ -14,7 +14,7 @@
<stringbundleset id="xnote-stringbundleset">
<stringbundle id="xnote-stringbundle-overlay" src="chrome://xnote/locale/xnote-overlay.properties"/>
</stringbundleset>
- <browser id ="xnote-print" insertbefore = "messagepane" type = "content" hidden = "true"/>
+ <browser id ="xnote-print" insertbefore = "messagePane" type = "content" hidden = "true"/>
<!-- Context menu for message list -->
<popup id="mailContext">
<menu id="xnote-mailContext-xNote" label="&xnote.label;" accesskey="&xnote.key;"
@@ -49,7 +49,7 @@
</menu>
<menuseparator id="xnote-mailContext-sep-xNote" insertbefore="mailContext-openInBrowser,mailContext-openNewWindow"/>
</popup>
-
+ <!--
<tree id="threadTree">
<treecols id="threadCols">
<splitter class="tree-splitter" />
@@ -59,7 +59,7 @@
src = "resource://xnote/skin/xnote_context.png" />
</treecols>
</tree>
-
+-->
`, ["chrome://xnote/locale/xnote-overlay.dtd"]);
// window.xnoteColumnObj.onLoad();
diff -Nru xnote-4.1.12/chrome/content/scripts/xn-xnote-overlay.js xnote-4.5.48/chrome/content/scripts/xn-xnote-overlay.js
--- xnote-4.1.12/chrome/content/scripts/xn-xnote-overlay.js 2024-01-09 21:01:04.000000000 +0100
+++ xnote-4.5.48/chrome/content/scripts/xn-xnote-overlay.js 2025-03-11 10:07:12.000000000 +0100
@@ -1,6 +1,6 @@
-console.log("start xn-xnote-overlay");
+//console.log("start xn-xnote-overlay");
//var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
+//var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
// Load xnoteOverlayObj into the window.
Services.scriptloader.loadSubScript("chrome://xnote/content/xnote-overlay.js", window, "UTF-8");
@@ -9,7 +9,6 @@
function onLoad(activatedWhileWindowOpen) {
// console.log (Services.appinfo.version);
/*
- let layout = WL.injectCSS("resource://xnote/skin/xnote-overlay.css");
WL.injectElements(`
<stringbundleset id="xnote-stringbundleset">
diff -Nru xnote-4.1.12/chrome/content/skin/iconmonstr-trash-can-10.svg xnote-4.5.48/chrome/content/skin/iconmonstr-trash-can-10.svg
--- xnote-4.1.12/chrome/content/skin/iconmonstr-trash-can-10.svg 1970-01-01 01:00:00.000000000 +0100
+++ xnote-4.5.48/chrome/content/skin/iconmonstr-trash-can-10.svg 2025-01-19 16:08:44.000000000 +0100
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M16 9v4.501c-.748.313-1.424.765-2 1.319v-5.82c0-.552.447-1 1-1s1 .448 1 1zm-4 0v10c0 .552-.447 1-1 1s-1-.448-1-1v-10c0-.552.447-1 1-1s1 .448 1 1zm1.82 15h-11.82v-18h2v16h8.502c.312.749.765 1.424 1.318 2zm-6.82-16c.553 0 1 .448 1 1v10c0 .552-.447 1-1 1s-1-.448-1-1v-10c0-.552.447-1 1-1zm14-4h-20v-2h5.711c.9 0 1.631-1.099 1.631-2h5.316c0 .901.73 2 1.631 2h5.711v2zm-1 2v7.182c-.482-.115-.983-.182-1.5-.182l-.5.025v-7.025h2zm3 13.5c0 2.485-2.017 4.5-4.5 4.5s-4.5-2.015-4.5-4.5 2.017-4.5 4.5-4.5 4.5 2.015 4.5 4.5zm-3.086-2.122l-1.414 1.414-1.414-1.414-.707.708 1.414 1.414-1.414 1.414.707.708 1.414-1.414 1.414 1.414.708-.708-1.414-1.414 1.414-1.414-.708-.708z"/></svg>
\ Kein Zeilenumbruch am Dateiende.
diff -Nru xnote-4.1.12/chrome/content/testwin.xhtml xnote-4.5.48/chrome/content/testwin.xhtml
--- xnote-4.1.12/chrome/content/testwin.xhtml 2023-11-01 11:01:06.000000000 +0100
+++ xnote-4.5.48/chrome/content/testwin.xhtml 1970-01-01 01:00:00.000000000 +0100
@@ -1,21 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href='resource://xnote/skin/xnote-window.css' type='text/css'?>
-
-<!DOCTYPE window SYSTEM "chrome://xnote/locale/xnote-window.dtd">
-<!-- hidechrome='true'-->
-<window title="Window Open Test"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- id='xnote-window'
-
- screenX="80"
- screenY="80"
- height="300"
- width="300"
- persist="screenX screenY height width">
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-
-</body>
-
-</window>
\ Kein Zeilenumbruch am Dateiende.
diff -Nru xnote-4.1.12/chrome/content/tooltip/tippy/popper.js xnote-4.5.48/chrome/content/tooltip/tippy/popper.js
--- xnote-4.1.12/chrome/content/tooltip/tippy/popper.js 1970-01-01 01:00:00.000000000 +0100
+++ xnote-4.5.48/chrome/content/tooltip/tippy/popper.js 2024-08-02 00:39:16.000000000 +0200
@@ -0,0 +1,6 @@
+/**
+ * @popperjs/core v2.11.8 - MIT License
+ */
+
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={})}(this,(function(e){"use strict";function t(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function n(e){return e instanceof t(e).Element||e instanceof Element}function r(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof t(e).ShadowRoot||e instanceof ShadowRoot)}var i=Math.max,a=Math.min,s=Math.round;function f(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function c(){return!/^((?!chrome|android).)*safari/i.test(f())}function p(e,o,i){void 0===o&&(o=!1),void 0===i&&(i=!1);var a=e.getBoundingClientRect(),f=1,p=1;o&&r(e)&&(f=e.offsetWidth>0&&s(a.width)/e.offsetWidth||1,p=e.offsetHeight>0&&s(a.height)/e.offsetHeight||1);var u=(n(e)?t(e):window).visualViewport,l=!c()&&i,d=(a.left+(l&&u?u.offsetLeft:0))/f,h=(a.top+(l&&u?u.offsetTop:0))/p,m=a.width/f,v=a.height/p;return{width:m,height:v,top:h,right:d+m,bottom:h+v,left:d,x:d,y:h}}function u(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function l(e){return e?(e.nodeName||"").toLowerCase():null}function d(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function h(e){return p(d(e)).left+u(e).scrollLeft}function m(e){return t(e).getComputedStyle(e)}function v(e){var t=m(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function y(e,n,o){void 0===o&&(o=!1);var i,a,f=r(n),c=r(n)&&function(e){var t=e.getBoundingClientRect(),n=s(t.width)/e.offsetWidth||1,r=s(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(n),m=d(n),y=p(e,c,o),g={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(f||!f&&!o)&&(("body"!==l(n)||v(m))&&(g=(i=n)!==t(i)&&r(i)?{scrollLeft:(a=i).scrollLeft,scrollTop:a.scrollTop}:u(i)),r(n)?((b=p(n,!0)).x+=n.clientLeft,b.y+=n.clientTop):m&&(b.x=h(m))),{x:y.left+g.scrollLeft-b.x,y:y.top+g.scrollTop-b.y,width:y.width,height:y.height}}function g(e){var t=p(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function b(e){return"html"===l(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||d(e)}function x(e){return["html","body","#document"].indexOf(l(e))>=0?e.ownerDocument.body:r(e)&&v(e)?e:x(b(e))}function w(e,n){var r;void 0===n&&(n=[]);var o=x(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=t(o),s=i?[a].concat(a.visualViewport||[],v(o)?o:[]):o,f=n.concat(s);return i?f:f.concat(w(b(s)))}function O(e){return["table","td","th"].indexOf(l(e))>=0}function j(e){return r(e)&&"fixed"!==m(e).position?e.offsetParent:null}function E(e){for(var n=t(e),i=j(e);i&&O(i)&&"static"===m(i).position;)i=j(i);return i&&("html"===l(i)||"body"===l(i)&&"static"===m(i).position)?n:i||function(e){var t=/firefox/i.test(f());if(/Trident/i.test(f())&&r(e)&&"fixed"===m(e).position)return null;var n=b(e);for(o(n)&&(n=n.host);r(n)&&["html","body"].indexOf(l(n))<0;){var i=m(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||n}var D="top",A="bottom",L="right",P="left",M="auto",k=[D,A,L,P],W="start",B="end",H="viewport",T="popper",R=k.reduce((function(e,t){return e.concat([t+"-"+W,t+"-"+B])}),[]),S=[].concat(k,[M]).reduce((function(e,t){return e.concat([t,t+"-"+W,t+"-"+B])}),[]),V=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function q(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function C(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function N(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function I(e,r,o){return r===H?N(function(e,n){var r=t(e),o=d(e),i=r.visualViewport,a=o.clientWidth,s=o.clientHeight,f=0,p=0;if(i){a=i.width,s=i.height;var u=c();(u||!u&&"fixed"===n)&&(f=i.offsetLeft,p=i.offsetTop)}return{width:a,height:s,x:f+h(e),y:p}}(e,o)):n(r)?function(e,t){var n=p(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(r,o):N(function(e){var t,n=d(e),r=u(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=i(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=i(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),f=-r.scrollLeft+h(e),c=-r.scrollTop;return"rtl"===m(o||n).direction&&(f+=i(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:s,x:f,y:c}}(d(e)))}function _(e,t,o,s){var f="clippingParents"===t?function(e){var t=w(b(e)),o=["absolute","fixed"].indexOf(m(e).position)>=0&&r(e)?E(e):e;return n(o)?t.filter((function(e){return n(e)&&C(e,o)&&"body"!==l(e)})):[]}(e):[].concat(t),c=[].concat(f,[o]),p=c[0],u=c.reduce((function(t,n){var r=I(e,n,s);return t.top=i(r.top,t.top),t.right=a(r.right,t.right),t.bottom=a(r.bottom,t.bottom),t.left=i(r.left,t.left),t}),I(e,p,s));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function F(e){return e.split("-")[0]}function U(e){return e.split("-")[1]}function z(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function X(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?F(o):null,a=o?U(o):null,s=n.x+n.width/2-r.width/2,f=n.y+n.height/2-r.height/2;switch(i){case D:t={x:s,y:n.y-r.height};break;case A:t={x:s,y:n.y+n.height};break;case L:t={x:n.x+n.width,y:f};break;case P:t={x:n.x-r.width,y:f};break;default:t={x:n.x,y:n.y}}var c=i?z(i):null;if(null!=c){var p="y"===c?"height":"width";switch(a){case W:t[c]=t[c]-(n[p]/2-r[p]/2);break;case B:t[c]=t[c]+(n[p]/2-r[p]/2)}}return t}function Y(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function G(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function J(e,t){void 0===t&&(t={});var r=t,o=r.placement,i=void 0===o?e.placement:o,a=r.strategy,s=void 0===a?e.strategy:a,f=r.boundary,c=void 0===f?"clippingParents":f,u=r.rootBoundary,l=void 0===u?H:u,h=r.elementContext,m=void 0===h?T:h,v=r.altBoundary,y=void 0!==v&&v,g=r.padding,b=void 0===g?0:g,x=Y("number"!=typeof b?b:G(b,k)),w=m===T?"reference":T,O=e.rects.popper,j=e.elements[y?w:m],E=_(n(j)?j:j.contextElement||d(e.elements.popper),c,l,s),P=p(e.elements.reference),M=X({reference:P,element:O,strategy:"absolute",placement:i}),W=N(Object.assign({},O,M)),B=m===T?W:P,R={top:E.top-B.top+x.top,bottom:B.bottom-E.bottom+x.bottom,left:E.left-B.left+x.left,right:B.right-E.right+x.right},S=e.modifiersData.offset;if(m===T&&S){var V=S[i];Object.keys(R).forEach((function(e){var t=[L,A].indexOf(e)>=0?1:-1,n=[D,A].indexOf(e)>=0?"y":"x";R[e]+=V[n]*t}))}return R}var K={placement:"bottom",modifiers:[],strategy:"absolute"};function Q(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function Z(e){void 0===e&&(e={});var t=e,r=t.defaultModifiers,o=void 0===r?[]:r,i=t.defaultOptions,a=void 0===i?K:i;return function(e,t,r){void 0===r&&(r=a);var i,s,f={placement:"bottom",orderedModifiers:[],options:Object.assign({},K,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},c=[],p=!1,u={state:f,setOptions:function(r){var i="function"==typeof r?r(f.options):r;l(),f.options=Object.assign({},a,f.options,i),f.scrollParents={reference:n(e)?w(e):e.contextElement?w(e.contextElement):[],popper:w(t)};var s,p,d=function(e){var t=q(e);return V.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((s=[].concat(o,f.options.modifiers),p=s.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(p).map((function(e){return p[e]}))));return f.orderedModifiers=d.filter((function(e){return e.enabled})),f.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,o=e.effect;if("function"==typeof o){var i=o({state:f,name:t,instance:u,options:r}),a=function(){};c.push(i||a)}})),u.update()},forceUpdate:function(){if(!p){var e=f.elements,t=e.reference,n=e.popper;if(Q(t,n)){f.rects={reference:y(t,E(n),"fixed"===f.options.strategy),popper:g(n)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach((function(e){return f.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<f.orderedModifiers.length;r++)if(!0!==f.reset){var o=f.orderedModifiers[r],i=o.fn,a=o.options,s=void 0===a?{}:a,c=o.name;"function"==typeof i&&(f=i({state:f,options:s,name:c,instance:u})||f)}else f.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){u.forceUpdate(),e(f)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(i())}))}))),s}),destroy:function(){l(),p=!0}};if(!Q(e,t))return u;function l(){c.forEach((function(e){return e()})),c=[]}return u.setOptions(r).then((function(e){!p&&r.onFirstUpdate&&r.onFirstUpdate(e)})),u}}var $={passive:!0};var ee={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var n=e.state,r=e.instance,o=e.options,i=o.scroll,a=void 0===i||i,s=o.resize,f=void 0===s||s,c=t(n.elements.popper),p=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&p.forEach((function(e){e.addEventListener("scroll",r.update,$)})),f&&c.addEventListener("resize",r.update,$),function(){a&&p.forEach((function(e){e.removeEventListener("scroll",r.update,$)})),f&&c.removeEventListener("resize",r.update,$)}},data:{}};var te={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=X({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},ne={top:"auto",right:"auto",bottom:"auto",left:"auto"};function re(e){var n,r=e.popper,o=e.popperRect,i=e.placement,a=e.variation,f=e.offsets,c=e.position,p=e.gpuAcceleration,u=e.adaptive,l=e.roundOffsets,h=e.isFixed,v=f.x,y=void 0===v?0:v,g=f.y,b=void 0===g?0:g,x="function"==typeof l?l({x:y,y:b}):{x:y,y:b};y=x.x,b=x.y;var w=f.hasOwnProperty("x"),O=f.hasOwnProperty("y"),j=P,M=D,k=window;if(u){var W=E(r),H="clientHeight",T="clientWidth";if(W===t(r)&&"static"!==m(W=d(r)).position&&"absolute"===c&&(H="scrollHeight",T="scrollWidth"),W=W,i===D||(i===P||i===L)&&a===B)M=A,b-=(h&&W===k&&k.visualViewport?k.visualViewport.height:W[H])-o.height,b*=p?1:-1;if(i===P||(i===D||i===A)&&a===B)j=L,y-=(h&&W===k&&k.visualViewport?k.visualViewport.width:W[T])-o.width,y*=p?1:-1}var R,S=Object.assign({position:c},u&&ne),V=!0===l?function(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:s(n*o)/o||0,y:s(r*o)/o||0}}({x:y,y:b},t(r)):{x:y,y:b};return y=V.x,b=V.y,p?Object.assign({},S,((R={})[M]=O?"0":"",R[j]=w?"0":"",R.transform=(k.devicePixelRatio||1)<=1?"translate("+y+"px, "+b+"px)":"translate3d("+y+"px, "+b+"px, 0)",R)):Object.assign({},S,((n={})[M]=O?b+"px":"",n[j]=w?y+"px":"",n.transform="",n))}var oe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,f=void 0===s||s,c={placement:F(t.placement),variation:U(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,re(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:f})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,re(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var ie={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},i=t.elements[e];r(i)&&l(i)&&(Object.assign(i.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var o=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});r(o)&&l(o)&&(Object.assign(o.style,a),Object.keys(i).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]};var ae={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=S.reduce((function(e,n){return e[n]=function(e,t,n){var r=F(e),o=[P,D].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[P,L].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],f=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}},se={left:"right",right:"left",bottom:"top",top:"bottom"};function fe(e){return e.replace(/left|right|bottom|top/g,(function(e){return se[e]}))}var ce={start:"end",end:"start"};function pe(e){return e.replace(/start|end/g,(function(e){return ce[e]}))}function ue(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,f=n.allowedAutoPlacements,c=void 0===f?S:f,p=U(r),u=p?s?R:R.filter((function(e){return U(e)===p})):k,l=u.filter((function(e){return c.indexOf(e)>=0}));0===l.length&&(l=u);var d=l.reduce((function(t,n){return t[n]=J(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[F(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}var le={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,f=n.fallbackPlacements,c=n.padding,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.flipVariations,h=void 0===d||d,m=n.allowedAutoPlacements,v=t.options.placement,y=F(v),g=f||(y===v||!h?[fe(v)]:function(e){if(F(e)===M)return[];var t=fe(e);return[pe(e),t,pe(t)]}(v)),b=[v].concat(g).reduce((function(e,n){return e.concat(F(n)===M?ue(t,{placement:n,boundary:p,rootBoundary:u,padding:c,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),x=t.rects.reference,w=t.rects.popper,O=new Map,j=!0,E=b[0],k=0;k<b.length;k++){var B=b[k],H=F(B),T=U(B)===W,R=[D,A].indexOf(H)>=0,S=R?"width":"height",V=J(t,{placement:B,boundary:p,rootBoundary:u,altBoundary:l,padding:c}),q=R?T?L:P:T?A:D;x[S]>w[S]&&(q=fe(q));var C=fe(q),N=[];if(i&&N.push(V[H]<=0),s&&N.push(V[q]<=0,V[C]<=0),N.every((function(e){return e}))){E=B,j=!1;break}O.set(B,N)}if(j)for(var I=function(e){var t=b.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},_=h?3:1;_>0;_--){if("break"===I(_))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function de(e,t,n){return i(e,a(t,n))}var he={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=void 0===o||o,f=n.altAxis,c=void 0!==f&&f,p=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.padding,h=n.tether,m=void 0===h||h,v=n.tetherOffset,y=void 0===v?0:v,b=J(t,{boundary:p,rootBoundary:u,padding:d,altBoundary:l}),x=F(t.placement),w=U(t.placement),O=!w,j=z(x),M="x"===j?"y":"x",k=t.modifiersData.popperOffsets,B=t.rects.reference,H=t.rects.popper,T="function"==typeof y?y(Object.assign({},t.rects,{placement:t.placement})):y,R="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,V={x:0,y:0};if(k){if(s){var q,C="y"===j?D:P,N="y"===j?A:L,I="y"===j?"height":"width",_=k[j],X=_+b[C],Y=_-b[N],G=m?-H[I]/2:0,K=w===W?B[I]:H[I],Q=w===W?-H[I]:-B[I],Z=t.elements.arrow,$=m&&Z?g(Z):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[C],ne=ee[N],re=de(0,B[I],$[I]),oe=O?B[I]/2-G-re-te-R.mainAxis:K-re-te-R.mainAxis,ie=O?-B[I]/2+G+re+ne+R.mainAxis:Q+re+ne+R.mainAxis,ae=t.elements.arrow&&E(t.elements.arrow),se=ae?"y"===j?ae.clientTop||0:ae.clientLeft||0:0,fe=null!=(q=null==S?void 0:S[j])?q:0,ce=_+ie-fe,pe=de(m?a(X,_+oe-fe-se):X,_,m?i(Y,ce):Y);k[j]=pe,V[j]=pe-_}if(c){var ue,le="x"===j?D:P,he="x"===j?A:L,me=k[M],ve="y"===M?"height":"width",ye=me+b[le],ge=me-b[he],be=-1!==[D,P].indexOf(x),xe=null!=(ue=null==S?void 0:S[M])?ue:0,we=be?ye:me-B[ve]-H[ve]-xe+R.altAxis,Oe=be?me+B[ve]+H[ve]-xe-R.altAxis:ge,je=m&&be?function(e,t,n){var r=de(e,t,n);return r>n?n:r}(we,me,Oe):de(m?we:ye,me,m?Oe:ge);k[M]=je,V[M]=je-me}t.modifiersData[r]=V}},requiresIfExists:["offset"]};var me={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=F(n.placement),f=z(s),c=[P,L].indexOf(s)>=0?"height":"width";if(i&&a){var p=function(e,t){return Y("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:G(e,k))}(o.padding,n),u=g(i),l="y"===f?D:P,d="y"===f?A:L,h=n.rects.reference[c]+n.rects.reference[f]-a[f]-n.rects.popper[c],m=a[f]-n.rects.reference[f],v=E(i),y=v?"y"===f?v.clientHeight||0:v.clientWidth||0:0,b=h/2-m/2,x=p[l],w=y-u[c]-p[d],O=y/2-u[c]/2+b,j=de(x,O,w),M=f;n.modifiersData[r]=((t={})[M]=j,t.centerOffset=j-O,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&C(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ve(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ye(e){return[D,L,A,P].some((function(t){return e[t]>=0}))}var ge={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=J(t,{elementContext:"reference"}),s=J(t,{altBoundary:!0}),f=ve(a,r),c=ve(s,o,i),p=ye(f),u=ye(c);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":u})}},be=Z({defaultModifiers:[ee,te,oe,ie]}),xe=[ee,te,oe,ie,ae,le,he,me,ge],we=Z({defaultModifiers:xe});e.applyStyles=ie,e.arrow=me,e.computeStyles=oe,e.createPopper=we,e.createPopperLite=be,e.defaultModifiers=xe,e.detectOverflow=J,e.eventListeners=ee,e.flip=le,e.hide=ge,e.offset=ae,e.popperGenerator=Z,e.popperOffsets=te,e.preventOverflow=he,Object.defineProperty(e,"__esModule",{value:!0})}));
+//# sourceMappingURL=popper.min.js.map
diff -Nru xnote-4.1.12/chrome/content/tooltip/tippy/tippy-debug.js xnote-4.5.48/chrome/content/tooltip/tippy/tippy-debug.js
--- xnote-4.1.12/chrome/content/tooltip/tippy/tippy-debug.js 1970-01-01 01:00:00.000000000 +0100
+++ xnote-4.5.48/chrome/content/tooltip/tippy/tippy-debug.js 2024-08-04 15:31:58.000000000 +0200
@@ -0,0 +1,2614 @@
+/**!
+* tippy.js v5.2.1
+* (c) 2017-2020 atomiks
+* MIT License
+*/
+var tippy = (function (Popper) {
+ 'use strict';
+
+ Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;
+
+ var css = ".tippy-tooltip[data-animation=fade][data-state=hidden]{opacity:0}.tippy-iOS{cursor:pointer!important;-webkit-tap-highlight-color:transparent}.tippy-popper{pointer-events:none;max-width:calc(100vw - 10px);transition-timing-function:cubic-bezier(.165,.84,.44,1);transition-property:transform}.tippy-tooltip{position:relative;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;background-color:#333;transition-property:visibility,opacity,transform;outline:0}.tippy-tooltip[data-placement^=top]>.tippy-arrow{border-width:8px 8px 0;border-top-color:#333;margin:0 3px;transform-origin:50% 0;bottom:-7px}.tippy-tooltip[data-placement^=bottom]>.tippy-arrow{border-width:0 8px 8px;border-bottom-color:#333;margin:0 3px;transform-origin:50% 7px;top:-7px}.tippy-tooltip[data-placement^=left]>.tippy-arrow{border-width:8px 0 8px 8px;border-left-color:#333;margin:3px 0;transform-origin:0 50%;right:-7px}.tippy-tooltip[data-placement^=right]>.tippy-arrow{border-width:8px 8px 8px 0;border-right-color:#333;margin:3px 0;transform-origin:7px 50%;left:-7px}.tippy-tooltip[data-interactive][data-state=visible]{pointer-events:auto}.tippy-tooltip[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{position:absolute;border-color:transparent;border-style:solid}.tippy-content{padding:5px 9px}";
+
+ /**
+ * Injects a string of CSS styles to a style node in <head>
+ */
+ function injectCSS(css) {
+ var style = document.createElement('style');
+ style.textContent = css;
+ style.setAttribute('data-tippy-stylesheet', '');
+ var head = document.head;
+ var firstStyleOrLinkTag = document.querySelector('head>style,head>link');
+
+ if (firstStyleOrLinkTag) {
+ head.insertBefore(style, firstStyleOrLinkTag);
+ } else {
+ head.appendChild(style);
+ }
+ }
+
+ function _extends() {
+ _extends = Object.assign || function (target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i];
+
+ for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ }
+
+ return target;
+ };
+
+ return _extends.apply(this, arguments);
+ }
+
+ var PASSIVE = {
+ passive: true
+ };
+ var ROUND_ARROW = '<svg viewBox="0 0 18 7" xmlns="http://www.w3.org/2000/svg"><path d="M0 7s2.021-.015 5.253-4.218C6.584 1.051 7.797.007 9 0c1.203-.007 2.416 1.035 3.761 2.782C16.012 7.005 18 7 18 7H0z"/></svg>';
+ var IOS_CLASS = "tippy-iOS";
+ var POPPER_CLASS = "tippy-popper";
+ var TOOLTIP_CLASS = "tippy-tooltip";
+ var CONTENT_CLASS = "tippy-content";
+ var BACKDROP_CLASS = "tippy-backdrop";
+ var ARROW_CLASS = "tippy-arrow";
+ var SVG_ARROW_CLASS = "tippy-svg-arrow";
+ var POPPER_SELECTOR = "." + POPPER_CLASS;
+ var TOOLTIP_SELECTOR = "." + TOOLTIP_CLASS;
+ var CONTENT_SELECTOR = "." + CONTENT_CLASS;
+ var ARROW_SELECTOR = "." + ARROW_CLASS;
+ var SVG_ARROW_SELECTOR = "." + SVG_ARROW_CLASS;
+
+ /**
+ * Triggers reflow
+ */
+ function reflow(element) {
+ void element.offsetHeight;
+ }
+ /**
+ * Sets the innerHTML of an element
+ */
+
+ function setInnerHTML(element, html) {
+ element[innerHTML()] = html;
+ }
+ /**
+ * Determines if the value is a reference element
+ */
+
+ function isReferenceElement(value) {
+ return !!(value && value._tippy && value._tippy.reference === value);
+ }
+ /**
+ * Safe .hasOwnProperty check, for prototype-less objects
+ */
+
+ function hasOwnProperty(obj, key) {
+ return {}.hasOwnProperty.call(obj, key);
+ }
+ /**
+ * Returns an array of elements based on the value
+ */
+
+ function getArrayOfElements(value) {
+ if (isElement(value)) {
+ return [value];
+ }
+
+ if (isNodeList(value)) {
+ return arrayFrom(value);
+ }
+
+ if (Array.isArray(value)) {
+ return value;
+ }
+
+ return arrayFrom(document.querySelectorAll(value));
+ }
+ /**
+ * Returns a value at a given index depending on if it's an array or number
+ */
+
+ function getValueAtIndexOrReturn(value, index, defaultValue) {
+ if (Array.isArray(value)) {
+ var v = value[index];
+ return v == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v;
+ }
+
+ return value;
+ }
+ /**
+ * Prevents errors from being thrown while accessing nested modifier objects
+ * in `popperOptions`
+ */
+
+ function getModifier(obj, key) {
+ return obj && obj.modifiers && obj.modifiers[key];
+ }
+ /**
+ * Determines if the value is of type
+ */
+
+ function isType(value, type) {
+ var str = {}.toString.call(value);
+ return str.indexOf('[object') === 0 && str.indexOf(type + "]") > -1;
+ }
+ /**
+ * Determines if the value is of type Element
+ */
+
+ function isElement(value) {
+ return isType(value, 'Element');
+ }
+ /**
+ * Determines if the value is of type NodeList
+ */
+
+ function isNodeList(value) {
+ return isType(value, 'NodeList');
+ }
+ /**
+ * Determines if the value is of type MouseEvent
+ */
+
+ function isMouseEvent(value) {
+ return isType(value, 'MouseEvent');
+ }
+ /**
+ * Firefox extensions don't allow setting .innerHTML directly, this will trick
+ * it
+ */
+
+ function innerHTML() {
+ return 'innerHTML';
+ }
+ /**
+ * Evaluates a function if one, or returns the value
+ */
+
+ function invokeWithArgsOrReturn(value, args) {
+ return typeof value === 'function' ? value.apply(void 0, args) : value;
+ }
+ /**
+ * Sets a popperInstance modifier's property to a value
+ */
+
+ function setModifierValue(modifiers, name, property, value) {
+ modifiers.filter(function (m) {
+ return m.name === name;
+ })[0][property] = value;
+ }
+ /**
+ * Returns a new `div` element
+ */
+
+ function div() {
+ return document.createElement('div');
+ }
+ /**
+ * Applies a transition duration to a list of elements
+ */
+
+ function setTransitionDuration(els, value) {
+ els.forEach(function (el) {
+ if (el) {
+ el.style.transitionDuration = value + "ms";
+ }
+ });
+ }
+ /**
+ * Sets the visibility state to elements so they can begin to transition
+ */
+
+ function setVisibilityState(els, state) {
+ els.forEach(function (el) {
+ if (el) {
+ el.setAttribute('data-state', state);
+ }
+ });
+ }
+ /**
+ * Debounce utility. To avoid bloating bundle size, we're only passing 1
+ * argument here, a more generic function would pass all arguments. Only
+ * `onMouseMove` uses this which takes the event object for now.
+ */
+
+ function debounce(fn, ms) {
+ // Avoid wrapping in `setTimeout` if ms is 0 anyway
+ if (ms === 0) {
+ return fn;
+ }
+
+ var timeout;
+ return function (arg) {
+ clearTimeout(timeout);
+ timeout = setTimeout(function () {
+ fn(arg);
+ }, ms);
+ };
+ }
+ /**
+ * Preserves the original function invocation when another function replaces it
+ */
+
+ function preserveInvocation(originalFn, currentFn, args) {
+ if (originalFn && originalFn !== currentFn) {
+ originalFn.apply(void 0, args);
+ }
+ }
+ /**
+ * Deletes properties from an object (pure)
+ */
+
+ function removeProperties(obj, keys) {
+ var clone = _extends({}, obj);
+
+ keys.forEach(function (key) {
+ delete clone[key];
+ });
+ return clone;
+ }
+ /**
+ * Ponyfill for Array.from - converts iterable values to an array
+ */
+
+ function arrayFrom(value) {
+ return [].slice.call(value);
+ }
+ /**
+ * Works like Element.prototype.closest, but uses a callback instead
+ */
+
+ function closestCallback(element, callback) {
+ while (element) {
+ if (callback(element)) {
+ return element;
+ }
+
+ element = element.parentElement;
+ }
+
+ return null;
+ }
+ /**
+ * Determines if an array or string includes a string
+ */
+
+ function includes(a, b) {
+ return a.indexOf(b) > -1;
+ }
+ /**
+ * Creates an array from string of values separated by whitespace
+ */
+
+ function splitBySpaces(value) {
+ return value.split(/\s+/).filter(Boolean);
+ }
+ /**
+ * Returns the `nextValue` if `nextValue` is not `undefined`, otherwise returns
+ * `currentValue`
+ */
+
+ function useIfDefined(nextValue, currentValue) {
+ return nextValue !== undefined ? nextValue : currentValue;
+ }
+ /**
+ * Converts a value that's an array or single value to an array
+ */
+
+ function normalizeToArray(value) {
+ return [].concat(value);
+ }
+ /**
+ * Returns the ownerDocument of the first available element, otherwise global
+ * document
+ */
+
+ function getOwnerDocument(elementOrElements) {
+ var _normalizeToArray = normalizeToArray(elementOrElements),
+ element = _normalizeToArray[0];
+
+ return element ? element.ownerDocument || document : document;
+ }
+ /**
+ * Adds item to array if array does not contain it
+ */
+
+ function pushIfUnique(arr, value) {
+ if (arr.indexOf(value) === -1) {
+ arr.push(value);
+ }
+ }
+ /**
+ * Adds `px` if value is a number, or returns it directly
+ */
+
+ function appendPxIfNumber(value) {
+ return typeof value === 'number' ? value + "px" : value;
+ }
+ /**
+ * Filters out duplicate elements in an array
+ */
+
+ function unique(arr) {
+ return arr.filter(function (item, index) {
+ return arr.indexOf(item) === index;
+ });
+ }
+ /**
+ * Returns number from number or CSS units string
+ */
+
+ function getNumber(value) {
+ return typeof value === 'number' ? value : parseFloat(value);
+ }
+ /**
+ * Gets number or CSS string units in pixels (e.g. `1rem` -> 16)
+ */
+
+ function getUnitsInPx(doc, value) {
+ var isRem = typeof value === 'string' && includes(value, 'rem');
+ var html = doc.documentElement;
+ var rootFontSize = 16;
+
+ if (html && isRem) {
+ return parseFloat(getComputedStyle(html).fontSize || String(rootFontSize)) * getNumber(value);
+ }
+
+ return getNumber(value);
+ }
+ /**
+ * Adds the `distancePx` value to the placement of a Popper.Padding object
+ */
+
+ function getComputedPadding(basePlacement, padding, distancePx) {
+ if (padding === void 0) {
+ padding = 5;
+ }
+
+ var freshPaddingObject = {
+ top: 0,
+ right: 0,
+ bottom: 0,
+ left: 0
+ };
+ var keys = Object.keys(freshPaddingObject);
+ return keys.reduce(function (obj, key) {
+ obj[key] = typeof padding === 'number' ? padding : padding[key];
+
+ if (basePlacement === key) {
+ obj[key] = typeof padding === 'number' ? padding + distancePx : padding[basePlacement] + distancePx;
+ }
+
+ return obj;
+ }, freshPaddingObject);
+ }
+
+ var currentInput = {
+ isTouch: false
+ };
+ var lastMouseMoveTime = 0;
+ /**
+ * When a `touchstart` event is fired, it's assumed the user is using touch
+ * input. We'll bind a `mousemove` event listener to listen for mouse input in
+ * the future. This way, the `isTouch` property is fully dynamic and will handle
+ * hybrid devices that use a mix of touch + mouse input.
+ */
+
+ function onDocumentTouchStart() {
+ if (currentInput.isTouch) {
+ return;
+ }
+
+ currentInput.isTouch = true;
+
+ if (window.performance) {
+ document.addEventListener('mousemove', onDocumentMouseMove);
+ }
+ }
+ /**
+ * When two `mousemove` event are fired consecutively within 20ms, it's assumed
+ * the user is using mouse input again. `mousemove` can fire on touch devices as
+ * well, but very rarely that quickly.
+ */
+
+ function onDocumentMouseMove() {
+ var now = performance.now();
+
+ if (now - lastMouseMoveTime < 20) {
+ currentInput.isTouch = false;
+ document.removeEventListener('mousemove', onDocumentMouseMove);
+ }
+
+ lastMouseMoveTime = now;
+ }
+ /**
+ * When an element is in focus and has a tippy, leaving the tab/window and
+ * returning causes it to show again. For mouse users this is unexpected, but
+ * for keyboard use it makes sense.
+ * TODO: find a better technique to solve this problem
+ */
+
+ function onWindowBlur() {
+ var activeElement = document.activeElement;
+
+ if (isReferenceElement(activeElement)) {
+ var instance = activeElement._tippy;
+
+ if (activeElement.blur && !instance.state.isVisible) {
+ activeElement.blur();
+ }
+ }
+ }
+ /**
+ * Adds the needed global event listeners
+ */
+
+ function bindGlobalEventListeners() {
+ document.addEventListener('touchstart', onDocumentTouchStart, _extends({}, PASSIVE, {
+ capture: true
+ }));
+ window.addEventListener('blur', onWindowBlur);
+ }
+
+ var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
+ var ua = isBrowser ? navigator.userAgent : '';
+ var isIE = /MSIE |Trident\//.test(ua);
+ var isIOS = isBrowser && /iPhone|iPad|iPod/.test(navigator.platform);
+ function updateIOSClass(isAdd) {
+ var shouldAdd = isAdd && isIOS && currentInput.isTouch;
+ document.body.classList[shouldAdd ? 'add' : 'remove'](IOS_CLASS);
+ }
+
+ var version = "5.2.1";
+
+ function createMemoryLeakWarning(method) {
+ var txt = method === 'destroy' ? 'n already-' : ' ';
+ return "\n " + method + "() was called on a" + txt + "destroyed instance. This is a no-op but\n indicates a potential memory leak.\n ";
+ }
+ function clean(value) {
+ var spacesAndTabs = /[ \t]{2,}/g;
+ var lineStartWithSpaces = /^[ \t]*/gm;
+ return value.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim();
+ }
+
+ function getDevMessage(message) {
+ return clean("\n %ctippy.js\n\n %c" + clean(message) + "\n\n %c\uD83D\uDC77\u200D This is a development-only message. It will be removed in production.\n ");
+ }
+
+ function getFormattedMessage(message) {
+ return [getDevMessage(message), // title
+ 'color: #00C584; font-size: 1.3em; font-weight: bold;', // message
+ 'line-height: 1.5', // footer
+ 'color: #a6a095;'];
+ }
+ /**
+ * Helpful wrapper around `console.warn()`.
+ * TODO: Should we use a cache so it only warns a single time and not spam the
+ * console? (Need to consider hot reloading and invalidation though). Chrome
+ * already batches warnings as well.
+ */
+
+ function warnWhen(condition, message) {
+ if (condition) {
+ var _console;
+
+ (_console = console).warn.apply(_console, getFormattedMessage(message));
+ }
+ }
+ /**
+ * Helpful wrapper around `console.error()`
+ */
+
+ function errorWhen(condition, message) {
+ if (condition) {
+ var _console2;
+
+ (_console2 = console).error.apply(_console2, getFormattedMessage(message));
+ }
+ }
+ /**
+ * Validates the `targets` value passed to `tippy()`
+ */
+
+ function validateTargets(targets) {
+ var didPassFalsyValue = !targets;
+ var didPassPlainObject = Object.prototype.toString.call(targets) === '[object Object]' && !targets.addEventListener;
+ errorWhen(didPassFalsyValue, ['tippy() was passed', '`' + String(targets) + '`', 'as its targets (first) argument. Valid types are: String, Element, Element[],', 'or NodeList.'].join(' '));
+ errorWhen(didPassPlainObject, ['tippy() was passed a plain object which is no longer supported as an argument.', 'See: https://atomiks.github.io/tippyjs/misc/#custom-position'].join(' '));
+ }
+
+ var pluginProps = {
+ animateFill: false,
+ followCursor: false,
+ inlinePositioning: false,
+ sticky: false
+ };
+ var defaultProps = _extends({
+ allowHTML: true,
+ animation: 'fade',
+ appendTo: function appendTo() {
+ return document.body;
+ },
+ aria: 'describedby',
+ arrow: true,
+ boundary: 'scrollParent',
+ content: '',
+ delay: 0,
+ distance: 10,
+ duration: [300, 250],
+ flip: true,
+ flipBehavior: 'flip',
+ flipOnUpdate: false,
+ hideOnClick: true,
+ ignoreAttributes: false,
+ inertia: false,
+ interactive: false,
+ interactiveBorder: 2,
+ interactiveDebounce: 0,
+ lazy: true,
+ maxWidth: 350,
+ multiple: false,
+ offset: 0,
+ onAfterUpdate: function onAfterUpdate() {},
+ onBeforeUpdate: function onBeforeUpdate() {},
+ onCreate: function onCreate() {},
+ onDestroy: function onDestroy() {},
+ onHidden: function onHidden() {},
+ onHide: function onHide() {},
+ onMount: function onMount() {},
+ onShow: function onShow() {},
+ onShown: function onShown() {},
+ onTrigger: function onTrigger() {},
+ onUntrigger: function onUntrigger() {},
+ placement: 'top',
+ plugins: [],
+ popperOptions: {},
+ role: 'tooltip',
+ showOnCreate: false,
+ theme: '',
+ touch: true,
+ trigger: 'mouseenter focus',
+ triggerTarget: null,
+ updateDuration: 0,
+ zIndex: 9999
+ }, pluginProps);
+ var defaultKeys = Object.keys(defaultProps);
+ /**
+ * If the setProps() method encounters one of these, the popperInstance must be
+ * recreated
+ */
+
+ var POPPER_INSTANCE_DEPENDENCIES = ['arrow', 'boundary', 'distance', 'flip', 'flipBehavior', 'flipOnUpdate', 'offset', 'placement', 'popperOptions'];
+ /**
+ * Mutates the defaultProps object by setting the props specified
+ */
+
+ var setDefaultProps = function setDefaultProps(partialProps) {
+ {
+ validateProps(partialProps, []);
+ }
+
+ var keys = Object.keys(partialProps);
+ keys.forEach(function (key) {
+ defaultProps[key] = partialProps[key];
+ });
+ };
+ /**
+ * Returns an extended props object including plugin props
+ */
+
+ function getExtendedPassedProps(passedProps) {
+ var plugins = passedProps.plugins || [];
+ var pluginProps = plugins.reduce(function (acc, plugin) {
+ var name = plugin.name,
+ defaultValue = plugin.defaultValue;
+
+ if (name) {
+ acc[name] = passedProps[name] !== undefined ? passedProps[name] : defaultValue;
+ }
+
+ return acc;
+ }, {});
+ return _extends({}, passedProps, {}, pluginProps);
+ }
+ /**
+ * Returns an object of optional props from data-tippy-* attributes
+ */
+
+ function getDataAttributeProps(reference, plugins) {
+ var propKeys = plugins ? Object.keys(getExtendedPassedProps(_extends({}, defaultProps, {
+ plugins: plugins
+ }))) : defaultKeys;
+ var props = propKeys.reduce(function (acc, key) {
+ var valueAsString = (reference.getAttribute("data-tippy-" + key) || '').trim();
+
+ if (!valueAsString) {
+ return acc;
+ }
+
+ if (key === 'content') {
+ acc[key] = valueAsString;
+ } else {
+ try {
+ acc[key] = JSON.parse(valueAsString);
+ } catch (e) {
+ acc[key] = valueAsString;
+ }
+ }
+
+ return acc;
+ }, {});
+ return props;
+ }
+ /**
+ * Evaluates the props object by merging data attributes and disabling
+ * conflicting props where necessary
+ */
+
+ function evaluateProps(reference, props) {
+ var out = _extends({}, props, {
+ content: invokeWithArgsOrReturn(props.content, [reference])
+ }, props.ignoreAttributes ? {} : getDataAttributeProps(reference, props.plugins));
+
+ if (out.interactive) {
+ out.aria = null;
+ }
+
+ return out;
+ }
+ /**
+ * Validates props with the valid `defaultProps` object
+ */
+
+ function validateProps(partialProps, plugins) {
+ if (partialProps === void 0) {
+ partialProps = {};
+ }
+
+ if (plugins === void 0) {
+ plugins = [];
+ }
+
+ var keys = Object.keys(partialProps);
+ keys.forEach(function (prop) {
+ var value = partialProps[prop];
+ var didSpecifyPlacementInPopperOptions = prop === 'popperOptions' && value !== null && typeof value === 'object' && hasOwnProperty(value, 'placement');
+ var nonPluginProps = removeProperties(defaultProps, ['animateFill', 'followCursor', 'inlinePositioning', 'sticky']); // These props have custom warnings
+
+ var customWarningProps = ['a11y', 'arrowType', 'showOnInit', 'size', 'target', 'touchHold'];
+ var didPassUnknownProp = !hasOwnProperty(nonPluginProps, prop) && !includes(customWarningProps, prop); // Check if the prop exists in `plugins`
+
+ if (didPassUnknownProp) {
+ didPassUnknownProp = plugins.filter(function (plugin) {
+ return plugin.name === prop;
+ }).length === 0;
+ }
+
+ warnWhen(prop === 'target', ['The `target` prop was removed in v5 and replaced with the delegate() addon', 'in order to conserve bundle size.', 'See: https://atomiks.github.io/tippyjs/addons/#event-delegation'].join(' '));
+ warnWhen(prop === 'a11y', ['The `a11y` prop was removed in v5. Make sure the element you are giving a', 'tippy to is natively focusable, such as <button> or <input>, not <div>', 'or <span>.'].join(' '));
+ warnWhen(prop === 'showOnInit', 'The `showOnInit` prop was renamed to `showOnCreate` in v5.');
+ warnWhen(prop === 'arrowType', ['The `arrowType` prop was removed in v5 in favor of overloading the `arrow`', 'prop.', '\n\n', '"round" string was replaced with importing the string from the package.', '\n\n', "* import {roundArrow} from 'tippy.js'; (ESM version)\n", '* const {roundArrow} = tippy; (IIFE CDN version)', '\n\n', 'Before: {arrow: true, arrowType: "round"}\n', 'After: {arrow: roundArrow}`'].join(' '));
+ warnWhen(prop === 'touchHold', ['The `touchHold` prop was removed in v5 in favor of overloading the `touch`', 'prop.', '\n\n', 'Before: {touchHold: true}\n', 'After: {touch: "hold"}'].join(' '));
+ warnWhen(prop === 'size', ['The `size` prop was removed in v5. Instead, use a theme that specifies', 'CSS padding and font-size properties.'].join(' '));
+ warnWhen(prop === 'theme' && value === 'google', 'The included theme "google" was renamed to "material" in v5.');
+ warnWhen(didSpecifyPlacementInPopperOptions, ['Specifying placement in `popperOptions` is not supported. Use the base-level', '`placement` prop instead.', '\n\n', 'Before: {popperOptions: {placement: "bottom"}}\n', 'After: {placement: "bottom"}'].join(' '));
+ warnWhen(didPassUnknownProp, ["`" + prop + "`", "is not a valid prop. You may have spelled it incorrectly, or if it's a", 'plugin, forgot to pass it in an array as props.plugins.', '\n\n', 'In v5, the following props were turned into plugins:', '\n\n', '* animateFill\n', '* followCursor\n', '* sticky', '\n\n', 'All props: https://atomiks.github.io/tippyjs/all-props/\n', 'Plugins: https://atomiks.github.io/tippyjs/plugins/'].join(' '));
+ });
+ }
+
+ /**
+ * Returns the popper's placement, ignoring shifting (top-start, etc)
+ */
+
+ function getBasePlacement(placement) {
+ return placement.split('-')[0];
+ }
+ /**
+ * Adds `data-inertia` attribute
+ */
+
+ function addInertia(tooltip) {
+ tooltip.setAttribute('data-inertia', '');
+ }
+ /**
+ * Removes `data-inertia` attribute
+ */
+
+ function removeInertia(tooltip) {
+ tooltip.removeAttribute('data-inertia');
+ }
+ /**
+ * Adds interactive-related attributes
+ */
+
+ function addInteractive(tooltip) {
+ tooltip.setAttribute('data-interactive', '');
+ }
+ /**
+ * Removes interactive-related attributes
+ */
+
+ function removeInteractive(tooltip) {
+ tooltip.removeAttribute('data-interactive');
+ }
+ /**
+ * Sets the content of a tooltip
+ */
+
+ function setContent(contentEl, props) {
+ if (isElement(props.content)) {
+ setInnerHTML(contentEl, '');
+ contentEl.appendChild(props.content);
+ } else if (typeof props.content !== 'function') {
+ var key = props.allowHTML ? 'innerHTML' : 'textContent';
+ contentEl[key] = props.content;
+ }
+ }
+ /**
+ * Returns the child elements of a popper element
+ */
+
+ function getChildren(popper) {
+ return {
+ tooltip: popper.querySelector(TOOLTIP_SELECTOR),
+ content: popper.querySelector(CONTENT_SELECTOR),
+ arrow: popper.querySelector(ARROW_SELECTOR) || popper.querySelector(SVG_ARROW_SELECTOR)
+ };
+ }
+ /**
+ * Creates an arrow element and returns it
+ */
+
+ function createArrowElement(arrow) {
+ var arrowElement = div();
+
+ if (arrow === true) {
+ arrowElement.className = ARROW_CLASS;
+ } else {
+ arrowElement.className = SVG_ARROW_CLASS;
+
+ if (isElement(arrow)) {
+ arrowElement.appendChild(arrow);
+ } else {
+ setInnerHTML(arrowElement, arrow);
+ }
+ }
+
+ return arrowElement;
+ }
+ /**
+ * Constructs the popper element and returns it
+ */
+
+ function createPopperElement(id, props) {
+ var popper = div();
+ popper.className = POPPER_CLASS;
+ popper.style.position = 'absolute';
+ popper.style.top = '0';
+ popper.style.left = '0';
+ var tooltip = div();
+ tooltip.className = TOOLTIP_CLASS;
+ tooltip.id = "tippy-" + id;
+ tooltip.setAttribute('data-state', 'hidden');
+ tooltip.setAttribute('tabindex', '-1');
+ updateTheme(tooltip, 'add', props.theme);
+ var content = div();
+ content.className = CONTENT_CLASS;
+ content.setAttribute('data-state', 'hidden');
+
+ if (props.interactive) {
+ addInteractive(tooltip);
+ }
+
+ if (props.arrow) {
+ tooltip.setAttribute('data-arrow', '');
+ tooltip.appendChild(createArrowElement(props.arrow));
+ }
+
+ if (props.inertia) {
+ addInertia(tooltip);
+ }
+
+ setContent(content, props);
+ tooltip.appendChild(content);
+ popper.appendChild(tooltip);
+ updatePopperElement(popper, props, props);
+ return popper;
+ }
+ /**
+ * Updates the popper element based on the new props
+ */
+
+ function updatePopperElement(popper, prevProps, nextProps) {
+ var _getChildren = getChildren(popper),
+ tooltip = _getChildren.tooltip,
+ content = _getChildren.content,
+ arrow = _getChildren.arrow;
+
+ popper.style.zIndex = '' + nextProps.zIndex;
+ tooltip.setAttribute('data-animation', nextProps.animation);
+ tooltip.style.maxWidth = appendPxIfNumber(nextProps.maxWidth);
+
+ if (nextProps.role) {
+ tooltip.setAttribute('role', nextProps.role);
+ } else {
+ tooltip.removeAttribute('role');
+ }
+
+ if (prevProps.content !== nextProps.content) {
+ setContent(content, nextProps);
+ } // arrow
+
+
+ if (!prevProps.arrow && nextProps.arrow) {
+ // false to true
+ tooltip.appendChild(createArrowElement(nextProps.arrow));
+ tooltip.setAttribute('data-arrow', '');
+ } else if (prevProps.arrow && !nextProps.arrow) {
+ // true to false
+ tooltip.removeChild(arrow);
+ tooltip.removeAttribute('data-arrow');
+ } else if (prevProps.arrow !== nextProps.arrow) {
+ // true to 'round' or vice-versa
+ tooltip.removeChild(arrow);
+ tooltip.appendChild(createArrowElement(nextProps.arrow));
+ } // interactive
+
+
+ if (!prevProps.interactive && nextProps.interactive) {
+ addInteractive(tooltip);
+ } else if (prevProps.interactive && !nextProps.interactive) {
+ removeInteractive(tooltip);
+ } // inertia
+
+
+ if (!prevProps.inertia && nextProps.inertia) {
+ addInertia(tooltip);
+ } else if (prevProps.inertia && !nextProps.inertia) {
+ removeInertia(tooltip);
+ } // theme
+
+
+ if (prevProps.theme !== nextProps.theme) {
+ updateTheme(tooltip, 'remove', prevProps.theme);
+ updateTheme(tooltip, 'add', nextProps.theme);
+ }
+ }
+ /**
+ * Add/remove transitionend listener from tooltip
+ */
+
+ function updateTransitionEndListener(tooltip, action, listener) {
+ ['transitionend', 'webkitTransitionEnd'].forEach(function (event) {
+ tooltip[action + 'EventListener'](event, listener);
+ });
+ }
+ /**
+ * Adds/removes theme from tooltip's classList
+ */
+
+ function updateTheme(tooltip, action, theme) {
+ splitBySpaces(theme).forEach(function (name) {
+ tooltip.classList[action](name + "-theme");
+ });
+ }
+ /**
+ * Determines if the mouse cursor is outside of the popper's interactive border
+ * region
+ */
+
+ function isCursorOutsideInteractiveBorder(popperTreeData, event) {
+ var clientX = event.clientX,
+ clientY = event.clientY;
+ return popperTreeData.every(function (_ref) {
+ var popperRect = _ref.popperRect,
+ tooltipRect = _ref.tooltipRect,
+ interactiveBorder = _ref.interactiveBorder;
+ // Get min/max bounds of both the popper and tooltip rects due to
+ // `distance` offset
+ var mergedRect = {
+ top: Math.min(popperRect.top, tooltipRect.top),
+ right: Math.max(popperRect.right, tooltipRect.right),
+ bottom: Math.max(popperRect.bottom, tooltipRect.bottom),
+ left: Math.min(popperRect.left, tooltipRect.left)
+ };
+ var exceedsTop = mergedRect.top - clientY > interactiveBorder;
+ var exceedsBottom = clientY - mergedRect.bottom > interactiveBorder;
+ var exceedsLeft = mergedRect.left - clientX > interactiveBorder;
+ var exceedsRight = clientX - mergedRect.right > interactiveBorder;
+ return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight;
+ });
+ }
+
+ var idCounter = 1;
+ var mouseMoveListeners = [];
+ /**
+ * Used by `hideAll()`
+ */
+
+ var mountedInstances = [];
+ /**
+ * Creates and returns a Tippy object. We're using a closure pattern instead of
+ * a class so that the exposed object API is clean without private members
+ * prefixed with `_`.
+ */
+
+ function createTippy(reference, passedProps) {
+ var props = evaluateProps(reference, _extends({}, defaultProps, {}, getExtendedPassedProps(passedProps))); // If the reference shouldn't have multiple tippys, return null early
+
+ if (!props.multiple && reference._tippy) {
+ return null;
+ }
+ /* ======================= ? Private members ? ======================= */
+
+
+ var showTimeout;
+ var hideTimeout;
+ var scheduleHideAnimationFrame;
+ var isBeingDestroyed = false;
+ var isVisibleFromClick = false;
+ var didHideDueToDocumentMouseDown = false;
+ var popperUpdates = 0;
+ var lastTriggerEvent;
+ var currentMountCallback;
+ var currentTransitionEndListener;
+ var listeners = [];
+ var debouncedOnMouseMove = debounce(onMouseMove, props.interactiveDebounce);
+ var currentTarget; // Support iframe contexts
+ // Static check that assumes any of the `triggerTarget` or `reference`
+ // nodes will never change documents, even when they are updated
+
+ var doc = getOwnerDocument(props.triggerTarget || reference);
+ /* ======================= ? Public members ? ======================= */
+
+ var id = idCounter++;
+ var popper = createPopperElement(id, props);
+ var popperChildren = getChildren(popper);
+ var popperInstance = null;
+ var plugins = unique(props.plugins); // These two elements are static
+
+ var tooltip = popperChildren.tooltip,
+ content = popperChildren.content;
+ var transitionableElements = [tooltip, content];
+ var state = {
+ // The current real placement (`data-placement` attribute)
+ currentPlacement: null,
+ // Is the instance currently enabled?
+ isEnabled: true,
+ // Is the tippy currently showing and not transitioning out?
+ isVisible: false,
+ // Has the instance been destroyed?
+ isDestroyed: false,
+ // Is the tippy currently mounted to the DOM?
+ isMounted: false,
+ // Has the tippy finished transitioning in?
+ isShown: false
+ };
+ var instance = {
+ // properties
+ id: id,
+ reference: reference,
+ popper: popper,
+ popperChildren: popperChildren,
+ popperInstance: popperInstance,
+ props: props,
+ state: state,
+ plugins: plugins,
+ // methods
+ clearDelayTimeouts: clearDelayTimeouts,
+ setProps: setProps,
+ setContent: setContent,
+ show: show,
+ hide: hide,
+ enable: enable,
+ disable: disable,
+ destroy: destroy
+ };
+ /* ==================== Initial instance mutations =================== */
+
+ reference._tippy = instance;
+ popper._tippy = instance;
+ var pluginsHooks = plugins.map(function (plugin) {
+ return plugin.fn(instance);
+ });
+ var hadAriaExpandedAttributeOnCreate = reference.hasAttribute('aria-expanded');
+ addListenersToTriggerTarget();
+ handleAriaExpandedAttribute();
+
+ if (!props.lazy) {
+ createPopperInstance();
+ }
+
+ invokeHook('onCreate', [instance]);
+
+ if (props.showOnCreate) {
+ scheduleShow();
+ } // Prevent a tippy with a delay from hiding if the cursor left then returned
+ // before it started hiding
+
+
+ popper.addEventListener('mouseenter', function () {
+ if (instance.props.interactive && instance.state.isVisible) {
+ instance.clearDelayTimeouts();
+ }
+ });
+ popper.addEventListener('mouseleave', function (event) {
+ if (instance.props.interactive && includes(instance.props.trigger, 'mouseenter')) {
+ debouncedOnMouseMove(event);
+ doc.addEventListener('mousemove', debouncedOnMouseMove);
+ }
+ });
+ return instance;
+ /* ======================= ? Private methods ? ======================= */
+
+ function getNormalizedTouchSettings() {
+ var touch = instance.props.touch;
+ return Array.isArray(touch) ? touch : [touch, 0];
+ }
+
+ function getIsCustomTouchBehavior() {
+ return getNormalizedTouchSettings()[0] === 'hold';
+ }
+
+ function getCurrentTarget() {
+ return currentTarget || reference;
+ }
+
+ function getDelay(isShow) {
+ // For touch or keyboard input, force `0` delay for UX reasons
+ // Also if the instance is mounted but not visible (transitioning out),
+ // ignore delay
+ if (instance.state.isMounted && !instance.state.isVisible || currentInput.isTouch || lastTriggerEvent && lastTriggerEvent.type === 'focus') {
+ return 0;
+ }
+
+ return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps.delay);
+ }
+
+ function invokeHook(hook, args, shouldInvokePropsHook) {
+ if (shouldInvokePropsHook === void 0) {
+ shouldInvokePropsHook = true;
+ }
+
+ pluginsHooks.forEach(function (pluginHooks) {
+ if (hasOwnProperty(pluginHooks, hook)) {
+ // @ts-ignore
+ pluginHooks[hook].apply(pluginHooks, args);
+ }
+ });
+
+ if (shouldInvokePropsHook) {
+ var _instance$props;
+
+ // @ts-ignore
+ (_instance$props = instance.props)[hook].apply(_instance$props, args);
+ }
+ }
+
+ function handleAriaDescribedByAttribute() {
+ var aria = instance.props.aria;
+
+ if (!aria) {
+ return;
+ }
+
+ var attr = "aria-" + aria;
+ var id = tooltip.id;
+ var nodes = normalizeToArray(instance.props.triggerTarget || reference);
+ nodes.forEach(function (node) {
+ var currentValue = node.getAttribute(attr);
+
+ if (instance.state.isVisible) {
+ node.setAttribute(attr, currentValue ? currentValue + " " + id : id);
+ } else {
+ var nextValue = currentValue && currentValue.replace(id, '').trim();
+
+ if (nextValue) {
+ node.setAttribute(attr, nextValue);
+ } else {
+ node.removeAttribute(attr);
+ }
+ }
+ });
+ }
+
+ function handleAriaExpandedAttribute() {
+ // If the user has specified `aria-expanded` on their reference when the
+ // instance was created, we have to assume they're controlling it externally
+ // themselves
+ if (hadAriaExpandedAttributeOnCreate) {
+ return;
+ }
+
+ var nodes = normalizeToArray(instance.props.triggerTarget || reference);
+ nodes.forEach(function (node) {
+ if (instance.props.interactive) {
+ node.setAttribute('aria-expanded', instance.state.isVisible && node === getCurrentTarget() ? 'true' : 'false');
+ } else {
+ node.removeAttribute('aria-expanded');
+ }
+ });
+ }
+
+ function cleanupInteractiveMouseListeners() {
+ doc.body.removeEventListener('mouseleave', scheduleHide);
+ doc.removeEventListener('mousemove', debouncedOnMouseMove);
+ mouseMoveListeners = mouseMoveListeners.filter(function (listener) {
+ return listener !== debouncedOnMouseMove;
+ });
+ }
+
+ function onDocumentMouseDown(event) {
+ // Clicked on interactive popper
+ if (instance.props.interactive && popper.contains(event.target)) {
+ return;
+ } // Clicked on the event listeners target
+
+
+ if (getCurrentTarget().contains(event.target)) {
+ if (currentInput.isTouch) {
+ return;
+ }
+
+ if (instance.state.isVisible && includes(instance.props.trigger, 'click')) {
+ return;
+ }
+ }
+
+ if (instance.props.hideOnClick === true) {
+ isVisibleFromClick = false;
+ instance.clearDelayTimeouts();
+ instance.hide(); // `mousedown` event is fired right before `focus` if pressing the
+ // currentTarget. This lets a tippy with `focus` trigger know that it
+ // should not show
+
+ didHideDueToDocumentMouseDown = true;
+ setTimeout(function () {
+ didHideDueToDocumentMouseDown = false;
+ }); // The listener gets added in `scheduleShow()`, but this may be hiding it
+ // before it shows, and hide()'s early bail-out behavior can prevent it
+ // from being cleaned up
+
+ if (!instance.state.isMounted) {
+ removeDocumentMouseDownListener();
+ }
+ }
+ }
+
+ function addDocumentMouseDownListener() {
+ doc.addEventListener('mousedown', onDocumentMouseDown, true);
+ }
+
+ function removeDocumentMouseDownListener() {
+ doc.removeEventListener('mousedown', onDocumentMouseDown, true);
+ }
+
+ function onTransitionedOut(duration, callback) {
+ onTransitionEnd(duration, function () {
+ if (!instance.state.isVisible && popper.parentNode && popper.parentNode.contains(popper)) {
+ callback();
+ }
+ });
+ }
+
+ function onTransitionedIn(duration, callback) {
+ onTransitionEnd(duration, callback);
+ }
+
+ function onTransitionEnd(duration, callback) {
+ function listener(event) {
+ if (event.target === tooltip) {
+ updateTransitionEndListener(tooltip, 'remove', listener);
+ callback();
+ }
+ } // Make callback synchronous if duration is 0
+ // `transitionend` won't fire otherwise
+
+
+ if (duration === 0) {
+ return callback();
+ }
+
+ updateTransitionEndListener(tooltip, 'remove', currentTransitionEndListener);
+ updateTransitionEndListener(tooltip, 'add', listener);
+ currentTransitionEndListener = listener;
+ }
+
+ function on(eventType, handler, options) {
+ if (options === void 0) {
+ options = false;
+ }
+
+ var nodes = normalizeToArray(instance.props.triggerTarget || reference);
+ nodes.forEach(function (node) {
+ node.addEventListener(eventType, handler, options);
+ listeners.push({
+ node: node,
+ eventType: eventType,
+ handler: handler,
+ options: options
+ });
+ });
+ }
+
+ function addListenersToTriggerTarget() {
+ if (getIsCustomTouchBehavior()) {
+ on('touchstart', onTrigger, PASSIVE);
+ on('touchend', onMouseLeave, PASSIVE);
+ }
+
+ splitBySpaces(instance.props.trigger).forEach(function (eventType) {
+ if (eventType === 'manual') {
+ return;
+ }
+
+ on(eventType, onTrigger);
+
+ switch (eventType) {
+ case 'mouseenter':
+ on('mouseleave', onMouseLeave);
+ break;
+
+ case 'focus':
+ on(isIE ? 'focusout' : 'blur', onBlurOrFocusOut);
+ break;
+
+ case 'focusin':
+ on('focusout', onBlurOrFocusOut);
+ break;
+ }
+ });
+ }
+
+ function removeListenersFromTriggerTarget() {
+ listeners.forEach(function (_ref) {
+ var node = _ref.node,
+ eventType = _ref.eventType,
+ handler = _ref.handler,
+ options = _ref.options;
+ node.removeEventListener(eventType, handler, options);
+ });
+ listeners = [];
+ }
+
+ function onTrigger(event) {
+ var shouldScheduleClickHide = false;
+
+ if (!instance.state.isEnabled || isEventListenerStopped(event) || didHideDueToDocumentMouseDown) {
+ return;
+ }
+
+ lastTriggerEvent = event;
+ currentTarget = event.currentTarget;
+ handleAriaExpandedAttribute();
+
+ if (!instance.state.isVisible && isMouseEvent(event)) {
+ // If scrolling, `mouseenter` events can be fired if the cursor lands
+ // over a new target, but `mousemove` events don't get fired. This
+ // causes interactive tooltips to get stuck open until the cursor is
+ // moved
+ mouseMoveListeners.forEach(function (listener) {
+ return listener(event);
+ });
+ } // Toggle show/hide when clicking click-triggered tooltips
+
+
+ if (event.type === 'click' && (!includes(instance.props.trigger, 'mouseenter') || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) {
+ shouldScheduleClickHide = true;
+ } else {
+ var _getNormalizedTouchSe = getNormalizedTouchSettings(),
+ value = _getNormalizedTouchSe[0],
+ duration = _getNormalizedTouchSe[1];
+
+ if (currentInput.isTouch && value === 'hold' && duration) {
+ // We can hijack the show timeout here, it will be cleared by
+ // `scheduleHide()` when necessary
+ showTimeout = setTimeout(function () {
+ scheduleShow(event);
+ }, duration);
+ } else {
+ scheduleShow(event);
+ }
+ }
+
+ if (event.type === 'click') {
+ isVisibleFromClick = !shouldScheduleClickHide;
+ }
+
+ if (shouldScheduleClickHide) {
+ scheduleHide(event);
+ }
+ }
+
+ function onMouseMove(event) {
+ var isCursorOverReferenceOrPopper = closestCallback(event.target, function (el) {
+ return el === reference || el === popper;
+ });
+
+ if (event.type === 'mousemove' && isCursorOverReferenceOrPopper) {
+ return;
+ }
+
+ var popperTreeData = arrayFrom(popper.querySelectorAll(POPPER_SELECTOR)).concat(popper).map(function (popper) {
+ var instance = popper._tippy;
+ var tooltip = instance.popperChildren.tooltip;
+ var interactiveBorder = instance.props.interactiveBorder;
+ return {
+ popperRect: popper.getBoundingClientRect(),
+ tooltipRect: tooltip.getBoundingClientRect(),
+ interactiveBorder: interactiveBorder
+ };
+ });
+
+ if (isCursorOutsideInteractiveBorder(popperTreeData, event)) {
+ cleanupInteractiveMouseListeners();
+ scheduleHide(event);
+ }
+ }
+
+ function onMouseLeave(event) {
+ if (isEventListenerStopped(event)) {
+ return;
+ }
+
+ if (includes(instance.props.trigger, 'click') && isVisibleFromClick) {
+ return;
+ }
+
+ if (instance.props.interactive) {
+ doc.body.addEventListener('mouseleave', scheduleHide);
+ doc.addEventListener('mousemove', debouncedOnMouseMove);
+ pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
+ debouncedOnMouseMove(event);
+ return;
+ }
+
+ scheduleHide(event);
+ }
+
+ function onBlurOrFocusOut(event) {
+ if (!includes(instance.props.trigger, 'focusin') && event.target !== getCurrentTarget()) {
+ return;
+ } // If focus was moved to within the popper
+
+
+ if (instance.props.interactive && event.relatedTarget && popper.contains(event.relatedTarget)) {
+ return;
+ }
+
+ scheduleHide(event);
+ }
+
+ function isEventListenerStopped(event) {
+ var supportsTouch = 'ontouchstart' in window;
+ var isTouchEvent = includes(event.type, 'touch');
+ var isCustomTouch = getIsCustomTouchBehavior();
+ return supportsTouch && currentInput.isTouch && isCustomTouch && !isTouchEvent || currentInput.isTouch && !isCustomTouch && isTouchEvent;
+ }
+
+ function createPopperInstance() {
+ var popperOptions = instance.props.popperOptions;
+ var arrow = instance.popperChildren.arrow;
+ var flipModifier = getModifier(popperOptions, 'flip');
+ var preventOverflowModifier = getModifier(popperOptions, 'preventOverflow');
+ var distancePx;
+
+ function applyMutations(data) {
+ var prevPlacement = instance.state.currentPlacement;
+ instance.state.currentPlacement = data.placement;
+
+ if (instance.props.flip && !instance.props.flipOnUpdate) {
+ if (data.flipped) {
+ instance.popperInstance.options.placement = data.placement;
+ }
+
+ setModifierValue(instance.popperInstance.modifiers, 'flip', 'enabled', false);
+ }
+
+ tooltip.setAttribute('data-placement', data.placement);
+
+ if (data.attributes['x-out-of-boundaries'] !== false) {
+ tooltip.setAttribute('data-out-of-boundaries', '');
+ } else {
+ tooltip.removeAttribute('data-out-of-boundaries');
+ }
+
+ var basePlacement = getBasePlacement(data.placement);
+ var isVerticalPlacement = includes(['top', 'bottom'], basePlacement);
+ var isSecondaryPlacement = includes(['bottom', 'right'], basePlacement); // Apply `distance` prop
+
+ tooltip.style.top = '0';
+ tooltip.style.left = '0';
+ tooltip.style[isVerticalPlacement ? 'top' : 'left'] = (isSecondaryPlacement ? 1 : -1) * distancePx + 'px'; // Careful not to cause an infinite loop here
+ // Fixes https://github.com/FezVrasta/popper.js/issues/784
+
+ if (prevPlacement && prevPlacement !== data.placement) {
+ instance.popperInstance.update();
+ }
+ }
+
+ var config = _extends({
+ eventsEnabled: false,
+ placement: instance.props.placement
+ }, popperOptions, {
+ modifiers: _extends({}, popperOptions && popperOptions.modifiers, {
+ // We can't use `padding` on the popper el because of these bugs when
+ // flipping from a vertical to horizontal placement or vice-versa,
+ // there is severe flickering.
+ // https://github.com/FezVrasta/popper.js/issues/720
+ // This workaround increases bundle size by 250B minzip unfortunately,
+ // due to need to custom compute the distance (since Popper rect does
+ // not get affected by the inner tooltip's distance offset)
+ tippyDistance: {
+ enabled: true,
+ order: 0,
+ fn: function fn(data) {
+ // `html` fontSize may change while `popperInstance` is alive
+ // e.g. on resize in media queries
+ distancePx = getUnitsInPx(doc, instance.props.distance);
+ var basePlacement = getBasePlacement(data.placement);
+ var computedPreventOverflowPadding = getComputedPadding(basePlacement, preventOverflowModifier && preventOverflowModifier.padding, distancePx);
+ var computedFlipPadding = getComputedPadding(basePlacement, flipModifier && flipModifier.padding, distancePx);
+ var instanceModifiers = instance.popperInstance.modifiers;
+ setModifierValue(instanceModifiers, 'preventOverflow', 'padding', computedPreventOverflowPadding);
+ setModifierValue(instanceModifiers, 'flip', 'padding', computedFlipPadding);
+ return data;
+ }
+ },
+ preventOverflow: _extends({
+ boundariesElement: instance.props.boundary
+ }, preventOverflowModifier),
+ flip: _extends({
+ enabled: instance.props.flip,
+ behavior: instance.props.flipBehavior
+ }, flipModifier),
+ arrow: _extends({
+ element: arrow,
+ enabled: !!arrow
+ }, getModifier(popperOptions, 'arrow')),
+ offset: _extends({
+ offset: instance.props.offset
+ }, getModifier(popperOptions, 'offset'))
+ }),
+ onCreate: function onCreate(data) {
+ applyMutations(data);
+ preserveInvocation(popperOptions && popperOptions.onCreate, config.onCreate, [data]);
+ runMountCallback();
+ },
+ onUpdate: function onUpdate(data) {
+ applyMutations(data);
+ preserveInvocation(popperOptions && popperOptions.onUpdate, config.onUpdate, [data]);
+ runMountCallback();
+ }
+ });
+
+ instance.popperInstance = new Popper(reference, popper, config);
+ }
+
+ function runMountCallback() {
+ // Only invoke currentMountCallback after 2 updates
+ // This fixes some bugs in Popper.js (TODO: aim for only 1 update)
+ if (popperUpdates === 0) {
+ popperUpdates++; // 1
+
+ instance.popperInstance.update();
+ } else if (currentMountCallback && popperUpdates === 1) {
+ popperUpdates++; // 2
+
+ reflow(popper);
+ currentMountCallback();
+ }
+ }
+
+ function mount() {
+ // The mounting callback (`currentMountCallback`) is only run due to a
+ // popperInstance update/create
+ popperUpdates = 0;
+ var appendTo = instance.props.appendTo;
+ var parentNode; // By default, we'll append the popper to the triggerTargets's parentNode so
+ // it's directly after the reference element so the elements inside the
+ // tippy can be tabbed to
+ // If there are clipping issues, the user can specify a different appendTo
+ // and ensure focus management is handled correctly manually
+
+ var node = getCurrentTarget();
+
+ if (instance.props.interactive && appendTo === defaultProps.appendTo || appendTo === 'parent') {
+ parentNode = node.parentNode;
+ } else {
+ parentNode = invokeWithArgsOrReturn(appendTo, [node]);
+ } // The popper element needs to exist on the DOM before its position can be
+ // updated as Popper.js needs to read its dimensions
+
+
+ if (!parentNode.contains(popper)) {
+ parentNode.appendChild(popper);
+ }
+
+ {
+ // Accessibility check
+ warnWhen(instance.props.interactive && appendTo === defaultProps.appendTo && node.nextElementSibling !== popper, ['Interactive tippy element may not be accessible via keyboard navigation', 'because it is not directly after the reference element in the DOM source', 'order.', '\n\n', 'Using a wrapper <div> or <span> tag around the reference element solves', 'this by creating a new parentNode context.', '\n\n', 'Specifying `appendTo: document.body` silences this warning, but it', 'assumes you are using a focus management solution to handle keyboard', 'navigation.', '\n\n', 'See: https://atomiks.github.io/tippyjs/accessibility/#interactivity'].join(' '));
+ }
+
+ setModifierValue(instance.popperInstance.modifiers, 'flip', 'enabled', instance.props.flip);
+ instance.popperInstance.enableEventListeners(); // Mounting callback invoked in `onUpdate`
+
+ instance.popperInstance.update();
+ }
+
+ function scheduleShow(event) {
+ instance.clearDelayTimeouts();
+
+ if (!instance.popperInstance) {
+ createPopperInstance();
+ }
+
+ if (event) {
+ invokeHook('onTrigger', [instance, event]);
+ }
+
+ addDocumentMouseDownListener();
+ var delay = getDelay(true);
+
+ if (delay) {
+ showTimeout = setTimeout(function () {
+ instance.show();
+ }, delay);
+ } else {
+ instance.show();
+ }
+ }
+
+ function scheduleHide(event) {
+ instance.clearDelayTimeouts();
+ invokeHook('onUntrigger', [instance, event]);
+
+ if (!instance.state.isVisible) {
+ removeDocumentMouseDownListener();
+ return;
+ } // For interactive tippies, scheduleHide is added to a document.body handler
+ // from onMouseLeave so must intercept scheduled hides from mousemove/leave
+ // events when trigger contains mouseenter and click, and the tip is
+ // currently shown as a result of a click.
+
+
+ if (includes(instance.props.trigger, 'mouseenter') && includes(instance.props.trigger, 'click') && includes(['mouseleave', 'mousemove'], event.type) && isVisibleFromClick) {
+ return;
+ }
+
+ var delay = getDelay(false);
+
+ if (delay) {
+ hideTimeout = setTimeout(function () {
+ if (instance.state.isVisible) {
+ instance.hide();
+ }
+ }, delay);
+ } else {
+ // Fixes a `transitionend` problem when it fires 1 frame too
+ // late sometimes, we don't want hide() to be called.
+ scheduleHideAnimationFrame = requestAnimationFrame(function () {
+ instance.hide();
+ });
+ }
+ }
+ /* ======================= ? Public methods ? ======================= */
+
+
+ function enable() {
+ instance.state.isEnabled = true;
+ }
+
+ function disable() {
+ // Disabling the instance should also hide it
+ // https://github.com/atomiks/tippy.js-react/issues/106
+ instance.hide();
+ instance.state.isEnabled = false;
+ }
+
+ function clearDelayTimeouts() {
+ clearTimeout(showTimeout);
+ clearTimeout(hideTimeout);
+ cancelAnimationFrame(scheduleHideAnimationFrame);
+ }
+
+ function setProps(partialProps) {
+ {
+ warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('setProps'));
+ }
+
+ if (instance.state.isDestroyed) {
+ return;
+ }
+
+ {
+ validateProps(partialProps, plugins);
+ warnWhen(partialProps.plugins ? partialProps.plugins.length !== plugins.length || plugins.some(function (p, i) {
+ if (partialProps.plugins && partialProps.plugins[i]) {
+ return p !== partialProps.plugins[i];
+ } else {
+ return true;
+ }
+ }) : false, "Cannot update plugins");
+ }
+
+ invokeHook('onBeforeUpdate', [instance, partialProps]);
+ removeListenersFromTriggerTarget();
+ var prevProps = instance.props;
+ var nextProps = evaluateProps(reference, _extends({}, instance.props, {}, partialProps, {
+ ignoreAttributes: true
+ }));
+ nextProps.ignoreAttributes = useIfDefined(partialProps.ignoreAttributes, prevProps.ignoreAttributes);
+ instance.props = nextProps;
+ addListenersToTriggerTarget();
+
+ if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) {
+ cleanupInteractiveMouseListeners();
+ debouncedOnMouseMove = debounce(onMouseMove, nextProps.interactiveDebounce);
+ }
+
+ updatePopperElement(popper, prevProps, nextProps);
+ instance.popperChildren = getChildren(popper); // Ensure stale aria-expanded attributes are removed
+
+ if (prevProps.triggerTarget && !nextProps.triggerTarget) {
+ normalizeToArray(prevProps.triggerTarget).forEach(function (node) {
+ node.removeAttribute('aria-expanded');
+ });
+ } else if (nextProps.triggerTarget) {
+ reference.removeAttribute('aria-expanded');
+ }
+
+ handleAriaExpandedAttribute();
+
+ if (instance.popperInstance) {
+ if (POPPER_INSTANCE_DEPENDENCIES.some(function (prop) {
+ return hasOwnProperty(partialProps, prop) && partialProps[prop] !== prevProps[prop];
+ })) {
+ var currentReference = instance.popperInstance.reference;
+ instance.popperInstance.destroy();
+ createPopperInstance();
+ instance.popperInstance.reference = currentReference;
+
+ if (instance.state.isVisible) {
+ instance.popperInstance.enableEventListeners();
+ }
+ } else {
+ instance.popperInstance.update();
+ }
+ }
+
+ invokeHook('onAfterUpdate', [instance, partialProps]);
+ }
+
+ function setContent(content) {
+ instance.setProps({
+ content: content
+ });
+ }
+
+ function show(duration) {
+ if (duration === void 0) {
+ duration = getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps.duration);
+ }
+
+ {
+ warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('show'));
+ } // Early bail-out
+
+
+ var isAlreadyVisible = instance.state.isVisible;
+ var isDestroyed = instance.state.isDestroyed;
+ var isDisabled = !instance.state.isEnabled;
+ var isTouchAndTouchDisabled = currentInput.isTouch && !instance.props.touch;
+
+ if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) {
+ return;
+ } // Normalize `disabled` behavior across browsers.
+ // Firefox allows events on disabled elements, but Chrome doesn't.
+ // Using a wrapper element (i.e. <span>) is recommended.
+
+
+ if (getCurrentTarget().hasAttribute('disabled')) {
+ return;
+ }
+
+ if (!instance.popperInstance) {
+ createPopperInstance();
+ }
+
+ invokeHook('onShow', [instance], false);
+
+ if (instance.props.onShow(instance) === false) {
+ return;
+ }
+
+ addDocumentMouseDownListener();
+ popper.style.visibility = 'visible';
+ instance.state.isVisible = true; // Prevent a transition of the popper from its previous position and of the
+ // elements at a different placement
+ // Check if the tippy was fully unmounted before `show()` was called, to
+ // allow for smooth transition for `createSingleton()`
+
+ if (!instance.state.isMounted) {
+ setTransitionDuration(transitionableElements.concat(popper), 0);
+ }
+
+ currentMountCallback = function currentMountCallback() {
+ if (!instance.state.isVisible) {
+ return;
+ }
+
+ setTransitionDuration([popper], instance.props.updateDuration);
+ setTransitionDuration(transitionableElements, duration);
+ setVisibilityState(transitionableElements, 'visible');
+ handleAriaDescribedByAttribute();
+ handleAriaExpandedAttribute();
+ pushIfUnique(mountedInstances, instance);
+ updateIOSClass(true);
+ instance.state.isMounted = true;
+ invokeHook('onMount', [instance]);
+ onTransitionedIn(duration, function () {
+ instance.state.isShown = true;
+ invokeHook('onShown', [instance]);
+ });
+ };
+
+ mount();
+ }
+
+ function hide(duration) {
+ if (duration === void 0) {
+ duration = getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps.duration);
+ }
+
+ {
+ warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hide'));
+ } // Early bail-out
+
+
+ var isAlreadyHidden = !instance.state.isVisible && !isBeingDestroyed;
+ var isDestroyed = instance.state.isDestroyed;
+ var isDisabled = !instance.state.isEnabled && !isBeingDestroyed;
+
+ if (isAlreadyHidden || isDestroyed || isDisabled) {
+ return;
+ }
+
+ invokeHook('onHide', [instance], false);
+
+ if (instance.props.onHide(instance) === false && !isBeingDestroyed) {
+ return;
+ }
+
+ removeDocumentMouseDownListener();
+ popper.style.visibility = 'hidden';
+ instance.state.isVisible = false;
+ instance.state.isShown = false;
+ setTransitionDuration(transitionableElements, duration);
+ setVisibilityState(transitionableElements, 'hidden');
+ handleAriaDescribedByAttribute();
+ handleAriaExpandedAttribute();
+ onTransitionedOut(duration, function () {
+ instance.popperInstance.disableEventListeners();
+ instance.popperInstance.options.placement = instance.props.placement;
+ popper.parentNode.removeChild(popper);
+ mountedInstances = mountedInstances.filter(function (i) {
+ return i !== instance;
+ });
+
+ if (mountedInstances.length === 0) {
+ updateIOSClass(false);
+ }
+
+ instance.state.isMounted = false;
+ invokeHook('onHidden', [instance]);
+ });
+ }
+
+ function destroy() {
+ {
+ warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('destroy'));
+ }
+
+ if (instance.state.isDestroyed) {
+ return;
+ }
+
+ isBeingDestroyed = true;
+ instance.clearDelayTimeouts();
+ instance.hide(0);
+ removeListenersFromTriggerTarget();
+ delete reference._tippy;
+
+ if (instance.popperInstance) {
+ instance.popperInstance.destroy();
+ }
+
+ isBeingDestroyed = false;
+ instance.state.isDestroyed = true;
+ invokeHook('onDestroy', [instance]);
+ }
+ }
+
+ function tippy(targets, optionalProps,
+ /** @deprecated use Props.plugins */
+ plugins) {
+ if (optionalProps === void 0) {
+ optionalProps = {};
+ }
+
+ if (plugins === void 0) {
+ plugins = [];
+ }
+
+ plugins = defaultProps.plugins.concat(optionalProps.plugins || plugins);
+
+ {
+ validateTargets(targets);
+ validateProps(optionalProps, plugins);
+ }
+
+ bindGlobalEventListeners();
+
+ var passedProps = _extends({}, optionalProps, {
+ plugins: plugins
+ });
+
+ var elements = getArrayOfElements(targets);
+
+ {
+ var isSingleContentElement = isElement(passedProps.content);
+ var isMoreThanOneReferenceElement = elements.length > 1;
+ warnWhen(isSingleContentElement && isMoreThanOneReferenceElement, ['tippy() was passed an Element as the `content` prop, but more than one tippy', 'instance was created by this invocation. This means the content element will', 'only be appended to the last tippy instance.', '\n\n', 'Instead, pass the .innerHTML of the element, or use a function that returns a', 'cloned version of the element instead.', '\n\n', '1) content: element.innerHTML\n', '2) content: () => element.cloneNode(true)'].join(' '));
+ }
+
+ var instances = elements.reduce(function (acc, reference) {
+ var instance = reference && createTippy(reference, passedProps);
+
+ if (instance) {
+ acc.push(instance);
+ }
+
+ return acc;
+ }, []);
+ return isElement(targets) ? instances[0] : instances;
+ }
+
+ tippy.version = version;
+ tippy.defaultProps = defaultProps;
+ tippy.setDefaultProps = setDefaultProps;
+ tippy.currentInput = currentInput;
+ /**
+ * Hides all visible poppers on the document
+ */
+
+ var hideAll = function hideAll(_temp) {
+ var _ref = _temp === void 0 ? {} : _temp,
+ excludedReferenceOrInstance = _ref.exclude,
+ duration = _ref.duration;
+
+ mountedInstances.forEach(function (instance) {
+ var isExcluded = false;
+
+ if (excludedReferenceOrInstance) {
+ isExcluded = isReferenceElement(excludedReferenceOrInstance) ? instance.reference === excludedReferenceOrInstance : instance.popper === excludedReferenceOrInstance.popper;
+ }
+
+ if (!isExcluded) {
+ instance.hide(duration);
+ }
+ });
+ };
+
+ /**
+ * Re-uses a single tippy element for many different tippy instances.
+ * Replaces v4's `tippy.group()`.
+ */
+
+ var createSingleton = function createSingleton(tippyInstances, optionalProps,
+ /** @deprecated use Props.plugins */
+ plugins) {
+ if (optionalProps === void 0) {
+ optionalProps = {};
+ }
+
+ if (plugins === void 0) {
+ plugins = [];
+ }
+
+ {
+ errorWhen(!Array.isArray(tippyInstances), ['The first argument passed to createSingleton() must be an array of tippy', 'instances. The passed value was', String(tippyInstances)].join(' '));
+ }
+
+ plugins = optionalProps.plugins || plugins;
+ tippyInstances.forEach(function (instance) {
+ instance.disable();
+ });
+
+ var userAria = _extends({}, defaultProps, {}, optionalProps).aria;
+
+ var currentAria;
+ var currentTarget;
+ var shouldSkipUpdate = false;
+ var references = tippyInstances.map(function (instance) {
+ return instance.reference;
+ });
+ var singleton = {
+ fn: function fn(instance) {
+ function handleAriaDescribedByAttribute(isShow) {
+ if (!currentAria) {
+ return;
+ }
+
+ var attr = "aria-" + currentAria;
+
+ if (isShow && !instance.props.interactive) {
+ currentTarget.setAttribute(attr, instance.popperChildren.tooltip.id);
+ } else {
+ currentTarget.removeAttribute(attr);
+ }
+ }
+
+ return {
+ onAfterUpdate: function onAfterUpdate(_, _ref) {
+ var aria = _ref.aria;
+
+ // Ensure `aria` for the singleton instance stays `null`, while
+ // changing the `userAria` value
+ if (aria !== undefined && aria !== userAria) {
+ if (!shouldSkipUpdate) {
+ userAria = aria;
+ } else {
+ shouldSkipUpdate = true;
+ instance.setProps({
+ aria: null
+ });
+ shouldSkipUpdate = false;
+ }
+ }
+ },
+ onDestroy: function onDestroy() {
+ tippyInstances.forEach(function (instance) {
+ instance.enable();
+ });
+ },
+ onMount: function onMount() {
+ handleAriaDescribedByAttribute(true);
+ },
+ onUntrigger: function onUntrigger() {
+ handleAriaDescribedByAttribute(false);
+ },
+ onTrigger: function onTrigger(_, event) {
+ var target = event.currentTarget;
+ var index = references.indexOf(target); // bail-out
+
+ if (target === currentTarget) {
+ return;
+ }
+
+ currentTarget = target;
+ currentAria = userAria;
+
+ if (instance.state.isVisible) {
+ handleAriaDescribedByAttribute(true);
+ }
+
+ instance.popperInstance.reference = target;
+ instance.setContent(tippyInstances[index].props.content);
+ }
+ };
+ }
+ };
+ return tippy(div(), _extends({}, optionalProps, {
+ plugins: [singleton].concat(plugins),
+ aria: null,
+ triggerTarget: references
+ }));
+ };
+
+ var BUBBLING_EVENTS_MAP = {
+ mouseover: 'mouseenter',
+ focusin: 'focus',
+ click: 'click'
+ };
+ /**
+ * Creates a delegate instance that controls the creation of tippy instances
+ * for child elements (`target` CSS selector).
+ */
+
+ function delegate(targets, props,
+ /** @deprecated use Props.plugins */
+ plugins) {
+ if (plugins === void 0) {
+ plugins = [];
+ }
+
+ {
+ errorWhen(!(props && props.target), ['You must specity a `target` prop indicating a CSS selector string matching', 'the target elements that should receive a tippy.'].join(' '));
+ }
+
+ plugins = props.plugins || plugins;
+ var listeners = [];
+ var childTippyInstances = [];
+ var target = props.target;
+ var nativeProps = removeProperties(props, ['target']);
+
+ var parentProps = _extends({}, nativeProps, {
+ plugins: plugins,
+ trigger: 'manual'
+ });
+
+ var childProps = _extends({}, nativeProps, {
+ plugins: plugins,
+ showOnCreate: true
+ });
+
+ var returnValue = tippy(targets, parentProps);
+ var normalizedReturnValue = normalizeToArray(returnValue);
+
+ function onTrigger(event) {
+ if (!event.target) {
+ return;
+ }
+
+ var targetNode = event.target.closest(target);
+
+ if (!targetNode) {
+ return;
+ } // Get relevant trigger with fallbacks:
+ // 1. Check `data-tippy-trigger` attribute on target node
+ // 2. Fallback to `trigger` passed to `delegate()`
+ // 3. Fallback to `defaultProps.trigger`
+
+
+ var trigger = targetNode.getAttribute('data-tippy-trigger') || props.trigger || defaultProps.trigger; // Only create the instance if the bubbling event matches the trigger type
+
+ if (!includes(trigger, BUBBLING_EVENTS_MAP[event.type])) {
+ return;
+ }
+
+ var instance = tippy(targetNode, childProps);
+
+ if (instance) {
+ childTippyInstances = childTippyInstances.concat(instance);
+ }
+ }
+
+ function on(node, eventType, handler, options) {
+ if (options === void 0) {
+ options = false;
+ }
+
+ node.addEventListener(eventType, handler, options);
+ listeners.push({
+ node: node,
+ eventType: eventType,
+ handler: handler,
+ options: options
+ });
+ }
+
+ function addEventListeners(instance) {
+ var reference = instance.reference;
+ on(reference, 'mouseover', onTrigger);
+ on(reference, 'focusin', onTrigger);
+ on(reference, 'click', onTrigger);
+ }
+
+ function removeEventListeners() {
+ listeners.forEach(function (_ref) {
+ var node = _ref.node,
+ eventType = _ref.eventType,
+ handler = _ref.handler,
+ options = _ref.options;
+ node.removeEventListener(eventType, handler, options);
+ });
+ listeners = [];
+ }
+
+ function applyMutations(instance) {
+ var originalDestroy = instance.destroy;
+
+ instance.destroy = function (shouldDestroyChildInstances) {
+ if (shouldDestroyChildInstances === void 0) {
+ shouldDestroyChildInstances = true;
+ }
+
+ if (shouldDestroyChildInstances) {
+ childTippyInstances.forEach(function (instance) {
+ instance.destroy();
+ });
+ }
+
+ childTippyInstances = [];
+ removeEventListeners();
+ originalDestroy();
+ };
+
+ addEventListeners(instance);
+ }
+
+ normalizedReturnValue.forEach(applyMutations);
+ return returnValue;
+ }
+
+ var animateFill = {
+ name: 'animateFill',
+ defaultValue: false,
+ fn: function fn(instance) {
+ var _instance$popperChild = instance.popperChildren,
+ tooltip = _instance$popperChild.tooltip,
+ content = _instance$popperChild.content;
+ var backdrop = instance.props.animateFill ? createBackdropElement() : null;
+
+ function addBackdropToPopperChildren() {
+ instance.popperChildren.backdrop = backdrop;
+ }
+
+ return {
+ onCreate: function onCreate() {
+ if (backdrop) {
+ addBackdropToPopperChildren();
+ tooltip.insertBefore(backdrop, tooltip.firstElementChild);
+ tooltip.setAttribute('data-animatefill', '');
+ tooltip.style.overflow = 'hidden';
+ instance.setProps({
+ animation: 'shift-away',
+ arrow: false
+ });
+ }
+ },
+ onMount: function onMount() {
+ if (backdrop) {
+ var transitionDuration = tooltip.style.transitionDuration;
+ var duration = Number(transitionDuration.replace('ms', '')); // The content should fade in after the backdrop has mostly filled the
+ // tooltip element. `clip-path` is the other alternative but is not
+ // well-supported and is buggy on some devices.
+
+ content.style.transitionDelay = Math.round(duration / 10) + "ms";
+ backdrop.style.transitionDuration = transitionDuration;
+ setVisibilityState([backdrop], 'visible'); // Warn if the stylesheets are not loaded
+
+ {
+ warnWhen(getComputedStyle(backdrop).position !== 'absolute', "The `tippy.js/dist/backdrop.css` stylesheet has not been\n imported!\n \n The `animateFill` plugin requires this stylesheet to work.");
+ warnWhen(getComputedStyle(tooltip).transform === 'none', "The `tippy.js/animations/shift-away.css` stylesheet has not\n been imported!\n \n The `animateFill` plugin requires this stylesheet to work.");
+ }
+ }
+ },
+ onShow: function onShow() {
+ if (backdrop) {
+ backdrop.style.transitionDuration = '0ms';
+ }
+ },
+ onHide: function onHide() {
+ if (backdrop) {
+ setVisibilityState([backdrop], 'hidden');
+ }
+ },
+ onAfterUpdate: function onAfterUpdate() {
+ // With this type of prop, it's highly unlikely it will be changed
+ // dynamically. We'll leave out the diff/update logic it to save bytes.
+ // `popperChildren` is assigned a new object onAfterUpdate
+ addBackdropToPopperChildren();
+ }
+ };
+ }
+ };
+
+ function createBackdropElement() {
+ var backdrop = div();
+ backdrop.className = BACKDROP_CLASS;
+ setVisibilityState([backdrop], 'hidden');
+ return backdrop;
+ }
+
+ var followCursor = {
+ name: 'followCursor',
+ defaultValue: false,
+ fn: function fn(instance) {
+ var reference = instance.reference,
+ popper = instance.popper;
+ var originalReference = null; // Support iframe contexts
+ // Static check that assumes any of the `triggerTarget` or `reference`
+ // nodes will never change documents, even when they are updated
+
+ var doc = getOwnerDocument(instance.props.triggerTarget || reference); // Internal state
+
+ var lastMouseMoveEvent;
+ var mouseCoords = null;
+ var isInternallySettingControlledProp = false; // These are controlled by this plugin, so we need to store the user's
+ // original prop value
+
+ var userProps = instance.props;
+
+ function setUserProps(props) {
+ var keys = Object.keys(props);
+ keys.forEach(function (prop) {
+ userProps[prop] = useIfDefined(props[prop], userProps[prop]);
+ });
+ }
+
+ function getIsManual() {
+ return instance.props.trigger.trim() === 'manual';
+ }
+
+ function getIsEnabled() {
+ // #597
+ var isValidMouseEvent = getIsManual() ? true : // Check if a keyboard "click"
+ mouseCoords !== null && !(mouseCoords.clientX === 0 && mouseCoords.clientY === 0);
+ return instance.props.followCursor && isValidMouseEvent;
+ }
+
+ function getIsInitialBehavior() {
+ return currentInput.isTouch || instance.props.followCursor === 'initial' && instance.state.isVisible;
+ }
+
+ function resetReference() {
+ if (instance.popperInstance && originalReference) {
+ instance.popperInstance.reference = originalReference;
+ }
+ }
+
+ function handlePlacement() {
+ // Due to `getVirtualOffsets()`, we need to reverse the placement if it's
+ // shifted (start -> end, and vice-versa)
+ // Early bail-out
+ if (!getIsEnabled() && instance.props.placement === userProps.placement) {
+ return;
+ }
+
+ var placement = userProps.placement;
+ var shift = placement.split('-')[1];
+ isInternallySettingControlledProp = true;
+ instance.setProps({
+ placement: getIsEnabled() && shift ? placement.replace(shift, shift === 'start' ? 'end' : 'start') : placement
+ });
+ isInternallySettingControlledProp = false;
+ }
+
+ function handlePopperListeners() {
+ if (!instance.popperInstance) {
+ return;
+ } // Popper's scroll listeners make sense for `true` only. TODO: work out
+ // how to only listen horizontal scroll for "horizontal" and vertical
+ // scroll for "vertical"
+
+
+ if (getIsEnabled() && getIsInitialBehavior()) {
+ instance.popperInstance.disableEventListeners();
+ }
+ }
+
+ function handleMouseMoveListener() {
+ if (getIsEnabled()) {
+ addListener();
+ } else {
+ resetReference();
+ }
+ }
+
+ function triggerLastMouseMove() {
+ if (getIsEnabled()) {
+ onMouseMove(lastMouseMoveEvent);
+ }
+ }
+
+ function addListener() {
+ doc.addEventListener('mousemove', onMouseMove);
+ }
+
+ function removeListener() {
+ doc.removeEventListener('mousemove', onMouseMove);
+ }
+
+ function onMouseMove(event) {
+ var _lastMouseMoveEvent = lastMouseMoveEvent = event,
+ clientX = _lastMouseMoveEvent.clientX,
+ clientY = _lastMouseMoveEvent.clientY;
+
+ if (!instance.popperInstance || !instance.state.currentPlacement) {
+ return;
+ } // If the instance is interactive, avoid updating the position unless it's
+ // over the reference element
+
+
+ var isCursorOverReference = closestCallback(event.target, function (el) {
+ return el === reference;
+ });
+ var followCursor = instance.props.followCursor;
+ var isHorizontal = followCursor === 'horizontal';
+ var isVertical = followCursor === 'vertical';
+ var isVerticalPlacement = includes(['top', 'bottom'], getBasePlacement(instance.state.currentPlacement)); // The virtual reference needs some size to prevent itself from overflowing
+
+ var _getVirtualOffsets = getVirtualOffsets(popper, isVerticalPlacement),
+ size = _getVirtualOffsets.size,
+ x = _getVirtualOffsets.x,
+ y = _getVirtualOffsets.y;
+
+ if (isCursorOverReference || !instance.props.interactive) {
+ // Preserve custom position ReferenceObjects, which may not be the
+ // original targets reference passed as an argument
+ if (originalReference === null) {
+ originalReference = instance.popperInstance.reference;
+ }
+
+ instance.popperInstance.reference = {
+ referenceNode: reference,
+ // These `client` values don't get used by Popper.js if they are 0
+ clientWidth: 0,
+ clientHeight: 0,
+ getBoundingClientRect: function getBoundingClientRect() {
+ var rect = reference.getBoundingClientRect();
+ return {
+ width: isVerticalPlacement ? size : 0,
+ height: isVerticalPlacement ? 0 : size,
+ top: (isHorizontal ? rect.top : clientY) - y,
+ bottom: (isHorizontal ? rect.bottom : clientY) + y,
+ left: (isVertical ? rect.left : clientX) - x,
+ right: (isVertical ? rect.right : clientX) + x
+ };
+ }
+ };
+ instance.popperInstance.update();
+ }
+
+ if (getIsInitialBehavior()) {
+ removeListener();
+ }
+ }
+
+ return {
+ onAfterUpdate: function onAfterUpdate(_, partialProps) {
+ if (!isInternallySettingControlledProp) {
+ setUserProps(partialProps);
+
+ if (partialProps.placement) {
+ handlePlacement();
+ }
+ } // A new placement causes the popperInstance to be recreated
+
+
+ if (partialProps.placement) {
+ handlePopperListeners();
+ } // Wait for `.update()` to set `instance.state.currentPlacement` to
+ // the new placement
+
+
+ requestAnimationFrame(triggerLastMouseMove);
+ },
+ onMount: function onMount() {
+ triggerLastMouseMove();
+ handlePopperListeners();
+ },
+ onShow: function onShow() {
+ if (getIsManual()) {
+ // Since there's no trigger event to use, we have to use these as
+ // baseline coords
+ mouseCoords = {
+ clientX: 0,
+ clientY: 0
+ }; // Ensure `lastMouseMoveEvent` doesn't access any other properties
+ // of a MouseEvent here
+
+ lastMouseMoveEvent = mouseCoords;
+ handlePlacement();
+ handleMouseMoveListener();
+ }
+ },
+ onTrigger: function onTrigger(_, event) {
+ // Tapping on touch devices can trigger `mouseenter` then `focus`
+ if (mouseCoords) {
+ return;
+ }
+
+ if (isMouseEvent(event)) {
+ mouseCoords = {
+ clientX: event.clientX,
+ clientY: event.clientY
+ };
+ lastMouseMoveEvent = event;
+ }
+
+ handlePlacement();
+ handleMouseMoveListener();
+ },
+ onUntrigger: function onUntrigger() {
+ // If untriggered before showing (`onHidden` will never be invoked)
+ if (!instance.state.isVisible) {
+ removeListener();
+ mouseCoords = null;
+ }
+ },
+ onHidden: function onHidden() {
+ removeListener();
+ resetReference();
+ mouseCoords = null;
+ }
+ };
+ }
+ };
+ function getVirtualOffsets(popper, isVerticalPlacement) {
+ var size = isVerticalPlacement ? popper.offsetWidth : popper.offsetHeight;
+ return {
+ size: size,
+ x: isVerticalPlacement ? size : 0,
+ y: isVerticalPlacement ? 0 : size
+ };
+ }
+
+ // position. This will require the `followCursor` plugin's fixes for overflow
+ // due to using event.clientX/Y values. (normalizedPlacement, getVirtualOffsets)
+
+ var inlinePositioning = {
+ name: 'inlinePositioning',
+ defaultValue: false,
+ fn: function fn(instance) {
+ var reference = instance.reference;
+
+ function getIsEnabled() {
+ return !!instance.props.inlinePositioning;
+ }
+
+ return {
+ onHidden: function onHidden() {
+ if (getIsEnabled()) {
+ instance.popperInstance.reference = reference;
+ }
+ },
+ onShow: function onShow() {
+ if (!getIsEnabled()) {
+ return;
+ }
+
+ instance.popperInstance.reference = {
+ referenceNode: reference,
+ // These `client` values don't get used by Popper.js if they are 0
+ clientWidth: 0,
+ clientHeight: 0,
+ getBoundingClientRect: function getBoundingClientRect() {
+ return getInlineBoundingClientRect(instance.state.currentPlacement && getBasePlacement(instance.state.currentPlacement), reference.getBoundingClientRect(), arrayFrom(reference.getClientRects()));
+ }
+ };
+ }
+ };
+ }
+ };
+ function getInlineBoundingClientRect(currentBasePlacement, boundingRect, clientRects) {
+ // Not an inline element, or placement is not yet known
+ if (clientRects.length < 2 || currentBasePlacement === null) {
+ return boundingRect;
+ }
+
+ switch (currentBasePlacement) {
+ case 'top':
+ case 'bottom':
+ {
+ var firstRect = clientRects[0];
+ var lastRect = clientRects[clientRects.length - 1];
+ var isTop = currentBasePlacement === 'top';
+ var top = firstRect.top;
+ var bottom = lastRect.bottom;
+ var left = isTop ? firstRect.left : lastRect.left;
+ var right = isTop ? firstRect.right : lastRect.right;
+ var width = right - left;
+ var height = bottom - top;
+ return {
+ top: top,
+ bottom: bottom,
+ left: left,
+ right: right,
+ width: width,
+ height: height
+ };
+ }
+
+ case 'left':
+ case 'right':
+ {
+ var minLeft = Math.min.apply(Math, clientRects.map(function (rects) {
+ return rects.left;
+ }));
+ var maxRight = Math.max.apply(Math, clientRects.map(function (rects) {
+ return rects.right;
+ }));
+ var measureRects = clientRects.filter(function (rect) {
+ return currentBasePlacement === 'left' ? rect.left === minLeft : rect.right === maxRight;
+ });
+ var _top = measureRects[0].top;
+ var _bottom = measureRects[measureRects.length - 1].bottom;
+ var _left = minLeft;
+ var _right = maxRight;
+
+ var _width = _right - _left;
+
+ var _height = _bottom - _top;
+
+ return {
+ top: _top,
+ bottom: _bottom,
+ left: _left,
+ right: _right,
+ width: _width,
+ height: _height
+ };
+ }
+
+ default:
+ {
+ return boundingRect;
+ }
+ }
+ }
+
+ var sticky = {
+ name: 'sticky',
+ defaultValue: false,
+ fn: function fn(instance) {
+ var reference = instance.reference,
+ popper = instance.popper;
+
+ function getReference() {
+ return instance.popperInstance ? instance.popperInstance.reference : reference;
+ }
+
+ function shouldCheck(value) {
+ return instance.props.sticky === true || instance.props.sticky === value;
+ }
+
+ var prevRefRect = null;
+ var prevPopRect = null;
+
+ function updatePosition() {
+ var currentRefRect = shouldCheck('reference') ? getReference().getBoundingClientRect() : null;
+ var currentPopRect = shouldCheck('popper') ? popper.getBoundingClientRect() : null;
+
+ if (currentRefRect && areRectsDifferent(prevRefRect, currentRefRect) || currentPopRect && areRectsDifferent(prevPopRect, currentPopRect)) {
+ instance.popperInstance.update();
+ }
+
+ prevRefRect = currentRefRect;
+ prevPopRect = currentPopRect;
+
+ if (instance.state.isMounted) {
+ requestAnimationFrame(updatePosition);
+ }
+ }
+
+ return {
+ onMount: function onMount() {
+ if (instance.props.sticky) {
+ updatePosition();
+ }
+ }
+ };
+ }
+ };
+
+ function areRectsDifferent(rectA, rectB) {
+ if (rectA && rectB) {
+ return rectA.top !== rectB.top || rectA.right !== rectB.right || rectA.bottom !== rectB.bottom || rectA.left !== rectB.left;
+ }
+
+ return true;
+ }
+
+ if (isBrowser) {
+ injectCSS(css);
+ }
+
+ tippy.setDefaultProps({
+ plugins: [animateFill, followCursor, inlinePositioning, sticky]
+ });
+ tippy.createSingleton = createSingleton;
+ tippy.delegate = delegate;
+ tippy.hideAll = hideAll;
+ tippy.roundArrow = ROUND_ARROW;
+
+ return tippy;
+
+ }(Popper));
+ //# sourceMappingURL=tippy-bundle.iife.js.map
\ Kein Zeilenumbruch am Dateiende.
diff -Nru xnote-4.1.12/chrome/content/tooltip/tippy/tippy.js xnote-4.5.48/chrome/content/tooltip/tippy/tippy.js
--- xnote-4.1.12/chrome/content/tooltip/tippy/tippy.js 1970-01-01 01:00:00.000000000 +0100
+++ xnote-4.5.48/chrome/content/tooltip/tippy/tippy.js 2024-08-02 00:40:18.000000000 +0200
@@ -0,0 +1,2 @@
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],e):(t=t||self).tippy=e(t.Popper)}(this,(function(t){"use strict";var e="undefined"!=typeof window&&"undefined"!=typeof document,n=!!e&&!!window.msCrypto,r={passive:!0,capture:!0},o=function(){return document.body};function i(t,e,n){if(Array.isArray(t)){var r=t[e];return null==r?Array.isArray(n)?n[e]:n:r}return t}function a(t,e){var n={}.toString.call(t);return 0===n.indexOf("[object")&&n.indexOf(e+"]")>-1}function s(t,e){return"function"==typeof t?t.apply(void 0,e):t}function u(t,e){return 0===e?t:function(r){clearTimeout(n),n=setTimeout((function(){t(r)}),e)};var n}function p(t,e){var n=Object.assign({},t);return e.forEach((function(t){delete n[t]})),n}function c(t){return[].concat(t)}function f(t,e){-1===t.indexOf(e)&&t.push(e)}function l(t){return t.split("-")[0]}function d(t){return[].slice.call(t)}function v(t){return Object.keys(t).reduce((function(e,n){return void 0!==t[n]&&(e[n]=t[n]),e}),{})}function m(){return document.createElement("div")}function g(t){return["Element","Fragment"].some((function(e){return a(t,e)}))}function h(t){return a(t,"MouseEvent")}function b(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function y(t){return g(t)?[t]:function(t){return a(t,"NodeList")}(t)?d(t):Array.isArray(t)?t:d(document.querySelectorAll(t))}function w(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function x(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function E(t){var e,n=c(t)[0];return null!=n&&null!=(e=n.ownerDocument)&&e.body?n.ownerDocument:document}function O(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[r](e,n)}))}function C(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var T={isTouch:!1},A=0;function L(){T.isTouch||(T.isTouch=!0,window.performance&&document.addEventListener("mousemove",D))}function D(){var t=performance.now();t-A<20&&(T.isTouch=!1,document.removeEventListener("mousemove",D)),A=t}function k(){var t=document.activeElement;if(b(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}var R=Object.assign({appendTo:o,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),P=Object.keys(R);function j(t){var e=(t.plugins||[]).reduce((function(e,n){var r,o=n.name,i=n.defaultValue;o&&(e[o]=void 0!==t[o]?t[o]:null!=(r=R[o])?r:i);return e}),{});return Object.assign({},t,e)}function M(t,e){var n=Object.assign({},e,{content:s(e.content,[t])},e.ignoreAttributes?{}:function(t,e){return(e?Object.keys(j(Object.assign({},R,{plugins:e}))):P).reduce((function(e,n){var r=(t.getAttribute("data-tippy-"+n)||"").trim();if(!r)return e;if("content"===n)e[n]=r;else try{e[n]=JSON.parse(r)}catch(t){e[n]=r}return e}),{})}(t,e.plugins));return n.aria=Object.assign({},R.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?e.interactive:n.aria.expanded,content:"auto"===n.aria.content?e.interactive?null:"describedby":n.aria.content},n}function V(t,e){t.innerHTML=e}function I(t){var e=m();return!0===t?e.className="tippy-arrow":(e.className="tippy-svg-arrow",g(t)?e.appendChild(t):V(e,t)),e}function S(t,e){g(e.content)?(V(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?V(t,e.content):t.textContent=e.content)}function B(t){var e=t.firstElementChild,n=d(e.children);return{box:e,content:n.find((function(t){return t.classList.contains("tippy-content")})),arrow:n.find((function(t){return t.classList.contains("tippy-arrow")||t.classList.contains("tippy-svg-arrow")})),backdrop:n.find((function(t){return t.classList.contains("tippy-backdrop")}))}}function N(t){var e=m(),n=m();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=m();function o(n,r){var o=B(e),i=o.box,a=o.content,s=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||S(a,t.props),r.arrow?s?n.arrow!==r.arrow&&(i.removeChild(s),i.appendChild(I(r.arrow))):i.appendChild(I(r.arrow)):s&&i.removeChild(s)}return r.className="tippy-content",r.setAttribute("data-state","hidden"),S(r,t.props),e.appendChild(n),n.appendChild(r),o(t.props,t.props),{popper:e,onUpdate:o}}N.$$tippy=!0;var H=1,U=[],_=[];function z(e,a){var p,g,b,y,A,L,D,k,P=M(e,Object.assign({},R,j(v(a)))),V=!1,I=!1,S=!1,N=!1,z=[],F=u(wt,P.interactiveDebounce),W=H++,X=(k=P.plugins).filter((function(t,e){return k.indexOf(t)===e})),Y={id:W,reference:e,popper:m(),popperInstance:null,props:P,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:X,clearDelayTimeouts:function(){clearTimeout(p),clearTimeout(g),cancelAnimationFrame(b)},setProps:function(t){if(Y.state.isDestroyed)return;at("onBeforeUpdate",[Y,t]),bt();var n=Y.props,r=M(e,Object.assign({},n,v(t),{ignoreAttributes:!0}));Y.props=r,ht(),n.interactiveDebounce!==r.interactiveDebounce&&(pt(),F=u(wt,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?c(n.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");ut(),it(),J&&J(n,r);Y.popperInstance&&(Ct(),At().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)})));at("onAfterUpdate",[Y,t])},setContent:function(t){Y.setProps({content:t})},show:function(){var t=Y.state.isVisible,e=Y.state.isDestroyed,n=!Y.state.isEnabled,r=T.isTouch&&!Y.props.touch,a=i(Y.props.duration,0,R.duration);if(t||e||n||r)return;if(et().hasAttribute("disabled"))return;if(at("onShow",[Y],!1),!1===Y.props.onShow(Y))return;Y.state.isVisible=!0,tt()&&($.style.visibility="visible");it(),dt(),Y.state.isMounted||($.style.transition="none");if(tt()){var u=rt(),p=u.box,c=u.content;w([p,c],0)}L=function(){var t;if(Y.state.isVisible&&!N){if(N=!0,$.offsetHeight,$.style.transition=Y.props.moveTransition,tt()&&Y.props.animation){var e=rt(),n=e.box,r=e.content;w([n,r],a),x([n,r],"visible")}st(),ut(),f(_,Y),null==(t=Y.popperInstance)||t.forceUpdate(),at("onMount",[Y]),Y.props.animation&&tt()&&function(t,e){mt(t,e)}(a,(function(){Y.state.isShown=!0,at("onShown",[Y])}))}},function(){var t,e=Y.props.appendTo,n=et();t=Y.props.interactive&&e===o||"parent"===e?n.parentNode:s(e,[n]);t.contains($)||t.appendChild($);Y.state.isMounted=!0,Ct()}()},hide:function(){var t=!Y.state.isVisible,e=Y.state.isDestroyed,n=!Y.state.isEnabled,r=i(Y.props.duration,1,R.duration);if(t||e||n)return;if(at("onHide",[Y],!1),!1===Y.props.onHide(Y))return;Y.state.isVisible=!1,Y.state.isShown=!1,N=!1,V=!1,tt()&&($.style.visibility="hidden");if(pt(),vt(),it(!0),tt()){var o=rt(),a=o.box,s=o.content;Y.props.animation&&(w([a,s],r),x([a,s],"hidden"))}st(),ut(),Y.props.animation?tt()&&function(t,e){mt(t,(function(){!Y.state.isVisible&&$.parentNode&&$.parentNode.contains($)&&e()}))}(r,Y.unmount):Y.unmount()},hideWithInteractivity:function(t){nt().addEventListener("mousemove",F),f(U,F),F(t)},enable:function(){Y.state.isEnabled=!0},disable:function(){Y.hide(),Y.state.isEnabled=!1},unmount:function(){Y.state.isVisible&&Y.hide();if(!Y.state.isMounted)return;Tt(),At().forEach((function(t){t._tippy.unmount()})),$.parentNode&&$.parentNode.removeChild($);_=_.filter((function(t){return t!==Y})),Y.state.isMounted=!1,at("onHidden",[Y])},destroy:function(){if(Y.state.isDestroyed)return;Y.clearDelayTimeouts(),Y.unmount(),bt(),delete e._tippy,Y.state.isDestroyed=!0,at("onDestroy",[Y])}};if(!P.render)return Y;var q=P.render(Y),$=q.popper,J=q.onUpdate;$.setAttribute("data-tippy-root",""),$.id="tippy-"+Y.id,Y.popper=$,e._tippy=Y,$._tippy=Y;var G=X.map((function(t){return t.fn(Y)})),K=e.hasAttribute("aria-expanded");return ht(),ut(),it(),at("onCreate",[Y]),P.showOnCreate&&Lt(),$.addEventListener("mouseenter",(function(){Y.props.interactive&&Y.state.isVisible&&Y.clearDelayTimeouts()})),$.addEventListener("mouseleave",(function(){Y.props.interactive&&Y.props.trigger.indexOf("mouseenter")>=0&&nt().addEventListener("mousemove",F)})),Y;function Q(){var t=Y.props.touch;return Array.isArray(t)?t:[t,0]}function Z(){return"hold"===Q()[0]}function tt(){var t;return!(null==(t=Y.props.render)||!t.$$tippy)}function et(){return D||e}function nt(){var t=et().parentNode;return t?E(t):document}function rt(){return B($)}function ot(t){return Y.state.isMounted&&!Y.state.isVisible||T.isTouch||y&&"focus"===y.type?0:i(Y.props.delay,t?0:1,R.delay)}function it(t){void 0===t&&(t=!1),$.style.pointerEvents=Y.props.interactive&&!t?"":"none",$.style.zIndex=""+Y.props.zIndex}function at(t,e,n){var r;(void 0===n&&(n=!0),G.forEach((function(n){n[t]&&n[t].apply(n,e)})),n)&&(r=Y.props)[t].apply(r,e)}function st(){var t=Y.props.aria;if(t.content){var n="aria-"+t.content,r=$.id;c(Y.props.triggerTarget||e).forEach((function(t){var e=t.getAttribute(n);if(Y.state.isVisible)t.setAttribute(n,e?e+" "+r:r);else{var o=e&&e.replace(r,"").trim();o?t.setAttribute(n,o):t.removeAttribute(n)}}))}}function ut(){!K&&Y.props.aria.expanded&&c(Y.props.triggerTarget||e).forEach((function(t){Y.props.interactive?t.setAttribute("aria-expanded",Y.state.isVisible&&t===et()?"true":"false"):t.removeAttribute("aria-expanded")}))}function pt(){nt().removeEventListener("mousemove",F),U=U.filter((function(t){return t!==F}))}function ct(t){if(!T.isTouch||!S&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!Y.props.interactive||!C($,n)){if(c(Y.props.triggerTarget||e).some((function(t){return C(t,n)}))){if(T.isTouch)return;if(Y.state.isVisible&&Y.props.trigger.indexOf("click")>=0)return}else at("onClickOutside",[Y,t]);!0===Y.props.hideOnClick&&(Y.clearDelayTimeouts(),Y.hide(),I=!0,setTimeout((function(){I=!1})),Y.state.isMounted||vt())}}}function ft(){S=!0}function lt(){S=!1}function dt(){var t=nt();t.addEventListener("mousedown",ct,!0),t.addEventListener("touchend",ct,r),t.addEventListener("touchstart",lt,r),t.addEventListener("touchmove",ft,r)}function vt(){var t=nt();t.removeEventListener("mousedown",ct,!0),t.removeEventListener("touchend",ct,r),t.removeEventListener("touchstart",lt,r),t.removeEventListener("touchmove",ft,r)}function mt(t,e){var n=rt().box;function r(t){t.target===n&&(O(n,"remove",r),e())}if(0===t)return e();O(n,"remove",A),O(n,"add",r),A=r}function gt(t,n,r){void 0===r&&(r=!1),c(Y.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),z.push({node:e,eventType:t,handler:n,options:r})}))}function ht(){var t;Z()&&(gt("touchstart",yt,{passive:!0}),gt("touchend",xt,{passive:!0})),(t=Y.props.trigger,t.split(/\s+/).filter(Boolean)).forEach((function(t){if("manual"!==t)switch(gt(t,yt),t){case"mouseenter":gt("mouseleave",xt);break;case"focus":gt(n?"focusout":"blur",Et);break;case"focusin":gt("focusout",Et)}}))}function bt(){z.forEach((function(t){var e=t.node,n=t.eventType,r=t.handler,o=t.options;e.removeEventListener(n,r,o)})),z=[]}function yt(t){var e,n=!1;if(Y.state.isEnabled&&!Ot(t)&&!I){var r="focus"===(null==(e=y)?void 0:e.type);y=t,D=t.currentTarget,ut(),!Y.state.isVisible&&h(t)&&U.forEach((function(e){return e(t)})),"click"===t.type&&(Y.props.trigger.indexOf("mouseenter")<0||V)&&!1!==Y.props.hideOnClick&&Y.state.isVisible?n=!0:Lt(t),"click"===t.type&&(V=!n),n&&!r&&Dt(t)}}function wt(t){var e=t.target,n=et().contains(e)||$.contains(e);"mousemove"===t.type&&n||function(t,e){var n=e.clientX,r=e.clientY;return t.every((function(t){var e=t.popperRect,o=t.popperState,i=t.props.interactiveBorder,a=l(o.placement),s=o.modifiersData.offset;if(!s)return!0;var u="bottom"===a?s.top.y:0,p="top"===a?s.bottom.y:0,c="right"===a?s.left.x:0,f="left"===a?s.right.x:0,d=e.top-r+u>i,v=r-e.bottom-p>i,m=e.left-n+c>i,g=n-e.right-f>i;return d||v||m||g}))}(At().concat($).map((function(t){var e,n=null==(e=t._tippy.popperInstance)?void 0:e.state;return n?{popperRect:t.getBoundingClientRect(),popperState:n,props:P}:null})).filter(Boolean),t)&&(pt(),Dt(t))}function xt(t){Ot(t)||Y.props.trigger.indexOf("click")>=0&&V||(Y.props.interactive?Y.hideWithInteractivity(t):Dt(t))}function Et(t){Y.props.trigger.indexOf("focusin")<0&&t.target!==et()||Y.props.interactive&&t.relatedTarget&&$.contains(t.relatedTarget)||Dt(t)}function Ot(t){return!!T.isTouch&&Z()!==t.type.indexOf("touch")>=0}function Ct(){Tt();var n=Y.props,r=n.popperOptions,o=n.placement,i=n.offset,a=n.getReferenceClientRect,s=n.moveTransition,u=tt()?B($).arrow:null,p=a?{getBoundingClientRect:a,contextElement:a.contextElement||et()}:e,c=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(tt()){var n=rt().box;["placement","reference-hidden","escaped"].forEach((function(t){"placement"===t?n.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?n.setAttribute("data-"+t,""):n.removeAttribute("data-"+t)})),e.attributes.popper={}}}}];tt()&&u&&c.push({name:"arrow",options:{element:u,padding:3}}),c.push.apply(c,(null==r?void 0:r.modifiers)||[]),Y.popperInstance=t.createPopper(p,$,Object.assign({},r,{placement:o,onFirstUpdate:L,modifiers:c}))}function Tt(){Y.popperInstance&&(Y.popperInstance.destroy(),Y.popperInstance=null)}function At(){return d($.querySelectorAll("[data-tippy-root]"))}function Lt(t){Y.clearDelayTimeouts(),t&&at("onTrigger",[Y,t]),dt();var e=ot(!0),n=Q(),r=n[0],o=n[1];T.isTouch&&"hold"===r&&o&&(e=o),e?p=setTimeout((function(){Y.show()}),e):Y.show()}function Dt(t){if(Y.clearDelayTimeouts(),at("onUntrigger",[Y,t]),Y.state.isVisible){if(!(Y.props.trigger.indexOf("mouseenter")>=0&&Y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&V)){var e=ot(!1);e?g=setTimeout((function(){Y.state.isVisible&&Y.hide()}),e):b=requestAnimationFrame((function(){Y.hide()}))}}else vt()}}function F(t,e){void 0===e&&(e={});var n=R.plugins.concat(e.plugins||[]);document.addEventListener("touchstart",L,r),window.addEventListener("blur",k);var o=Object.assign({},e,{plugins:n}),i=y(t).reduce((function(t,e){var n=e&&z(e,o);return n&&t.push(n),t}),[]);return g(t)?i[0]:i}F.defaultProps=R,F.setDefaultProps=function(t){Object.keys(t).forEach((function(e){R[e]=t[e]}))},F.currentInput=T;var W=Object.assign({},t.applyStyles,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow)}}),X={mouseover:"mouseenter",focusin:"focus",click:"click"};var Y={name:"animateFill",defaultValue:!1,fn:function(t){var e;if(null==(e=t.props.render)||!e.$$tippy)return{};var n=B(t.popper),r=n.box,o=n.content,i=t.props.animateFill?function(){var t=m();return t.className="tippy-backdrop",x([t],"hidden"),t}():null;return{onCreate:function(){i&&(r.insertBefore(i,r.firstElementChild),r.setAttribute("data-animatefill",""),r.style.overflow="hidden",t.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(i){var t=r.style.transitionDuration,e=Number(t.replace("ms",""));o.style.transitionDelay=Math.round(e/10)+"ms",i.style.transitionDuration=t,x([i],"visible")}},onShow:function(){i&&(i.style.transitionDuration="0ms")},onHide:function(){i&&x([i],"hidden")}}}};var q={clientX:0,clientY:0},$=[];function J(t){var e=t.clientX,n=t.clientY;q={clientX:e,clientY:n}}var G={name:"followCursor",defaultValue:!1,fn:function(t){var e=t.reference,n=E(t.props.triggerTarget||e),r=!1,o=!1,i=!0,a=t.props;function s(){return"initial"===t.props.followCursor&&t.state.isVisible}function u(){n.addEventListener("mousemove",f)}function p(){n.removeEventListener("mousemove",f)}function c(){r=!0,t.setProps({getReferenceClientRect:null}),r=!1}function f(n){var r=!n.target||e.contains(n.target),o=t.props.followCursor,i=n.clientX,a=n.clientY,s=e.getBoundingClientRect(),u=i-s.left,p=a-s.top;!r&&t.props.interactive||t.setProps({getReferenceClientRect:function(){var t=e.getBoundingClientRect(),n=i,r=a;"initial"===o&&(n=t.left+u,r=t.top+p);var s="horizontal"===o?t.top:r,c="vertical"===o?t.right:n,f="horizontal"===o?t.bottom:r,l="vertical"===o?t.left:n;return{width:c-l,height:f-s,top:s,right:c,bottom:f,left:l}}})}function l(){t.props.followCursor&&($.push({instance:t,doc:n}),function(t){t.addEventListener("mousemove",J)}(n))}function d(){0===($=$.filter((function(e){return e.instance!==t}))).filter((function(t){return t.doc===n})).length&&function(t){t.removeEventListener("mousemove",J)}(n)}return{onCreate:l,onDestroy:d,onBeforeUpdate:function(){a=t.props},onAfterUpdate:function(e,n){var i=n.followCursor;r||void 0!==i&&a.followCursor!==i&&(d(),i?(l(),!t.state.isMounted||o||s()||u()):(p(),c()))},onMount:function(){t.props.followCursor&&!o&&(i&&(f(q),i=!1),s()||u())},onTrigger:function(t,e){h(e)&&(q={clientX:e.clientX,clientY:e.clientY}),o="focus"===e.type},onHidden:function(){t.props.followCursor&&(c(),p(),i=!0)}}}};var K={name:"inlinePositioning",defaultValue:!1,fn:function(t){var e,n=t.reference;var r=-1,o=!1,i=[],a={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(o){var a=o.state;t.props.inlinePositioning&&(-1!==i.indexOf(a.placement)&&(i=[]),e!==a.placement&&-1===i.indexOf(a.placement)&&(i.push(a.placement),t.setProps({getReferenceClientRect:function(){return function(t){return function(t,e,n,r){if(n.length<2||null===t)return e;if(2===n.length&&r>=0&&n[0].left>n[1].right)return n[r]||e;switch(t){case"top":case"bottom":var o=n[0],i=n[n.length-1],a="top"===t,s=o.top,u=i.bottom,p=a?o.left:i.left,c=a?o.right:i.right;return{top:s,bottom:u,left:p,right:c,width:c-p,height:u-s};case"left":case"right":var f=Math.min.apply(Math,n.map((function(t){return t.left}))),l=Math.max.apply(Math,n.map((function(t){return t.right}))),d=n.filter((function(e){return"left"===t?e.left===f:e.right===l})),v=d[0].top,m=d[d.length-1].bottom;return{top:v,bottom:m,left:f,right:l,width:l-f,height:m-v};default:return e}}(l(t),n.getBoundingClientRect(),d(n.getClientRects()),r)}(a.placement)}})),e=a.placement)}};function s(){var e;o||(e=function(t,e){var n;return{popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat(((null==(n=t.popperOptions)?void 0:n.modifiers)||[]).filter((function(t){return t.name!==e.name})),[e])})}}(t.props,a),o=!0,t.setProps(e),o=!1)}return{onCreate:s,onAfterUpdate:s,onTrigger:function(e,n){if(h(n)){var o=d(t.reference.getClientRects()),i=o.find((function(t){return t.left-2<=n.clientX&&t.right+2>=n.clientX&&t.top-2<=n.clientY&&t.bottom+2>=n.clientY})),a=o.indexOf(i);r=a>-1?a:r}},onHidden:function(){r=-1}}}};var Q={name:"sticky",defaultValue:!1,fn:function(t){var e=t.reference,n=t.popper;function r(e){return!0===t.props.sticky||t.props.sticky===e}var o=null,i=null;function a(){var s=r("reference")?(t.popperInstance?t.popperInstance.state.elements.reference:e).getBoundingClientRect():null,u=r("popper")?n.getBoundingClientRect():null;(s&&Z(o,s)||u&&Z(i,u))&&t.popperInstance&&t.popperInstance.update(),o=s,i=u,t.state.isMounted&&requestAnimationFrame(a)}return{onMount:function(){t.props.sticky&&a()}}}};function Z(t,e){return!t||!e||(t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom||t.left!==e.left)}return e&&function(t){var e=document.createElement("style");e.textContent=t,e.setAttribute("data-tippy-stylesheet","");var n=document.head,r=document.querySelector("head>style,head>link");r?n.insertBefore(e,r):n.appendChild(e)}('.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}'),F.setDefaultProps({plugins:[Y,G,K,Q],render:N}),F.createSingleton=function(t,e){var n;void 0===e&&(e={});var r,o=t,i=[],a=[],s=e.overrides,u=[],f=!1;function l(){a=o.map((function(t){return c(t.props.triggerTarget||t.reference)})).reduce((function(t,e){return t.concat(e)}),[])}function d(){i=o.map((function(t){return t.reference}))}function v(t){o.forEach((function(e){t?e.enable():e.disable()}))}function g(t){return o.map((function(e){var n=e.setProps;return e.setProps=function(o){n(o),e.reference===r&&t.setProps(o)},function(){e.setProps=n}}))}function h(t,e){var n=a.indexOf(e);if(e!==r){r=e;var u=(s||[]).concat("content").reduce((function(t,e){return t[e]=o[n].props[e],t}),{});t.setProps(Object.assign({},u,{getReferenceClientRect:"function"==typeof u.getReferenceClientRect?u.getReferenceClientRect:function(){var t;return null==(t=i[n])?void 0:t.getBoundingClientRect()}}))}}v(!1),d(),l();var b={fn:function(){return{onDestroy:function(){v(!0)},onHidden:function(){r=null},onClickOutside:function(t){t.props.showOnCreate&&!f&&(f=!0,r=null)},onShow:function(t){t.props.showOnCreate&&!f&&(f=!0,h(t,i[0]))},onTrigger:function(t,e){h(t,e.currentTarget)}}}},y=F(m(),Object.assign({},p(e,["overrides"]),{plugins:[b].concat(e.plugins||[]),triggerTarget:a,popperOptions:Object.assign({},e.popperOptions,{modifiers:[].concat((null==(n=e.popperOptions)?void 0:n.modifiers)||[],[W])})})),w=y.show;y.show=function(t){if(w(),!r&&null==t)return h(y,i[0]);if(!r||null!=t){if("number"==typeof t)return i[t]&&h(y,i[t]);if(o.indexOf(t)>=0){var e=t.reference;return h(y,e)}return i.indexOf(t)>=0?h(y,t):void 0}},y.showNext=function(){var t=i[0];if(!r)return y.show(0);var e=i.indexOf(r);y.show(i[e+1]||t)},y.showPrevious=function(){var t=i[i.length-1];if(!r)return y.show(t);var e=i.indexOf(r),n=i[e-1]||t;y.show(n)};var x=y.setProps;return y.setProps=function(t){s=t.overrides||s,x(t)},y.setInstances=function(t){v(!0),u.forEach((function(t){return t()})),o=t,v(!1),d(),l(),u=g(y),y.setProps({triggerTarget:a})},u=g(y),y},F.delegate=function(t,e){var n=[],o=[],i=!1,a=e.target,s=p(e,["target"]),u=Object.assign({},s,{trigger:"manual",touch:!1}),f=Object.assign({touch:R.touch},s,{showOnCreate:!0}),l=F(t,u);function d(t){if(t.target&&!i){var n=t.target.closest(a);if(n){var r=n.getAttribute("data-tippy-trigger")||e.trigger||R.trigger;if(!n._tippy&&!("touchstart"===t.type&&"boolean"==typeof f.touch||"touchstart"!==t.type&&r.indexOf(X[t.type])<0)){var s=F(n,f);s&&(o=o.concat(s))}}}}function v(t,e,r,o){void 0===o&&(o=!1),t.addEventListener(e,r,o),n.push({node:t,eventType:e,handler:r,options:o})}return c(l).forEach((function(t){var e=t.destroy,a=t.enable,s=t.disable;t.destroy=function(t){void 0===t&&(t=!0),t&&o.forEach((function(t){t.destroy()})),o=[],n.forEach((function(t){var e=t.node,n=t.eventType,r=t.handler,o=t.options;e.removeEventListener(n,r,o)})),n=[],e()},t.enable=function(){a(),o.forEach((function(t){return t.enable()})),i=!1},t.disable=function(){s(),o.forEach((function(t){return t.disable()})),i=!0},function(t){var e=t.reference;v(e,"touchstart",d,r),v(e,"mouseover",d),v(e,"focusin",d),v(e,"click",d)}(t)})),l},F.hideAll=function(t){var e=void 0===t?{}:t,n=e.exclude,r=e.duration;_.forEach((function(t){var e=!1;if(n&&(e=b(n)?t.reference===n:t.popper===n.popper),!e){var o=t.props.duration;t.setProps({duration:r}),t.hide(),t.state.isDestroyed||t.setProps({duration:o})}}))},F.roundArrow='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',F}));
+//# sourceMappingURL=tippy-bundle.umd.min.js.map
\ Kein Zeilenumbruch am Dateiende.
diff -Nru xnote-4.1.12/chrome/content/xnote-about-columnnoteTest.js xnote-4.5.48/chrome/content/xnote-about-columnnoteTest.js
--- xnote-4.1.12/chrome/content/xnote-about-columnnoteTest.js 2024-01-08 19:51:14.000000000 +0100
+++ xnote-4.5.48/chrome/content/xnote-about-columnnoteTest.js 1970-01-01 01:00:00.000000000 +0100
@@ -1,126 +0,0 @@
-// encoding='UTF-8'
-
-/*
- # File : xnote-window.xul
- # Authors : Hugo Smadja, Lorenz Froihofer, Klaus Buecher
- # Description : Functions associated with the XNote window (xnote-window.xul).
-*/
-
-//var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
-var { xnote } = ChromeUtils.import("resource://xnote/modules/xnote.jsm");
-
-var xnoteColumnObj = function () {
-
- function getHeaderForRow(row) {
- console.error("deprec: getHeaderForRow");
- gDBView= pub.getDBView();
- //return "";
- return gDBView.getFolderForViewIndex(row).GetMessageHeader(gDBView.getKeyAt(row));
- }
-
- var pub = {
-
- getDBView: function () {
- let mainWindow = Services.wm.getMostRecentWindow("mail:3pane");
- //console.log("about3",mainWindow.gTabmail.currentAbout3Pane, mainWindow.gTabmail.currentTabInfo.chromeBrowser.contentWindow, mainWindow.gTabmail.tabInfo[0].chromeBrowser.contentWindow );
- // this.mail3PaneWindow = mainWindow.gTabmail.currentAbout3Pane;
- // let gDBView = mainWindow.gTabmail.currentAbout3Pane.gDBView;//mainWindow.gDBView ;//this.mail3PaneWindow.gDBView;
- let gDBView = window.gDBView;//mainWindow.gDBView ;//this.mail3PaneWindow.gDBView;
- // this.threadTree = mainWindow.gTabmail.currentAbout3Pane.threadTree ;
- // this.threadTree.addEventListener("select", mainWindow.NostalgyDefLabel, false);
- return gDBView;
-
-
- },
-
-
- columnHandler: {
- getCellText: function (row, col) {
- // ~ dump("xnote: getCellText: "+JSON.stringify(xnote, null, 2)+"\n");
- let xnotePrefs = xnote.ns.Commons.xnotePrefs;
- if (xnotePrefs.show_first_x_chars_in_col > 0) {
- let note = new xnote.ns.Note(getHeaderForRow(row).messageId);
- if (note.exists()) {
- return " " + note.text.substr(0, xnotePrefs.show_first_x_chars_in_col);
- }
- }
- return null;
- },
- getSortStringForRow: function (hdr) {
- let xnotePrefs = xnote.ns.Commons.xnotePrefs;
- if (xnotePrefs.show_first_x_chars_in_col > 0) {
- let note = new xnote.ns.Note(hdr.messageId);
- if (note.exists()) {
- return " " + note.text.substr(0, xnotePrefs.show_first_x_chars_in_col);
- }
- else {
- return "";
- }
- }
- return pub.hasNote(hdr.messageId);
- },
- isString: function () {
- return true;
- },
-
- getCellProperties: function (row, col) { },
- getRowProperties: function (row) { },
- getImageSrc: function (row, col) {
- let hdr = getHeaderForRow(row);
- if (pub.hasNote(hdr.messageId)) {
- return "resource://xnote/skin/xnote_context.png";
- }
- else {
- return null;
- }
- },
- getSortLongForRow: function (hdr) {
- return pub.hasNote(hdr.messageId);
- }
- },
-
- DbObserver: {
- // Components.interfaces.nsIObserver
- observe: function (aMsgFolder, aTopic, aData) {
- pub.addCustomColumnHandler();
- }
- },
-
- /*
- * Get the notes file associated with the selected mail. Returns a handle to the
- * notes file if the message has a note, i.e., the corresponding file exists.
- * Returns null otherwise.
- */
- hasNote: function (messageID) {
- return xnote.ns.Note(messageID).exists();
- },
-
- onLoad: function () {
- let ObserverService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
- ObserverService.addObserver(pub.DbObserver, "MsgCreateDBView", false);
- pub.addCustomColumnHandler();
- },
-
-
- onUnload: function () {
- let ObserverService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
- ObserverService.removeObserver(pub.DbObserver, "MsgCreateDBView");
- //pub.removeCustomColumnHandler();
- },
-
- addCustomColumnHandler: function () {
- gDBView= pub.getDBView();
- gDBView.addColumnHandler("xnoteCol", pub.columnHandler);
- // console.log("gdbview", gDBView);
- gDBView.curCustomColumn = "xnoteCol";
- },
-
- removeCustomColumnHandler: function () {
- gDBView= pub.getDBView();
- gDBView.removeColumnHandler("xnoteCol");
- }
- }
-
- return pub;
-}();
diff -Nru xnote-4.1.12/chrome/content/xnote-about-overlay.js xnote-4.5.48/chrome/content/xnote-about-overlay.js
--- xnote-4.1.12/chrome/content/xnote-about-overlay.js 2024-01-09 21:26:48.000000000 +0100
+++ xnote-4.5.48/chrome/content/xnote-about-overlay.js 2025-03-11 16:57:36.000000000 +0100
@@ -27,11 +27,14 @@
- Remove the XNote tag ? No
- Remove the XNote labels associated to messages? No
*/
-console.log("start xnote-about-overlay");
-//var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
+//console.log("start xnote-about-overlay");
-var { xnote } = ChromeUtils.import("resource://xnote/modules/xnote.jsm");
+Services.scriptloader.loadSubScript("resource://xnote/content/tooltip/tippy/popper.js", window);
+Services.scriptloader.loadSubScript("resource://xnote/content/tooltip/tippy/tippy.js", window);//, tabAbout3pane.messageBrowser.contentWindow
+//console.log("tippy", window.tippy);
+
+var { xnote } = ChromeUtils.import ? ChromeUtils.import("resource://xnote/modules/xnote.jsm")
+ : ChromeUtils.importESModule("resource://xnote/modules/xnote.sys.mjs");
//var { MessageListTracker, MessageTracker, MessageManager } =
// ChromeUtils.importESModule("resource:///modules/ExtensionMessages.sys.mjs");
@@ -52,6 +55,17 @@
};
+function GetXNoteColumn() {
+ // let mainWindow = Services.wm.getMostRecentWindow("mail:3pane");
+ // let threadTree1 = mainWindow.gTabmail.currentAbout3Pane.threadTree ;
+ // let threadTree = mainWindow.gTabmail.tabInfo[0].chromeBrowser.contentWindow.threadTree;
+ //console.log("threadtree in about" , window, window.threadTree);
+ let XNcolumn = window.document.getElementById("XNote-column");
+// console.log("XNote-column", XNcolumn);
+ return XNcolumn;
+
+};
+
var xnoteOverlayObj = function () {
var pub = {};
Services.scriptloader.loadSubScript("chrome://xnote/content/scripts/notifyTools.js", pub, "UTF-8");
@@ -127,7 +141,7 @@
xnoteWindow = window.openDialog(
'chrome://xnote/content/xnote-window.xhtml',
'XNote',
- 'chrome=yes,dependent=yes,resizable=yes,modal=no,left=' + (window.screenX + note.x) + ',top=' + (window.screenY + note.y) + ',width=' + note.width + ',height=' + note.height + 50,
+ 'chrome=yes,dependent=yes,titlebar, resizable=yes,status, modal=no,left=' + (window.screenX + note.x) + ',top=' + (window.screenY + note.y) + ',width=' + note.width + ',height=' + (note.height + 50),
note, true
);
// console.log("xnotewnd in modify_note", xnoteWindow, window, window.document.title);
@@ -152,7 +166,8 @@
* Delete the note associated with the selected e-mail.
*/
pub.context_deleteNote = function () {
- //console.log("about context_deleteNote", noteForContextMenu);
+ // console.log("about context_deleteNote", noteForContextMenu);
+// pub.closeNote();
noteForContextMenu.deleteNote();
pub.updateTag("");
@@ -311,14 +326,84 @@
return null;
}
+ pub.mouseover = function (ev) {
+ if (ev.originalTarget.className.includes("xnote")) {
+/*
+// console.log("mouseover", ev);//, ev.originalTarget.parentElement, ev.originalTarget.parentElement._index);
+// console.log("mouseover2", this);
+// console.log("mouseover3", this.id);
+// console.log("mouseover4", ev.originalTarget);
+// console.log("mouseover5", ev.originalTarget.parentNode);
+// console.log("mouseover6", ev.originalTarget.parentNode.id);
+*/
+// console.log("mouseover7", ev.originalTarget.parentNode._index);
+ let msgHdr = this._view.getMsgHdrAt(ev.originalTarget.parentNode._index);
+ // console.log("entry", msgHdr, msgHdr.messageId);//, msgHdr.msgId, msgHdr.msgKey, subCol);
+ note = new xnote.ns.Note(msgHdr.messageId);
+ //subCol.textContent = subCol.title = note.text;
+ if (note.exists()) {
+ let ic = '\u{1F4D2}';
+// console.log("note", ic + note.text);//.substr(0, xnotePrefs.show_first_x_chars_in_col));
+ let txt = window.document.createElement("textarea");
+ txt.value = note.text;
+ txt.style.display = 'block';
+ txt.style.maxHeight = "500px";
+/* let popperOptions = {
+ modifiers: [
+ maxSize,
+ {
+ name: "applyMaxSize",
+ enabled: true,
+ phase: "beforeWrite",
+ requires: ["maxSize"],
+ fn({ state }) {
+ const { height } = state.modifiersData.maxSize;
+ // state.styles.popper.maxHeight = `${height}px`;
+ state.elements.popper.style.setProperty("--max-height", `${height}px`);
+ state.styles.popper.display = "flex";
+ }
+ }
+ ]
+ };
+*/
+ window.tippy(ev.originalTarget,
+ {
+ maxWidth: 550,
+ // popperOptions:popperOptions,
+ allowHTML: true,
+ placement: 'right',
+ // appendTo: document.body,
+ content: note.text.replace(/\n/g, '<p></p>'),//"test<p></p><b>hhh</b>",//txt, //"<div>"+note.text.replace(/\n/g, '<br>') +"</div>",//replace("\n", "<br/>"),
+ /*
+ function (reference) {
+ // console.log("tippy", reference);
+ // let content1 = "test";
+ //let imgg = await getImageData(reference.attachment.url);
+ reference._tippy.setContent(note.text);
+ // console.log("tipnote", imgg);
+ //var imgNew = tabAbout3pane.messageBrowser.contentDocument.createElement('img')
+ //imgNew.src = "data:image/jpeg;base64," + tabAbout3pane.messageBrowser.contentWindow.btoa(imgg);
+ //imgNew.setAttribute("height", "300");
+ //reference._tippy.setContent(imgNew);
+
+ return note.text.replace("\n", "<br/>");//node.key + " - <b>" + node.title + "</b> <p></p> " + note.body;//node.data.body;
+ }
+ */
+ });
+
+ }
+ }
+ }
+
pub.notef = function (ev) {
- // console.log("tree changed", ev.type, ev);
+ // console.log("tree changed", ev);
let aaas = () => {
let xnotePrefs = xnote.ns.Commons.xnotePrefs;
xnoteOverlayObj.showXNoteColumn = xnotePrefs.show_column;
if (xnotePrefs.show_column) {
- let locationColButton = ev.originalTarget.children[0].querySelector("#sizeColButton");
+ // let locationColButton = ev.originalTarget.children[0].querySelector("#sizeColButton");
+ let locationColButton = ev.originalTarget.parentNode.querySelector("#sizeColButton");
// console.log("locationColButton", locationColButton);
let locText = locationColButton.textContent;
if (xnoteOverlayObj && xnoteOverlayObj.showXNoteColumn) {
@@ -326,7 +411,8 @@
xnoteOverlayObj.oldLocationColTitle = locationColButton.textContent;
locationColButton.textContent = "XNote / " + locationColButton.textContent;
};
- let subCols = ev.originalTarget.children[0].body.querySelectorAll(".sizecol-column");
+ // let subCols = ev.originalTarget.children[0].body.querySelectorAll(".sizecol-column");
+ let subCols = ev.originalTarget.parentNode.querySelectorAll(".sizecol-column");
// console.log("sub", ev.originalTarget.children[0].body, ev.originalTarget.threadTree, subCols.NodeList);
/*
subCol.textContent = subCol.title = "b?h";
@@ -358,7 +444,7 @@
};
};
};
- setTimeout(aaas, 350);
+// setTimeout(aaas, 350); //use new column
},
pub.setTreeListener = function (e) {
@@ -367,7 +453,7 @@
tree.addEventListener('contextmenu', pub.messageListClicked, false);
tree.addEventListener("select", pub.notef, true);
tree.addEventListener("load", pub.notef, true);
-
+ tree.addEventListener("mouseover", pub.mouseover, true);
},
/**
@@ -376,7 +462,8 @@
* note.
*/
pub.onLoad = function (e) {
- console.log("onload xn about overlay");
+ // console.log("onload xn about overlay");
+ setTimeout(GetXNoteColumn, 1000);
try {
let m3pane = window;//.gTabmail.tabInfo[0].chromeBrowser.contentWindow;//window.gTabmail.currentAbout3Pane
// let tree = m3pane.threadTree;//document.getElementById('threadTree');
@@ -406,6 +493,8 @@
tree.addEventListener('contextmenu', pub.messageListClicked, false);
tree.addEventListener("select", pub.notef, true);
tree.addEventListener("load", pub.notef, true);
+ // GetXNoteColumn()
+ tree.addEventListener("mouseover", pub.mouseover, false);
// setTimeout(setTreeListener, 500);
};
diff -Nru xnote-4.1.12/chrome/content/xnote-columnnote.js xnote-4.5.48/chrome/content/xnote-columnnote.js
--- xnote-4.1.12/chrome/content/xnote-columnnote.js 2023-11-13 20:11:04.000000000 +0100
+++ xnote-4.5.48/chrome/content/xnote-columnnote.js 1970-01-01 01:00:00.000000000 +0100
@@ -1,108 +0,0 @@
-// encoding='UTF-8'
-
-/*
- # File : xnote-window.xul
- # Authors : Hugo Smadja, Lorenz Froihofer, Klaus Buecher
- # Description : Functions associated with the XNote window (xnote-window.xul).
-*/
-
-//var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
-var { xnote } = ChromeUtils.import("resource://xnote/modules/xnote.jsm");
-
-var xnoteColumnObj = function () {
-
- function getHeaderForRow(row) {
- console.error("deprec: getHeaderForRow");
- return "";
- //115 return gDBView.getFolderForViewIndex(row).
- //115 GetMessageHeader(gDBView.getKeyAt(row));
- }
-
- var pub = {
- columnHandler: {
- getCellText: function (row, col) {
- // ~ dump("xnote: getCellText: "+JSON.stringify(xnote, null, 2)+"\n");
- let xnotePrefs = xnote.ns.Commons.xnotePrefs;
- if (xnotePrefs.show_first_x_chars_in_col > 0) {
- let note = new xnote.ns.Note(getHeaderForRow(row).messageId);
- if (note.exists()) {
- return " " + note.text.substr(0, xnotePrefs.show_first_x_chars_in_col);
- }
- }
- return null;
- },
- getSortStringForRow: function (hdr) {
- let xnotePrefs = xnote.ns.Commons.xnotePrefs;
- if (xnotePrefs.show_first_x_chars_in_col > 0) {
- let note = new xnote.ns.Note(hdr.messageId);
- if (note.exists()) {
- return " " + note.text.substr(0, xnotePrefs.show_first_x_chars_in_col);
- }
- else {
- return "";
- }
- }
- return pub.hasNote(hdr.messageId);
- },
- isString: function () {
- return true;
- },
-
- getCellProperties: function (row, col) { },
- getRowProperties: function (row) { },
- getImageSrc: function (row, col) {
- let hdr = getHeaderForRow(row);
- if (pub.hasNote(hdr.messageId)) {
- return "resource://xnote/skin/xnote_context.png";
- }
- else {
- return null;
- }
- },
- getSortLongForRow: function (hdr) {
- return pub.hasNote(hdr.messageId);
- }
- },
-
- DbObserver: {
- // Components.interfaces.nsIObserver
- observe: function (aMsgFolder, aTopic, aData) {
- pub.addCustomColumnHandler();
- }
- },
-
- /*
- * Get the notes file associated with the selected mail. Returns a handle to the
- * notes file if the message has a note, i.e., the corresponding file exists.
- * Returns null otherwise.
- */
- hasNote: function (messageID) {
- return xnote.ns.Note(messageID).exists();
- },
-
- onLoad: function () {
- let ObserverService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
- ObserverService.addObserver(pub.DbObserver, "MsgCreateDBView", false);
- },
-
-
- onUnload: function () {
- let ObserverService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
- ObserverService.removeObserver(pub.DbObserver, "MsgCreateDBView");
- //pub.removeCustomColumnHandler();
- },
-
- addCustomColumnHandler: function () {
- // gDBView.addColumnHandler("xnoteCol", pub.columnHandler);
- gDBView.addColumnHandler("locationCol", pub.columnHandler);
- },
-
- removeCustomColumnHandler: function () {
- // gDBView.removeColumnHandler("xnoteCol");
- gDBView.removeColumnHandler("locationCol");
- }
- }
-
- return pub;
-}();
diff -Nru xnote-4.1.12/chrome/content/xnote-overlay.js xnote-4.5.48/chrome/content/xnote-overlay.js
--- xnote-4.1.12/chrome/content/xnote-overlay.js 2024-01-09 21:06:18.000000000 +0100
+++ xnote-4.5.48/chrome/content/xnote-overlay.js 2025-04-28 21:19:00.000000000 +0200
@@ -27,11 +27,10 @@
- Remove the XNote tag ? No
- Remove the XNote labels associated to messages? No
*/
-console.log("start xnote-overlay");
-//var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
+//console.log("start xnote-overlay");
-var { xnote } = ChromeUtils.import("resource://xnote/modules/xnote.jsm");
+var { xnote } = ChromeUtils.import ? ChromeUtils.import("resource://xnote/modules/xnote.jsm")
+ : ChromeUtils.importESModule("resource://xnote/modules/xnote.sys.mjs");
//var { MessageListTracker, MessageTracker, MessageManager } =
// ChromeUtils.importESModule("resource:///modules/ExtensionMessages.sys.mjs");
@@ -43,14 +42,6 @@
};
-function GetThreadTree() {
- let mainWindow = Services.wm.getMostRecentWindow("mail:3pane");
- let threadTree1 = mainWindow.gTabmail.currentAbout3Pane.threadTree ;
- let threadTree = mainWindow.gTabmail.tabInfo[0].chromeBrowser.contentWindow.threadTree;
-// console.log("" ,threadTree ,threadTree1);
- return threadTree1;
-
-};
var xnoteOverlayObj = function () {
var pub = {};
@@ -71,7 +62,18 @@
var xnoteWindow;
//msgHdr of the currently selected message
- var msgHdr;
+ var msgHdr;
+
+ pub.GetThreadTree = function () {
+ let mainWindow = Services.wm.getMostRecentWindow("mail:3pane");
+ let threadTree1 = mainWindow.gTabmail.currentAbout3Pane.threadTree;
+ let threadTree = mainWindow.gTabmail.tabInfo[0].chromeBrowser.contentWindow.threadTree;
+ // console.log("" ,threadTree ,threadTree1);
+ return threadTree1;
+
+ }
+
+
/**
* CALLER XUL
@@ -80,9 +82,9 @@
* FUNCTION
* Creation and modification of notes uses the same function, that is context_modifierNote()
*/
- pub.context_createNote = function (clicked = false) {
- // console.log("create hdr", pub.msgHdr);
- pub.context_modifyNote(false, clicked);
+ pub.context_createNote = function (clicked = false, msgId = null) {
+ // console.log("create hdr", pub.msgHdr);
+ pub.context_modifyNote(false, clicked, msgId);
}
/**
@@ -106,19 +108,20 @@
}
- pub.context_modifyNote = function (defaultSize, clicked = false) {
- // console.log("modifynote");
+ pub.context_modifyNote = function (defaultSize, clicked = false, msgId = null) {
+ // console.log("modifynote");
let gDBView = pub.getDBView();
- // debugger;
+ // debugger;
// console.log( "context_modifyNote wnd", window, window.document.title, gDBView.msgFolder.name, gDBView);
- if (clicked ||(gDBView.selection.currentIndex == currentIndex)) {
+ if (msgId || clicked || (gDBView.selection.currentIndex == currentIndex)) {
//Closes the note (if any) of the old (deselected) message.
pub.closeNote();
-
+
+let messageId = msgId || pub.getMessageID();
//Initialize note for the newly selected message.
- note = new xnote.ns.Note(pub.getMessageID());
+ note = new xnote.ns.Note(messageId);
pub.updateTag(note.text);
- // console.log("note", note, "wnd", window);
+ // console.log("note", note, "wnd", window);
if (defaultSize) {
note.x = note.DEFAULT_X;
note.y = note.DEFAULT_Y;
@@ -127,12 +130,22 @@
}
+ /*
+ xnoteWindow = window.openDialog(
+ 'chrome://xnote/content/testwin.xhtml',
+ 'XNote',
+ 'chrome=yes,dependent=yes,resizable=yes,titlebar=no, modal=no,left=' + (window.screenX + note.x) + ',top=' + (window.screenY + note.y) + ',width=' + note.width + ',height=' + note.height + "50px",
+ note, true
+ );
+ */
xnoteWindow = window.openDialog(
'chrome://xnote/content/xnote-window.xhtml',
'XNote',
- 'chrome=yes,dependent=yes,resizable=yes,modal=no,left=' + (window.screenX + note.x) + ',top=' + (window.screenY + note.y) + ',width=' + note.width + ',height=' + note.height + 50,
+ 'chrome=yes,dependent=yes,resizable=yes,titlebar=yes, modal=no,left=' + (window.screenX + note.x) + ',top=' + (window.screenY + note.y) + ',width=' + note.width + ',height=' + (note.height + 50),
note, true
);
+ //was titlebar=no
+
// console.log("xnotewnd in modify_note", xnoteWindow, window, window.document.title);
}
else {
@@ -155,8 +168,16 @@
* Delete the note associated with the selected e-mail.
*/
pub.context_deleteNote = function () {
- // console.log("context_deleteNote", noteForContextMenu);
- if (noteForContextMenu) noteForContextMenu.deleteNote(); else note.deleteNote();
+ let gDBView = pub.getDBView();
+ // console.log("context_deleteNote", noteForContextMenu);
+ if ( (gDBView.selection.currentIndex == currentIndex)) {
+ //Closes the note (if any) of the old (deselected) message.
+ pub.closeNote();
+ };
+ pub.closeNote();
+ note = new xnote.ns.Note(pub.getMessageID());
+ note.deleteNote();
+// if (noteForContextMenu) noteForContextMenu.deleteNote(); else note.deleteNote();
//pub.notifyTools.notifyBackground({ command: "deleteXNote" }); //done in XNote class
pub.updateTag("");
@@ -205,9 +226,9 @@
pub.updateTag = function (noteText) {
// console.log("updateTag", xnote.ns.Commons.useTag, noteText, pub.msgHdr);
if (xnote.ns.Commons.useTag) {
- // let gDBView = pub.getDBView();
+ // let gDBView = pub.getDBView();
// console.log("gDBView",gDBView, window.WL);
- // let msgHdr = gDBView.hdrForFirstSelectedMessage;
+ // let msgHdr = gDBView.hdrForFirstSelectedMessage;
let msgId = xnote.ns.Commons.context.extension.messageManager.convert(pub.msgHdr);
// If the note isn't empty,
if (noteText != '') {
@@ -261,12 +282,12 @@
}
let t = e.originalTarget;
if (true) { //t.className == "thread-container") {
- let tree = GetThreadTree();
+ let tree = pub.GetThreadTree();
// let treeCellInfo = tree.getCellAt(e.clientX, e.clientY);
currentIndex = tree._selection._currentIndex;
- // let gDBView = pub.getDBView();
- // pub.msgHdr = gDBView.
- // console.log("currInd/messlistclicked", currentIndex);//, gDBView); //115treeCellInfo.row;
+ // let gDBView = pub.getDBView();
+ // pub.msgHdr = gDBView.
+ // console.log("currInd/messlistclicked", currentIndex);//, gDBView); //115treeCellInfo.row;
};
}
@@ -274,7 +295,7 @@
/*102
let t = e.originalTarget;
if (t.localName == 'treechildren') {
- let tree = GetThreadTree();
+ let tree = pub.GetThreadTree();
let treeCellInfo = tree.getCellAt(e.clientX, e.clientY);
currentIndex = treeCellInfo.row;
}
@@ -283,7 +304,7 @@
let t = e.originalTarget;
//TB115 if (t.localName == 'treechildren') {
if (true) { //t.className == "thread-container") {
- let tree = GetThreadTree();
+ let tree = pub.GetThreadTree();
// let treeCellInfo = tree.getCellAt(e.clientX, e.clientY);
currentIndex = tree._selection._currentIndex;
// console.log("currInd", currentIndex); //115treeCellInfo.row;
@@ -324,26 +345,26 @@
* note.
*/
pub.onLoad = function (e) {
- console.log("onload xn overlay");
+ // console.log("onload xn overlay");
try {
let m3pane = window;//.gTabmail.tabInfo[0].chromeBrowser.contentWindow;//window.gTabmail.currentAbout3Pane
// let tree = m3pane.threadTree;//document.getElementById('threadTree');
// console.log("pane",m3pane.threadTree ,m3pane.threadTree );
- /*
- let tree = GetThreadTree();
- // console.log("pane",m3pane ,m3pane.threadTree , tree);
- // tree.addEventListener('contextmenu', pub.messageListClicked, false);
- // tree.addEventListener('mouseover', pub.getCurrentRow, false);
-
- //let messagePane = document.getElementById("messagepane");
- // m3pane.messagePane.addEventListener("contextmenu", pub.messagePaneClicked, false);
- // tree = GetThreadTree();
- if (tree) {
- tree.addEventListener('click', pub.getCurrentRow, false);
- tree.addEventListener('contextmenu', pub.messageListClicked, false);
-
- }
-*/
+ /*
+ let tree = pub.GetThreadTree();
+ // console.log("pane",m3pane ,m3pane.threadTree , tree);
+ // tree.addEventListener('contextmenu', pub.messageListClicked, false);
+ // tree.addEventListener('mouseover', pub.getCurrentRow, false);
+
+ //let messagePane = document.getElementById("messagepane");
+ // m3pane.messagePane.addEventListener("contextmenu", pub.messagePaneClicked, false);
+ // tree = pub.GetThreadTree();
+ if (tree) {
+ tree.addEventListener('click', pub.getCurrentRow, false);
+ tree.addEventListener('contextmenu', pub.messageListClicked, false);
+
+ }
+ */
}
catch (e) {
logException(e, false);
@@ -351,26 +372,26 @@
}
pub.onUnload = function (e) {
- // console.log("close xn-overlay");
+ // console.log("close xn-overlay");
try {
let m3pane = window;//.gTabmail.currentAbout3Pane
// let tree = m3pane.threadTree;// document.getElementById('threadTree');
- // tree = GetThreadTree();
+ // tree = pub.GetThreadTree();
//115!! tree.removeEventListener('mouseover', pub.getCurrentRow);
// let messagePane = document.getElementById("messagepane");
//115!! m3pane.messagePane.removeEventListener("contextmenu", pub.messagePaneClicked);
- // tree = GetThreadTree();
- // if (tree) {
-// tree.removeEventListener('click', pub.getCurrentRow);
-// tree.removeEventListener('contextmenu', pub.messageListClicked);
- //
- // }
+ // tree = pub.GetThreadTree();
+ // if (tree) {
+ // tree.removeEventListener('click', pub.getCurrentRow);
+ // tree.removeEventListener('contextmenu', pub.messageListClicked);
+ //
+ // }
}
catch (e) {
logException(e, false);
};
- // console.log("close xn-overlay, unloaded");
+ // console.log("close xn-overlay, unloaded");
}
return pub;
diff -Nru xnote-4.1.12/chrome/content/xnote-window.js xnote-4.5.48/chrome/content/xnote-window.js
--- xnote-4.1.12/chrome/content/xnote-window.js 2024-01-08 19:50:56.000000000 +0100
+++ xnote-4.5.48/chrome/content/xnote-window.js 2025-03-11 14:48:56.000000000 +0100
@@ -5,9 +5,10 @@
# Authors : Hugo Smadja, Lorenz Froihofer, Klaus Buecher
# Description : Functions associated with the XNote window (xnote-window.xul).
*/
-var { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+var { XPCOMUtils } = ChromeUtils.import ? ChromeUtils.import('resource://gre/modules/XPCOMUtils.jsm')
+ : ChromeUtils.importESModule("resource://gre/modules/XPCOMUtils.sys.mjs");
//var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
+//var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
XPCOMUtils.defineLazyScriptGetter(
@@ -16,7 +17,8 @@
"chrome://messenger/content/printUtils.js"
);
-var { xnote } = ChromeUtils.import("resource://xnote/modules/xnote.jsm");
+var { xnote } = ChromeUtils.import ? ChromeUtils.import("resource://xnote/modules/xnote.jsm")
+ : ChromeUtils.importESModule("resource://xnote/modules/xnote.sys.mjs");
// This object lives inside the xnote window. This is the old
// xnote.ns.Window object, which was falsly placed in the global xnode module.
@@ -45,13 +47,16 @@
pub.keys = [],
-
- pub.onBlur = function() {
- pub.saveNote();
- // window.xnoteWindowObj.updateTag
- let texte = self.document.getElementById('xnote-texte');
- pub.updateTag(texte.value);
- },
+ pub.timeout = false, // holder for timeout id
+ pub.delay = 250, // delay after resize event is "complete" to run callback
+ pub.calls = 0;
+
+ pub.onBlur = function () {
+ pub.saveNote();
+ // window.xnoteWindowObj.updateTag
+ let texte = self.document.getElementById('xnote-texte');
+ pub.updateTag(texte.value);
+ },
pub.onLoad = async function (e) {
//~ dump('\n->onLoad');
// premet l'acc?s au pr?f?rences
@@ -71,7 +76,7 @@
pub.keys["Shift"] = false;
pub.keys["Ctrl"] = false;
pub.keys["key"] = "";
-
+
let comm = await closeKey.shortcut.split("+");
pub.keys["key"] = comm[comm.length - 1].toLowerCase();
@@ -86,7 +91,15 @@
addEventListener('blur', window.xnoteWindowObj.onBlur, true);
addEventListener('unload', window.xnoteWindowObj.onUnload, false);
//window.addEventListener("resize", window.xnoteWindowObj.resize, false);
- //Necessary for correct shutdown as we are otherwise unable to correctly
+
+
+ //or use onbeforeunload
+ window.addEventListener('resize', function() {
+ // clear the timeout
+ clearTimeout(window.xnoteWindowObj.timeout);
+ // start timing for event "completion"
+ timeout = setTimeout(window.xnoteWindowObj.resizeEvent, window.xnoteWindowObj.delay);
+ }); //Necessary for correct shutdown as we are otherwise unable to correctly
//save a modified note
opener.addEventListener("unload", window.xnoteWindowObj.onOpenerUnload, false);
//Unfortunately, there seems to be no better way to react on window
@@ -97,35 +110,37 @@
let texte = self.document.getElementById('xnote-texte');
texte.value = note.text;
+ texte.textContent = note.text;
+ autosize(texte);
//if the same key opens and closes, we need this, otherwise the window closes immediately
setTimeout(() => { texte.addEventListener("keyup", window.xnoteWindowObj.onInput, false); }, 300);
- let fwd = self.document.getElementById('xnote-button-forward');
- fwd.href = "mailto:?body=" + encodeURI(note.text);
+ // let fwd = self.document.getElementById('xnote-button-forward');
+ //?? fwd.href = "mailto:?body=" + encodeURI(note.text);
//PrintUtils.showPageSetup();
//self.print();
//set date in the titlebar
- // let modificationdate = self.document.getElementById("xnote-mdate");
- // modificationdate.value = note.modificationDate;
+ // let modificationdate = self.document.getElementById("xnote-mdate");
+ // modificationdate.value = note.modificationDate;
document.title = "XNote " + note.modificationDate;
- self.setTimeout(window.xnoteWindowObj.resizeWindow,0);
+ self.setTimeout(window.xnoteWindowObj.resizeWindow, 0);
if (window.arguments[1]) {
texte.focus();
-// console.log("wnd has arg 1");
+ // console.log("wnd has arg 1");
}
else {
- self.setTimeout(window.opener.focus,0);
- //~ dump('\n<-onLoad');
-// console.log("wnd has no arg 1");
- }
+ self.setTimeout(window.opener.focus, 0);
+ //~ dump('\n<-onLoad');
+ // console.log("wnd has no arg 1");
+ }
}
function resizeWindow(width, height) {
@@ -160,11 +175,11 @@
*/
pub.updateTag = function () {
//~ dump('\n->updateTag');
- // opener.gTabmail.currentAbout3Pane.xnoteOverlayObj.updateTag(document.getElementById('xnote-texte').value);
- //102
- let texte = self.document.getElementById('xnote-texte');
-
- opener.xnoteOverlayObj.updateTag(texte.value);
+ // opener.gTabmail.currentAbout3Pane.xnoteOverlayObj.updateTag(document.getElementById('xnote-texte').value);
+ //102
+ let texte = self.document.getElementById('xnote-texte');
+
+ opener.xnoteOverlayObj.updateTag(texte.value);
//~ dump('\n<-updateTag');
}
@@ -221,27 +236,38 @@
pub.printNote = function () {
//window.document.documentElement.textContent= note.text;
- // console.log("printwindow", window.document, "docEl", window.document.documentElement , "text", window.document.documentElement.textContent, window);
+// console.log("printwindow", window.document, "docEl", window.document.documentElement , "text", window.document.documentElement.textContent, window);
// console.log("note", xnote.text);
- //window.print();
- // self.print();
+ // window.print();
+ // self.print();
// window.document.print();
//window.top = window;
//window.currentWindowGlobal = window;
//PrintUtils.printWindow(window, {});
+//debugger;
let mainWindow = Services.wm.getMostRecentWindow("mail:3pane");
/* */
let messageBrowser = mainWindow.document.getElementById("messagepane");//messagepane
- let msgBody = messageBrowser.contentDocument.documentElement.getElementsByTagName("body");
- // console.log("body", msgBody[0], messageBrowser.contentDocument.children[0].children[2]);
- let messagePaneBrowser = mainWindow.document.getElementById("xnote-print");
+// console.log("op", window.opener, opener);
+
+ // let a3p = mainWindow.gTabmail.currentTabInfo.chromeBrowser.contentWindow;
+ let a3p = mainWindow.gTabmail.currentAbout3Pane;//.gTabmail.currentTabInfo.chromeBrowser.contentWindow;
+ messageBrowser = a3p.document.getElementById("messageBrowser");//messagepane
+ let messagePaneBrowser = a3p.document.getElementById("xnote-print");
+// console.log("befbody", messageBrowser, messagePaneBrowser);
+
+ let msgBody = messageBrowser.contentDocument.getElementsByTagName("body"); //documentElement.
+// console.log("body", msgBody, messageBrowser.contentWindow, messageBrowser.contentWindow.document, messageBrowser.contentDocument.children[0].children[2],
+// messageBrowser.contentWindow.document.body,messageBrowser.contentWindow.document.body.children
+// );
+ // messagePaneBrowser = a3p.document.getElementById("xnote-print");
messagePaneBrowser.setAttribute('style', 'white-space: pre-line;');
let modificationdate = self.document.getElementById("xnote-mdate");
let docEl = messagePaneBrowser.contentDocument.documentElement;
let doc = messagePaneBrowser.contentDocument;
var p = doc.createElement("p");
- p.appendChild(doc.createTextNode("XNote " + modificationdate.value));
+ p.appendChild(doc.createTextNode(document.title));//modificationdate.value));
docEl.appendChild(p);
docEl.appendChild(doc.createElement("br"));
p = doc.createElement("p");
@@ -253,12 +279,15 @@
docEl.appendChild(hr);
+ /*
NodeList.prototype.forEach = Array.prototype.forEach;
- var children = msgBody[0].childNodes;
+ var children = messageBrowser.contentWindow.document.body.childNodes;//msgBody.childNodes;
children.forEach(function (item) {
- var cln = item.cloneNode(true);
- docEl.appendChild(cln);
+// var cln = item.cloneNode(true);
+ // docEl.appendChild(cln);
+ let cln = doc.importNode(item, true);
});
+ */
//messagePaneBrowser.contentDocument.documentElement.textContent =
//"XNote " +modificationdate.value +"\r\n" + note.text;//"eee";
mainWindow.PrintUtils.startPrintWindow(messagePaneBrowser.browsingContext, {});
@@ -318,12 +347,12 @@
}
-pub.searchXNotes = function () {
- // console.log("xnote search clicked");
-// window.close();
- pub.notifyTools.notifyBackground({ command: "searchXNotes" });
+ pub.searchXNotes = function () {
+ // console.log("xnote search clicked");
+ // window.close();
+ pub.notifyTools.notifyBackground({ command: "searchXNotes" });
-}
+ }
pub.copyNoteToClipboard = function () {
@@ -390,7 +419,7 @@
*/
pub.redimenssionnement = function (e) {
//~ dump('\n w.document.width='+window.document.width+' ; w.document.height='+window.document.height);
-//console.log("redimenssionnement");
+ //console.log("redimenssionnement");
//~ dump('\nlargeur='+document.getElementById('xnote-texte').style.width);
let newWidth = widthBeforeMove + e.screenX - xBeforeMove;
let newHeight = heightBeforeMove + e.screenY - yBeforeMove;
@@ -399,25 +428,56 @@
resizeWindow(newWidth, newHeight);
pub.noteModified();
}
-pub.resize = function() { //not working
- // console.log("resize");
- //window.resizeTo(width, height);
- document.getElementById("xnote-texte").style.height = (window.innerHeight - 40) + "px";
- //resizeWindow(window.innerWidth, window.innerHeight);
+ pub.resizeEvent = function (ev) { //not working
+ // console.log("resize");
+ //window.resizeTo(width, height);
+ // document.getElementById("xnote-texte").style.height = (window.innerHeight - 40) + "px";
+ pub.noteModified();
+ //redraw textarea
+// const t = window.document.createElement('span');
+ let st = window.document.getElementById('xnote-note');
+// st.appendChild(t);
+// setTimeout(() => { st.removeChild(t) }, 0);
+let ht = st.style.height;
+//console.log("ht", ht);
-
-},
- /**
- * quand le bouton de la souris est relach?, on supprime la capture
- * du d?placement de la souris.
- */
- pub.stopRedimenssionnement = function (e) {
- document.removeEventListener('mousemove', window.xnoteWindowObj.redimenssionnement, true);
- document.removeEventListener('mouseup', window.xnoteWindowObj.stopRedimenssionnement, true);
- let texte = document.getElementById('xnote-texte');
- texte.focus();
- }
+ var element = document.getElementById('xnote-texte');
+ element.style.height = "100%";//"calc(100% - 10px)";
+ var n = document.createTextNode(' ');
+ var disp = element.style.display; // don't worry about previous display style
+
+// element.appendChild(n);
+ // element.style.display = 'none';
+
+// setTimeout(function(){
+// element.style.display = disp;
+// n.parentNode.removeChild(n);
+ // },20); // you can play with this timeout to make it as short as possible
+ //resizeWindow(window.innerWidth, window.innerHeight);
+ autosize(element);
+
+ },
+
+ pub.resize = function () { //not working
+ // console.log("resize");
+ //window.resizeTo(width, height);
+ document.getElementById("xnote-texte").style.height = (window.innerHeight - 40) + "px";
+
+ //resizeWindow(window.innerWidth, window.innerHeight);
+
+
+ },
+ /**
+ * quand le bouton de la souris est relach?, on supprime la capture
+ * du d?placement de la souris.
+ */
+ pub.stopRedimenssionnement = function (e) {
+ document.removeEventListener('mousemove', window.xnoteWindowObj.redimenssionnement, true);
+ document.removeEventListener('mouseup', window.xnoteWindowObj.stopRedimenssionnement, true);
+ let texte = document.getElementById('xnote-texte');
+ texte.focus();
+ }
pub.checkOpenerMoved = function () {
if (oldOpenerX != opener.screenX || oldOpenerY != opener.screenY) {
@@ -428,7 +488,7 @@
}
pub.onUnload = function (e) {
- // console.log("unload XNote wnd");
+ // console.log("unload XNote wnd");
// ~dump("\n->onUnload");
//console.log("note unLoad");
pub.saveNote();
@@ -439,7 +499,7 @@
removeEventListener('unload', window.xnoteWindowObj.onUnload);
opener.removeEventListener("unload", window.xnoteWindowObj.onOpenerUnload);
texte.removeEventListener("keyup", window.xnoteWindowObj.onInput);
- // window.removeEventListener("resize", window.xnoteWindowObj.redimenssionnement);
+ // window.removeEventListener("resize", window.xnoteWindowObj.redimenssionnement);
}
pub.onOpenerUnload = function (e) {
diff -Nru xnote-4.1.12/chrome/content/xnote-window.xhtml xnote-4.5.48/chrome/content/xnote-window.xhtml
--- xnote-4.1.12/chrome/content/xnote-window.xhtml 2023-11-22 18:19:30.000000000 +0100
+++ xnote-4.5.48/chrome/content/xnote-window.xhtml 2025-03-26 18:25:50.000000000 +0100
@@ -1,82 +1,114 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+<?xml-stylesheet href='resource://xnote/skin/xnote-window.css' type='text/css'?>
<!--
- # File : xnote-window.xul
- # Authors : Hugo Smadja, Lorenz Froihofer
- # Description : d?crit les objets qui compose une XNote
-
-
-->
-<?xml-stylesheet href='resource://xnote/skin/xnote-window.css' type='text/css'?>
-
<!DOCTYPE window SYSTEM "chrome://xnote/locale/xnote-window.dtd">
-<window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul' xmlns:html='http://www.w3.org/1999/xhtml'
- id='xnote-window' title="XNote" onkeypress='if (event.keyCode==27) close();' minwidth='58'
- windowtype='xnote:note' minheight='88'
- >
-
- <script src="chrome://xnote/content/xnote-window.js"></script>
-
- <hbox id='xnote-note' orient='vertical' flex='1'>
- <!--
- <box id='xnote-barre'>
-
- <titlebar flex='1' onmouseup='window.xnoteWindowObj.noteModified();'>
- <label id='xnote-titre' value='&xnote;' />
- <label id='xnote-mdate' class="boite-de-texte" readonly="true" />
- </titlebar>
-
- <image id='xnote-bouton-fermer' tooltiptext="&close;" class='custombutton-smaller'
- onclick='if (event.button==0) { window.xnoteWindowObj.saveNote(); event.view.close(); }' />
- </box>
--->
- <html:textarea id='xnote-texte' class='boite-de-texte' oninput='window.xnoteWindowObj.noteModified();' />
-
- <hbox id='xnote-barre-bottom-html' >
-<!-- <hbox id='xnote-barre-bottom-html' >
--->
- <ul>
- <image id='xnote-bouton-suppr' class='custombutton-smaller-html' tooltiptext='&suppr;'
- onclick='if (event.button==0) { if (confirm("&xnote.ask.deletion;")) { window.xnoteWindowObj.deleteNote();event.view.close(); }}'>
- </image>
-
- <image id='xnote-button-print' class='custombutton-smaller' tooltiptext='&print;'
- src="chrome://messenger/skin/icons/print.svg"
- onclick='if (event.button==0 ) { window.xnoteWindowObj.printNote(); }'>
- </image>
-
-
-
- <html:a href="mailto:" id='xnote-button-forward'>
- <image id='xnote-button-forward-img' class='custombutton-smaller' tooltiptext='&forward;'
- src="chrome://messenger/skin/icons/forward.svg">
- </image>
- </html:a>
-
- <image id='xnote-button-copy' class='custombutton-smaller' tooltiptext='copy to clipboard'
- onclick='if (event.button==0 ) { window.xnoteWindowObj.copyNoteToClipboard(); }'>
- </image>
-<!-- src="chrome://xnote/content/skin/iconmonstr-clipboard-13-16.png"
- -->
- <image id='xnote-button-bookmark' class='custombutton-smaller'
- tooltiptext='Bookmark this XNote ... Install bookmarks addon if not done.'
- src="chrome://xnote/content/skin/iconmonstr-bookmark-6-16.png"
- onclick='if (event.button==0 ) { window.xnoteWindowObj.bookmarkNote(); }'>
- </image>
-
-
- <image id='xnote-search' class='custombutton-smaller'
- tooltiptext='Search text over all XNotes ... Install Expression Search NG addon to do the actual search.'
- src="chrome://xnote/content/skin/find.svg"
- onclick='if (event.button==0 ) { window.xnoteWindowObj.searchXNotes(); }'>
- </image>
-
- </ul>
- <ul> <li> <html:input id='xnote-redim' class='boite-de-texte1'
- onmousedown='window.xnoteWindowObj.startRedimensionnement(event);' readonly='true' context='false' />
- </li></ul>
-</hbox>
- <!-- </hbox>-->
-
-</hbox>
+<!-- hidechrome='true'
+
+ screenX="80"
+ screenY="80"
+ height="300"
+ width="300"
+
+ -->
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"
+ id='xnote-window' title="XNote" onkeypress='if (event.keyCode==27) close();' minwidth='58'
+ windowtype='xnote:note' minheight='88' persist="screenX screenY height width">
+ <script src="chrome://xnote/content/autosize.js"></script>
+ <script src="chrome://xnote/content/xnote-window.js"></script>
+
+ <body>
+ <html:div id='xnote-note' style="height:75vh;">
+ <!-- margin: 20px;
+ <box id='xnote-barre'>
+
+ <titlebar flex='1' onmouseup='window.xnoteWindowObj.noteModified();'>
+ <label id='xnote-titre' value='&xnote;' />
+ <label id='xnote-mdate' class="boite-de-texte" readonly="true" />
+ </titlebar>
+
+ <image id='xnote-bouton-fermer' tooltiptext="&close;" class='custombutton-smaller'
+ onclick='if (event.button==0) { window.xnoteWindowObj.saveNote(); event.view.close(); }' />
+ </box>
+ class='boite-de-texte' margin: 20px; margin: 20px;
+ -->
+ <html:textarea id='xnote-texte' oninput='window.xnoteWindowObj.noteModified();' />
+
+ <!-- <hbox id='xnote-barre-bottom-html' >
+ -->
+ </html:div>
+ <html:div id='xnote-barre-bottom-html' style="height:18px">
+
+ <html:span>
+
+ <html:img id='xnote-bouton-suppr' style = 'height:16px' title='&suppr;'
+ src="chrome://xnote/content/skin/iconmonstr-trash-can-10.svg"
+ onclick='if (event.button==0) { if (confirm("&xnote.ask.deletion;")) { window.xnoteWindowObj.deleteNote();event.view.close(); }}'>
+ </html:img>
+ <html:img id='xnote-button-print' tooltiptext='&print;' title = 'Print XNote'
+ src="chrome://messenger/skin/icons/print.svg"
+ onclick='if (event.button==0 ) { window.xnoteWindowObj.printNote(); }'>
+ </html:img>
+<!--
+ <html:img id='xnote-button-forward-img' tooltiptext='&forward;'
+ src="chrome://messenger/skin/icons/forward.svg">
+ </html:img>
+
+ -->
+
+
+ <html:img id='xnote-button-copy' tooltiptext='copy to clipboard'
+ src="chrome://xnote/content/skin/iconmonstr-clipboard-13-16.png"
+ onclick='if (event.button==0 ) { window.xnoteWindowObj.copyNoteToClipboard(); }'>
+ </html:img>
+
+ <html:img id='xnote-search' class='custombutton-smaller'
+ title='Search text over all XNotes ... Install Expression Search NG addon to do the actual search.'
+ src="chrome://xnote/content/skin/find.svg"
+ onclick='if (event.button==0 ) { window.xnoteWindowObj.searchXNotes(); }'>
+ </html:img>
+ <!--
+ src="chrome://global/skin/icons/delete.svg" iconmonstr-clipboard-13-16.png iconmonstr-clipboard-13.svg
+
+ content_paste_16dp_5F6368_FILL0_wght400_GRAD0_opsz20.png
+ <html:button>
+ <html:img id='xnote-button-print' tooltiptext='&print;'
+ src="chrome://messenger/skin/icons/print.svg"
+ onclick='if (event.button==0 ) { window.xnoteWindowObj.printNote(); }'>
+ </html:img>
+ </html:button>
+
+
+
+ <html:button>
+ <html:a href="mailto:" id='xnote-button-forward'>
+ <html:img id='xnote-button-forward-img' tooltiptext='&forward;'
+ src="chrome://messenger/skin/icons/forward.svg">
+ </html:img>
+ </html:a>
+ </html:button>
+
+
+ class='custombutton-smaller'
+ <html:li> </html:li>
+ <html:li> </html:li>
+
+
+
+
+ <html:button>
+ <html:img id='xnote-button-copy' tooltiptext='copy to clipboard'
+ src="chrome://messenger/skin/icons/iconmonstr-clipboard-13-16.png"
+ onclick='if (event.button==0 ) { window.xnoteWindowObj.printNote(); }'>
+ </html:img>
+ </html:button>
+
+ <html:ul> </html:ul>
+ -->
+
+ </html:span>
+ </html:div>
+ </body>
</window>
\ Kein Zeilenumbruch am Dateiende.
diff -Nru xnote-4.1.12/chrome/modules/commons.jsm xnote-4.5.48/chrome/modules/commons.jsm
--- xnote-4.1.12/chrome/modules/commons.jsm 2023-10-01 20:57:12.000000000 +0200
+++ xnote-4.5.48/chrome/modules/commons.jsm 2024-09-17 23:07:00.000000000 +0200
@@ -1,4 +1,6 @@
//See https://developer.mozilla.org/en/Using_JavaScript_code_modules for explanation
+'use strict';
+
let EXPORTED_SYMBOLS = ["Commons"];
var Commons = function() {
@@ -79,7 +81,7 @@
checkXNoteTag : function() {
//Check preference for whether tags should be used
_useTag = _xnotePrefs.usetag;
- // console.debug(`checkXNoteTag: usetag=${_useTag}`);
+// console.log(`checkXNoteTag: usetag=${_useTag}`);
if(_useTag) {
// Get the tag service.
let tagService = Components.classes["@mozilla.org/messenger/tagservice;1"]
diff -Nru xnote-4.1.12/chrome/modules/commons.sys.mjs xnote-4.5.48/chrome/modules/commons.sys.mjs
--- xnote-4.1.12/chrome/modules/commons.sys.mjs 1970-01-01 01:00:00.000000000 +0100
+++ xnote-4.5.48/chrome/modules/commons.sys.mjs 2025-03-11 10:36:16.000000000 +0100
@@ -0,0 +1,130 @@
+//See https://developer.mozilla.org/en/Using_JavaScript_code_modules for explanation
+'use strict';
+
+//let EXPORTED_SYMBOLS = ["Commons"];
+
+export var Commons = function() {
+ const _XNOTE_VERSION = "@@@XNOTE.VERSION@@@";
+
+ // CONSTANT - Default tag name and color
+ const XNOTE_TAG_NAME = "XNote";
+ const XNOTE_TAG_COLOR = "#FFCC00";
+
+ //Application IDs of applications we support
+ const THUNDERBIRD_ID = "{3550f703-e582-4d05-9a08-453d09bdfdc6}";
+ //const SEAMONKEY_ID = "{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}";
+
+ /**
+ * Used to distinguish between Thunderbird and Seamonkey
+ */
+ var _runningThunderbird;
+
+ /**
+ * Using tags?
+ */
+ var _useTag;
+
+ //XNote prefs
+ var _xnotePrefs;
+
+ //XNote legacy prefs API
+ var _xnoteLegacyPrefs;
+
+ //is XNote installed for the first time on that TB profile?
+ var _isNewInstallation;
+
+ //result
+ var pub = {
+ //Current XNote version
+ get XNOTE_VERSION() {
+ return _XNOTE_VERSION;
+ },
+
+ init : function() {
+ let appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
+ .getService(Components.interfaces.nsIXULAppInfo);
+ if(appInfo.ID == THUNDERBIRD_ID) {
+ _runningThunderbird = true;
+ }
+ else {
+ _runningThunderbird = false;
+ }
+
+ _xnoteLegacyPrefs = Components.classes["@mozilla.org/preferences-service;1"].
+ getService(Components.interfaces.nsIPrefService).
+ getBranch("extensions.xnote.");
+ _xnoteLegacyPrefs.QueryInterface(Components.interfaces.nsIPrefBranch);
+ },
+ get isInThunderbird() {
+ return _runningThunderbird;
+ },
+ get isNewInstallation() {
+ return _isNewInstallation;
+ },
+ set isNewInstallation(isNewInstallation) {
+ _isNewInstallation = isNewInstallation;
+ },
+ get xnoteLegacyPrefs() {
+ return _xnoteLegacyPrefs;
+ },
+ get xnotePrefs() {
+ return _xnotePrefs;
+ },
+ set xnotePrefs(xnotePrefs) {
+ // console.debug(`New XNote Prefs: ${JSON.stringify(xnotePrefs)}`);
+ _xnotePrefs = xnotePrefs;
+ },
+ get useTag() {
+ return _useTag;
+ },
+
+ checkXNoteTag : function() {
+ //Check preference for whether tags should be used
+ _useTag = _xnotePrefs.usetag;
+// console.log(`checkXNoteTag: usetag=${_useTag}`);
+ if(_useTag) {
+ // Get the tag service.
+ let tagService = Components.classes["@mozilla.org/messenger/tagservice;1"]
+ .getService(Components.interfaces.nsIMsgTagService);
+ let prefs = Components.classes['@mozilla.org/preferences-service;1']
+ .getService(Components.interfaces.nsIPrefBranch);
+
+ let addTag = true;
+ // Test if the XNote Tag already exists, if not, create it
+ try {
+ if (tagService.getTagForKey("xnote").trim() != "") {
+ addTag = false;
+ // The following happens if the user enters a name in the
+ // preferences dialog, but does not choose a color.
+ if (!prefs.prefHasUserValue("mailnews.tags.xnote.color")) {
+ prefs.setStringPref("mailnews.tags.xnote.color", XNOTE_TAG_COLOR); //setCharPref
+ }
+ }
+ }
+ catch (e) {
+ //This happens if the tag does not exist.
+ //~dump("\nCould not get tag for key 'xnote': "+e.message+"\n"+e.trace);
+ }
+ if (addTag) {
+ let tagName = XNOTE_TAG_NAME;
+ let tagColor = XNOTE_TAG_COLOR;
+ if (prefs.prefHasUserValue("mailnews.tags.xnote.tag")) {
+ tagName = prefs.getStringPref("mailnews.tags.xnote.tag"); //getCharPref
+ if (tagName.trim() == "") tagName = XNOTE_TAG_NAME;
+ }
+ if (prefs.prefHasUserValue("mailnews.tags.xnote.color")) tagColor = prefs.getCharPref("mailnews.tags.xnote.color");
+ tagService.addTagForKey( "xnote", tagName, tagColor, '');
+ }
+ }
+ },
+
+ printEventDomAttrModified : function (e) {
+ //~dump("domAttrModified: "+e.attrName+", node="+e.relatedNode.nodeName+", node.ownerElement="+e.relatedNode.ownerElement+"\n");
+ //~for (var i in e.relatedNode.ownerElement) dump(i+"\n");
+ //~dump("\n");
+ }
+
+ };
+
+ return pub;
+}();
diff -Nru xnote-4.1.12/chrome/modules/dateformat.jsm xnote-4.5.48/chrome/modules/dateformat.jsm
--- xnote-4.1.12/chrome/modules/dateformat.jsm 2023-09-22 22:00:30.000000000 +0200
+++ xnote-4.5.48/chrome/modules/dateformat.jsm 2024-07-13 23:10:04.000000000 +0200
@@ -3,6 +3,8 @@
By Steven Levithan <http://stevenlevithan.com> */
//See https://developer.mozilla.org/en/Using_JavaScript_code_modules for explanation
+'use strict';
+
let EXPORTED_SYMBOLS = ["DateFormat"];
var DateFormat = new Date();
diff -Nru xnote-4.1.12/chrome/modules/dateformat.sys.mjs xnote-4.5.48/chrome/modules/dateformat.sys.mjs
--- xnote-4.1.12/chrome/modules/dateformat.sys.mjs 1970-01-01 01:00:00.000000000 +0100
+++ xnote-4.5.48/chrome/modules/dateformat.sys.mjs 2025-03-11 10:36:00.000000000 +0100
@@ -0,0 +1,55 @@
+//From this guy's site, it's MIT licensed
+/* Date/Time Format v0.2; MIT-style license
+By Steven Levithan <http://stevenlevithan.com> */
+
+//See https://developer.mozilla.org/en/Using_JavaScript_code_modules for explanation
+'use strict';
+
+//let EXPORTED_SYMBOLS = ["DateFormat"];
+
+export var DateFormat = new Date();
+
+DateFormat.format = function(mask) {
+ var d = this; // Needed for the replace() closure
+
+ // If preferred, zeroise() can be moved out of the format() method for performance and reuse purposes
+ var zeroize = function (value, length) {
+ if (!length) length = 2;
+ value = String(value);
+ for (var i = 0, zeros = ''; i < (length - value.length); i++) {
+ zeros += '0';
+ }
+ return zeros + value;
+ };
+
+ return mask.replace(/"[^"]*"|'[^']*'|\b(?:d{1,4}|m{1,4}|yy(?:yy)?|([hHMs])\1?|TT|tt|[lL])\b/g, function($0) {
+ switch($0) {
+ case 'd': return d.getDate();
+ case 'dd': return zeroize(d.getDate());
+ case 'ddd': return ['Sun','Mon','Tue','Wed','Thr','Fri','Sat'][d.getDay()];
+ case 'dddd': return ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'][d.getDay()];
+ case 'm': return d.getMonth() + 1;
+ case 'mm': return zeroize(d.getMonth() + 1);
+ case 'mmm': return ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'][d.getMonth()];
+ case 'mmmm': return ['January','February','March','April','May','June','July','August','September','October','November','December'][d.getMonth()];
+ case 'yy': return String(d.getFullYear()).substr(2);
+ case 'yyyy': return d.getFullYear();
+ case 'h': return d.getHours() % 12 || 12;
+ case 'hh': return zeroize(d.getHours() % 12 || 12);
+ case 'H': return d.getHours();
+ case 'HH': return zeroize(d.getHours());
+ case 'M': return d.getMinutes();
+ case 'MM': return zeroize(d.getMinutes());
+ case 's': return d.getSeconds();
+ case 'ss': return zeroize(d.getSeconds());
+ case 'l': return zeroize(d.getMilliseconds(), 3);
+ case 'L': var m = d.getMilliseconds();
+ if (m > 99) m = Math.round(m / 10);
+ return zeroize(m);
+ case 'tt': return d.getHours() < 12 ? 'am' : 'pm';
+ case 'TT': return d.getHours() < 12 ? 'AM' : 'PM';
+ // Return quoted strings with the surrounding quotes removed
+ default: return $0.substr(1, $0.length - 2);
+ }
+ });
+};
diff -Nru xnote-4.1.12/chrome/modules/xnote.jsm xnote-4.5.48/chrome/modules/xnote.jsm
--- xnote-4.1.12/chrome/modules/xnote.jsm 2023-11-15 23:19:38.000000000 +0100
+++ xnote-4.5.48/chrome/modules/xnote.jsm 2025-03-11 10:30:48.000000000 +0100
@@ -1,4 +1,7 @@
//See https://developer.mozilla.org/en/Using_JavaScript_code_modules for explanation
+
+'use strict';
+
var EXPORTED_SYMBOLS = ["xnote"];
//var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
@@ -38,7 +41,9 @@
}
else try {
let storagePath = xnotePrefs.storage_path;
- let FileUtils = ChromeUtils.import("resource://gre/modules/FileUtils.jsm").FileUtils;
+ let { FileUtils } = ChromeUtils.import ? ChromeUtils.import("resource://gre/modules/FileUtils.jsm")
+ : ChromeUtils.importESModule("resource://gre/modules/FileUtils.sys.mjs");
+
if (storagePath != "") {
if (storagePath.indexOf("[ProfD]") == 0) {
_storageDir = new FileUtils.File(profileDir.path);
@@ -162,7 +167,7 @@
}
// If no window specified, use the most recent
- if (!Services) Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
+ if (!Services) Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
let win = window || Services.wm.getMostRecentWindow("mail:3pane");
@@ -196,7 +201,7 @@
pub.width = parseInt(fileScriptableIO.read(4));
pub.height = parseInt(fileScriptableIO.read(4));
pub.modificationDate = fileScriptableIO.read(32);
-// console.log("pub", pub);
+ // console.log("pub", pub);
// Changed because of this:
// Just one comment - seems like xnote doesnt allow non-latin characters.
// I am from Latvia (Letonnie in French I believe) and we have characters
@@ -218,40 +223,43 @@
/**
* Save the note in localstorage with the name of the message-id.
*/
- pub.saveNoteToLocalStorage = function (hdrMsgId,note) {
- // console.log("hdrID", hdrMsgId, "note", note);
+ pub.saveNoteToLocalStorage = function (hdrMsgId, note, sync = true) {
+ // console.log("hdrID", hdrMsgId, "note", note);
let info = {};
info.command = "saveXNote";
info.hdrMsgId = hdrMsgId;
- info.XNote = note;
+ info.XNote = note;
+ info.sync = sync;
xnote.notifyTools.notifyBackground(info);
-
- }
- /**
- * Delete the note in localstorage with the name of the message-id.
- */
- pub.deleteNoteInLocalStorage = function (noteHdr) {
- let info = {};
- info.command = "deleteXNote";
- info.hdrMsgId = noteHdr;
- xnote.notifyTools.notifyBackground(info);
- }
+ }
+
+ /**
+ * Delete the note in localstorage with the name of the message-id.
+ */
+ pub.deleteNoteInLocalStorage = function (noteHdr, sync = true) {
+ let info = {};
+ info.command = "deleteXNote";
+ info.hdrMsgId = noteHdr;
+ info.sync = sync;
+ xnote.notifyTools.notifyBackground(info);
+ }
/**
* Save the note in a file with the name of the message-id. If the content
* of an existing note is empty, e.g., text was deleted, the note will be
* deleted.
+ * If sync is true: do not send back to sync addon to avoid loops
*/
- pub.saveNote = function () {
+ pub.saveNote = function (sync = true) {
//~ dump('\n->saveNote');
if (pub.text == '') {
if (_notesFile.exists()) {
_notesFile.remove(false);
- pub.deleteNoteInLocalStorage(pub.messageId);
+ pub.deleteNoteInLocalStorage(pub.messageId, sync);
}
return false;
}
@@ -282,22 +290,29 @@
fileOutStream.close();
tempFile.moveTo(null, _notesFile.leafName);
- let tmpNote = {text: pub.text, x: pub.x, y: pub.y, width: pub.width, height: pub.height, modificationDate: pub.modificationDate};
- pub.saveNoteToLocalStorage(pub.messageId, tmpNote);
+ let tmpNote = { text: pub.text, x: pub.x, y: pub.y, width: pub.width, height: pub.height, modificationDate: pub.modificationDate };
+ pub.saveNoteToLocalStorage(pub.messageId, tmpNote, sync);
pub.modified = false;
//~ dump('\n<-saveNote');
+
+ //refresh column
+ Services.obs.notifyObservers(null, "custom-column-refreshed", "XNote");
return true;
}
/**
* Deletes the note on the disk drive.
*/
- pub.deleteNote = function () {
+ pub.deleteNote = function (sync = true) {
//~ dump('\n->note_supprimer');
if (_notesFile.exists()) {
_notesFile.remove(false);
- pub.deleteNoteInLocalStorage(pub.messageId);
+ pub.deleteNoteInLocalStorage(pub.messageId, sync);
//~ dump('\n->note_supprimer');
+
+ //refresh column
+ Services.obs.notifyObservers(null, "custom-column-refreshed", "XNote");
+
return true;
}
else {
diff -Nru xnote-4.1.12/chrome/modules/xnote.sys.mjs xnote-4.5.48/chrome/modules/xnote.sys.mjs
--- xnote-4.1.12/chrome/modules/xnote.sys.mjs 1970-01-01 01:00:00.000000000 +0100
+++ xnote-4.5.48/chrome/modules/xnote.sys.mjs 2025-03-11 10:54:58.000000000 +0100
@@ -0,0 +1,343 @@
+//See https://developer.mozilla.org/en/Using_JavaScript_code_modules for explanation
+
+'use strict';
+
+//var EXPORTED_SYMBOLS = ["xnote"];
+//var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+//var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
+
+
+//Services.scriptloader.loadSubScript("chrome://xnote/content/scripts/notifyTools.js", pub, "UTF-8");
+
+export var xnote = {
+ ns: {}
+};
+
+export var xnoteloc = xnote;
+
+Services.scriptloader.loadSubScript("chrome://xnote/content/scripts/notifyTools.js", xnote, "UTF-8");
+
+
+xnote.ns.Commons = //ChromeUtils.import("resource://xnote/modules/commons.jsm").Commons;
+//var { ExtensionSupport } =
+ChromeUtils.import ? ChromeUtils.import("resource://xnote/modules/commons.jsm").Commons
+: ChromeUtils.importESModule(
+ "resource://xnote/modules/commons.sys.mjs").Commons;
+
+xnote.ns.DateFormat = //ChromeUtils.import("resource://xnote/modules/dateformat.jsm").DateFormat;
+//var { ExtensionSupport } =
+ChromeUtils.import ? ChromeUtils.import("resource://xnote/modules/dateformat.jsm").DateFormat
+: ChromeUtils.importESModule(
+ "resource://xnote/modules/dateformat.sys.mjs").DateFormat;
+
+
+xnote.ns.Storage = function () {
+ /**
+ * Path to storage directory of the notes.
+ */
+ var _storageDir;
+
+ //result
+ var pub = {
+ updateStoragePath: function () {
+ let directoryService = Components.classes['@mozilla.org/file/directory_service;1']
+ .getService(Components.interfaces.nsIProperties);
+ let profileDir = directoryService.get('ProfD', Components.interfaces.nsIFile);
+ let defaultDir = profileDir.clone();
+ let xnotePrefs = xnote.ns.Commons.xnotePrefs;
+ defaultDir.append('XNote');
+ if (!xnotePrefs || !xnotePrefs.storage_path) {
+ _storageDir = defaultDir;
+ }
+ else try {
+ let storagePath = xnotePrefs.storage_path;
+ // let FileUtils = ChromeUtils.importESModule("resource://gre/modules/FileUtils.sys.mjs").FileUtils;
+ let { FileUtils } = ChromeUtils.import ? ChromeUtils.import("resource://gre/modules/FileUtils.jsm")
+ : ChromeUtils.importESModule("resource://gre/modules/FileUtils.sys.mjs");
+ if (storagePath != "") {
+ if (storagePath.indexOf("[ProfD]") == 0) {
+ _storageDir = new FileUtils.File(profileDir.path);
+ _storageDir.appendRelativePath(storagePath.substring(7));
+ }
+ else {
+ _storageDir = new FileUtils.File(storagePath);
+ }
+ }
+ else {
+ _storageDir = defaultDir;
+ }
+ }
+ catch (e) {
+ console.error("Could not get storage path:" + e + "\n" + "\n...applying default storage path." + e.stack);
+ _storageDir = defaultDir;
+ }
+ // console.debug("xnote: storageDir initialized to: "+_storageDir.path);
+ },
+
+ /**
+ * Returns the directory that stores the notes.
+ */
+ get noteStorageDir() {
+ return _storageDir;
+ }
+ }
+
+ /**
+ * Returns a handle to the notes file for the provided message ID. Note
+ * that a physical file might not exist on the file system, if the message
+ * has no note.
+ */
+ pub.getNotesFile = function (messageId) {
+ //~ dump('\n'+pub.getNoteStorageDir().path+'\n'+messageID);
+ let notesFile = _storageDir.clone();
+ notesFile.append(escape(messageId).replace(/\//g, "%2F") + '.xnote');
+ return notesFile;
+ //~ dump('\n'+pub.getNoteStorageDir()+messageID+'.xnote');
+ }
+
+ return pub;
+}();
+
+xnote.ns.Upgrades = function () {
+ // TODO in future version: This migration functionality should be removed
+ // after most of the users updated to at least version 2.2.11 so that preferences
+ // under "xnote." will no longer be touched afterwards and the migration
+ // to the extension.xnote namespace is completed.
+ function migratePrefsToExtensionsNs() {
+ const nsIPrefServiceObj = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
+ const oldNsIPrefBranchObj = nsIPrefServiceObj.getBranch("xnote.");
+ const xnoteLegacyPrefs = xnote.ns.Commons.xnoteLegacyPrefs;
+ const boolPrefs = ['show_on_select', 'usetag'];
+ const intPrefs = ['width', 'height', 'show_first_x_chars_in_col'];
+ const charPrefs = ['dateformat', 'storage_path'];
+
+ boolPrefs.forEach(function (prefName) {
+ if (oldNsIPrefBranchObj.prefHasUserValue(prefName)) {
+ //~ dump ("Migrating preference: '"+prefName+"'\n");
+ xnoteLegacyPrefs.setBoolPref(prefName, oldNsIPrefBranchObj.getBoolPref(prefName));
+ oldNsIPrefBranchObj.clearUserPref(prefName);
+ }
+ });
+
+ intPrefs.forEach(function (prefName) {
+ if (oldNsIPrefBranchObj.prefHasUserValue(prefName)) {
+ //~ dump ("Migrating preference: '"+prefName+"'\n");
+ xnoteLegacyPrefs.setIntPref(prefName, oldNsIPrefBranchObj.getIntPref(prefName));
+ oldNsIPrefBranchObj.clearUserPref(prefName);
+ }
+ });
+
+ charPrefs.forEach(function (prefName) {
+ if (oldNsIPrefBranchObj.prefHasUserValue(prefName)) {
+ //~ dump ("Migrating preference: '"+prefName+"'\n");
+ xnoteLegacyPrefs.setStringPref(prefName, oldNsIPrefBranchObj.getStringPref(prefName)); //setCharPref
+ oldNsIPrefBranchObj.clearUserPref(prefName);
+ }
+ });
+ oldNsIPrefBranchObj.clearUserPref('version');
+ }
+
+ var pub = {
+
+ checkUpgrades: function (storedVersion, currentVersion) {
+ let versionComparator = Components.classes["@mozilla.org/xpcom/version-comparator;1"]
+ .getService(Components.interfaces.nsIVersionComparator);
+ if (storedVersion == null || versionComparator.compare(storedVersion, "2.2.11") < 0) {
+ migratePrefsToExtensionsNs();
+ }
+ xnote.ns.Commons.xnoteLegacyPrefs.setStringPref('version', xnote.ns.Commons.XNOTE_VERSION); //setCharPref
+ }
+
+ };
+
+ return pub;
+}();
+
+xnote.ns.Note = function (messageId, window) {
+ //~ dump('\n->Note');
+
+ // --- internal variables ------------------------------------------
+ var _notesFile = xnote?.ns.Storage.getNotesFile(messageId);
+ var _modified = false;
+ var _messageId = messageId;
+
+ //result
+ var pub = {
+ //--- properties ----------------------------------------------------
+ get modified() {
+ return _modified;
+ },
+ set modified(value) {
+ _modified = value;
+ },
+ get messageId() {
+ return _messageId;
+ }
+
+ }
+
+ // If no window specified, use the most recent
+ // if (!Services) Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
+
+ let win = window || Services.wm.getMostRecentWindow("mail:3pane");
+
+ // Default values for a note window
+ pub.DEFAULT_XNOTE_WIDTH = xnote.ns.Commons.xnotePrefs.width;
+ pub.DEFAULT_XNOTE_HEIGHT = xnote.ns.Commons.xnotePrefs.height;
+ pub.DEFAULT_X_ORIG = (win.outerWidth - pub.DEFAULT_XNOTE_WIDTH) / 2;
+ pub.DEFAULT_Y_ORIG = (win.outerHeight - pub.DEFAULT_XNOTE_HEIGHT) / 2;
+ pub.DEFAULT_X = xnote.ns.Commons.xnotePrefs.horPos;
+ pub.DEFAULT_Y = xnote.ns.Commons.xnotePrefs.vertPos;
+
+ //--- Intialisation (either from file or defaults) --------------------------
+
+ //~ dump('\n<-Note');
+ if (!_notesFile || !_notesFile.exists()) {
+ pub.x = pub.DEFAULT_X;
+ pub.y = pub.DEFAULT_Y;
+ pub.width = pub.DEFAULT_XNOTE_WIDTH;
+ pub.height = pub.DEFAULT_XNOTE_HEIGHT;
+ pub.text = '';
+ pub.modificationDate = '';
+ //~ dump('\n<-note_charger');
+ }
+ else {
+ var fileInStream = Components.classes['@mozilla.org/network/file-input-stream;1'].createInstance(Components.interfaces.nsIFileInputStream);
+ var fileScriptableIO = Components.classes['@mozilla.org/scriptableinputstream;1'].createInstance(Components.interfaces.nsIScriptableInputStream);
+ fileInStream.init(_notesFile, 0x01, parseInt("0444", 8), null);
+ fileScriptableIO.init(fileInStream);
+ pub.x = parseInt(fileScriptableIO.read(4));
+ pub.y = parseInt(fileScriptableIO.read(4));
+ pub.width = parseInt(fileScriptableIO.read(4));
+ pub.height = parseInt(fileScriptableIO.read(4));
+ pub.modificationDate = fileScriptableIO.read(32);
+ // console.log("pub", pub);
+ // Changed because of this:
+ // Just one comment - seems like xnote doesnt allow non-latin characters.
+ // I am from Latvia (Letonnie in French I believe) and we have characters
+ // like al?ki which are not preserved when saving a note ...
+ //
+ // this.text = fileScriptableIO.read(_notesFile.fileSize-16);
+ pub.text = decodeURIComponent(
+ fileScriptableIO.read(_notesFile.fileSize - 48));
+
+ fileScriptableIO.close();
+ fileInStream.close();
+ pub.text = pub.text.replace(/<BR>/g, '\n');
+ //~ dump('\n<-note_charger');
+ }
+
+ //--- METHOD DEFINITIONS -------------------------------------------------
+
+
+ /**
+ * Save the note in localstorage with the name of the message-id.
+ */
+ pub.saveNoteToLocalStorage = function (hdrMsgId, note, sync = true) {
+ // console.log("hdrID", hdrMsgId, "note", note);
+ let info = {};
+ info.command = "saveXNote";
+ info.hdrMsgId = hdrMsgId;
+ info.XNote = note;
+ info.sync = sync;
+ xnote.notifyTools.notifyBackground(info);
+
+
+
+ }
+
+ /**
+ * Delete the note in localstorage with the name of the message-id.
+ */
+ pub.deleteNoteInLocalStorage = function (noteHdr, sync = true) {
+ let info = {};
+ info.command = "deleteXNote";
+ info.hdrMsgId = noteHdr;
+ info.sync = sync;
+ xnote.notifyTools.notifyBackground(info);
+ }
+
+ /**
+ * Save the note in a file with the name of the message-id. If the content
+ * of an existing note is empty, e.g., text was deleted, the note will be
+ * deleted.
+ * If sync is true: do not send back to sync addon to avoid loops
+ */
+ pub.saveNote = function (sync = true) {
+ //~ dump('\n->saveNote');
+
+ if (pub.text == '') {
+ if (_notesFile.exists()) {
+ _notesFile.remove(false);
+ pub.deleteNoteInLocalStorage(pub.messageId, sync);
+ }
+ return false;
+ }
+ pub.text = pub.text.replace(/\n/g, '<BR>');
+
+ let tempFile = _notesFile.parent.clone();
+ tempFile.append("~" + _notesFile.leafName + ".tmp");
+ // Using 0660 instead of 0600 so that sharing notes accross users
+ // within the same group is possible on Linux.
+ tempFile.createUnique(tempFile.NORMAL_FILE_TYPE, parseInt("0660", 8));
+
+ let fileOutStream = Components.classes['@mozilla.org/network/file-output-stream;1'].createInstance(Components.interfaces.nsIFileOutputStream);
+ fileOutStream.init(tempFile, 2, 0x200, false); // Opens for writing only
+ fileOutStream.write(String(pub.x), 4);
+ fileOutStream.write(String(pub.y), 4);
+ fileOutStream.write(String(pub.width), 4);
+ fileOutStream.write(String(pub.height), 4);
+ fileOutStream.write(pub.modificationDate, 32);
+
+ // Changed because of this:
+ // Just one comment - seems like xnote doesnt allow non-latin characters.
+ // I am from Latvia (Letonnie in French I believe) and we have characters
+ // like al?ki which are not preserved when saving a note ...
+ //
+ // fileOutStream.write(pub.text, pub.text.length);
+ let contentencode = encodeURIComponent(pub.text);
+ fileOutStream.write(contentencode, contentencode.length);
+
+ fileOutStream.close();
+ tempFile.moveTo(null, _notesFile.leafName);
+ let tmpNote = { text: pub.text, x: pub.x, y: pub.y, width: pub.width, height: pub.height, modificationDate: pub.modificationDate };
+ pub.saveNoteToLocalStorage(pub.messageId, tmpNote, sync);
+ pub.modified = false;
+ //~ dump('\n<-saveNote');
+
+ //refresh column
+ Services.obs.notifyObservers(null, "custom-column-refreshed", "XNote");
+ return true;
+ }
+
+ /**
+ * Deletes the note on the disk drive.
+ */
+ pub.deleteNote = function (sync = true) {
+ //~ dump('\n->note_supprimer');
+ if (_notesFile.exists()) {
+ _notesFile.remove(false);
+ pub.deleteNoteInLocalStorage(pub.messageId, sync);
+ //~ dump('\n->note_supprimer');
+
+ //refresh column
+ Services.obs.notifyObservers(null, "custom-column-refreshed", "XNote");
+
+ return true;
+ }
+ else {
+ //~ dump('\n->note_supprimer');
+ return false;
+ }
+ }
+
+ pub.toString = function () {
+ return ('\n' + this.x + ' ; ' + this.y + ' ; ' + this.width + ' ; ' + this.height + ' ; ' + this.text + ' ; ')
+ }
+
+ pub.exists = function () {
+ return _notesFile.exists();
+ }
+
+ return pub;
+}
Bin?rdateien /tmp/3NXSSb5S08/xnote-4.1.12/chrome/skin/iconmonstr-clipboard-13-16.png und /tmp/rnSjd66O2p/xnote-4.5.48/chrome/skin/iconmonstr-clipboard-13-16.png sind verschieden.
diff -Nru xnote-4.1.12/chrome/skin/xnote-window.css xnote-4.5.48/chrome/skin/xnote-window.css
--- xnote-4.1.12/chrome/skin/xnote-window.css 2023-11-01 20:44:36.000000000 +0100
+++ xnote-4.5.48/chrome/skin/xnote-window.css 2025-02-13 19:45:06.000000000 +0100
@@ -6,6 +6,7 @@
background-position:right bottom;
background-color: #FBFEBF;
border: solid 2px #FAF098;
+ /*height: 75vh;*/
/* -moz-opacity: 0.8; */
/* z-index: 10; */
/* visibility: hidden; */
@@ -48,7 +49,7 @@
#xnote-button-copy {
cursor: pointer;
- list-style-image : url(iconmonstr-clipboard-13-16.png);
+/* list-style-image : url(iconmonstr-clipboard-13-16.png);*/
}
#xnote-bouton-palette {
@@ -154,3 +155,26 @@
/* visibility: hidden; */
/* background-color: transparent; */
}
+
+
+textarea#xnote-texte {
+ width:97vw;
+ box-sizing:border-box;
+ display:block;
+ max-width:100%;
+ height: 80vh; /*80vh; calc(100%-28px)*/
+ line-height:1.5;
+ padding:15px 15px 30px;
+ border-radius:3px;
+ border:1px solid #F7E98D;
+ font:13px Tahoma, cursive;
+ transition:box-shadow 0.5s ease;
+ box-shadow:0 4px 6px rgba(0,0,0,0.1);
+ background-color: #FBFEBF;
+ font-smoothing:subpixel-antialiased;
+ background:linear-gradient(#F9EFAF, #F7E98D);
+ background:-o-linear-gradient(#F9EFAF, #F7E98D);
+ background:-ms-linear-gradient(#F9EFAF, #F7E98D);
+ background:-moz-linear-gradient(#F9EFAF, #F7E98D);
+ background:-webkit-linear-gradient(#F9EFAF, #F7E98D);
+}
diff -Nru xnote-4.1.12/debian/changelog xnote-4.5.48/debian/changelog
--- xnote-4.1.12/debian/changelog 2024-05-15 18:42:07.000000000 +0200
+++ xnote-4.5.48/debian/changelog 2025-09-25 10:09:05.000000000 +0200
@@ -1,3 +1,29 @@
+xnote (4.5.48-1~deb13u1) trixie; urgency=medium
+
+ * Rebuild for upload after thunderbird 140.3 in trixie
+
+ -- Mechtilde Stehmann <mechtilde at debian.org> Thu, 25 Sep 2025 10:09:05 +0200
+
+xnote (4.5.48-1) unstable; urgency=medium
+
+ * Rebuild for unstable to use with thunderbird >= 140.3
+
+ -- Mechtilde Stehmann <mechtilde at debian.org> Sun, 21 Sep 2025 16:21:05 +0200
+
+xnote (4.5.48-1~exp1) experimental; urgency=medium
+
+ [ Mechtilde ]
+ * [d1d074c] Update d/u/metadata to reference to Mozilla repo
+ * [6e8c3b7] Fixed d/watch
+ * [4582229] New upstream version 4.5.48
+ * [0d7f790] Fixed d/u/upstream
+ * [5b9c461] Added d/dpb.conf - using with debian-packaging-scripts
+ * [75efba8] Bumped year in d/copyright
+ * [c7fae71] Bumped standard version - no changes needed
+ + Bumped version of dependency
+
+ -- Mechtilde Stehmann <mechtilde at debian.org> Sat, 23 Aug 2025 16:05:56 +0200
+
xnote (4.1.12-1) unstable; urgency=medium
[ Mechtilde ]
diff -Nru xnote-4.1.12/debian/control xnote-4.5.48/debian/control
--- xnote-4.1.12/debian/control 2024-05-15 18:33:12.000000000 +0200
+++ xnote-4.5.48/debian/control 2025-08-23 16:00:09.000000000 +0200
@@ -5,7 +5,7 @@
Uploaders: Mechtilde Stehmann <mechtilde at debian.org>
Build-Depends: debhelper-compat (=13)
, zip
-Standards-Version: 4.7.0
+Standards-Version: 4.7.2
Rules-Requires-Root: no
Vcs-Git: https://salsa.debian.org/webext-team/xnote.git
Vcs-Browser: https://salsa.debian.org/webext-team/xnote
@@ -14,7 +14,8 @@
Package: webext-xnotepp
Architecture: all
Depends: ${misc:Depends}
- , thunderbird (>= 1:115.10)
+ , thunderbird (>= 1:140.1)
+ , thunderbird (<= 1:141.x)
Description: Persistent sticky notes for Thunderbird
You can define the note position in the settings. If you have a
large screen, you can even display the notes outside of TB's main window,
diff -Nru xnote-4.1.12/debian/copyright xnote-4.5.48/debian/copyright
--- xnote-4.1.12/debian/copyright 2024-05-15 18:38:18.000000000 +0200
+++ xnote-4.5.48/debian/copyright 2025-08-23 15:40:37.000000000 +0200
@@ -24,7 +24,7 @@
License: MIT
Files: debian/*
-Copyright: 2021-2024 Mechtilde Stehmann <mechtilde at debian.org>
+Copyright: 2021-2025 Mechtilde Stehmann <mechtilde at debian.org>
License: LGPL-2.1
License: LGPL-2.1
diff -Nru xnote-4.1.12/debian/dpb.conf xnote-4.5.48/debian/dpb.conf
--- xnote-4.1.12/debian/dpb.conf 1970-01-01 01:00:00.000000000 +0100
+++ xnote-4.5.48/debian/dpb.conf 2025-09-25 09:56:32.000000000 +0200
@@ -0,0 +1,18 @@
+#!/bin/bash
+# debian/dpb.conf
+# ConfigFile for XNotePP
+# This file is used by the scripts from
+# debian-package-scripts
+## General parameters
+SourceName=xnote
+PackName=webext-xnotepp
+SalsaName=webext-team/xnote
+RecentBranch=debian/trixie
+RecentUpstreamSuffix=xpi
+## Parameters for Java packages
+JavaFlag=0
+## Parameters for Webext packages
+WebextFlag=1
+## Parameters for Python3 packages
+PythonFlag=0
+RecentBranchD=unstable
diff -Nru xnote-4.1.12/debian/gbp.conf xnote-4.5.48/debian/gbp.conf
--- xnote-4.1.12/debian/gbp.conf 1970-01-01 01:00:00.000000000 +0100
+++ xnote-4.5.48/debian/gbp.conf 2025-09-25 09:56:32.000000000 +0200
@@ -0,0 +1,21 @@
+# Configuration file for git-buildpackage and friends
+
+[DEFAULT]
+# use pristine-tar:
+pristine-tar = True
+# generate gz compressed orig file
+compression = gz
+debian-branch = debian/trixie
+upstream-branch = upstream
+
+[pq]
+patch-numbers = False
+
+[dch]
+id-length = 7
+
+[import-orig]
+# filter out unwanted files/dirs from upstream
+filter = [ '.cvsignore', '.gitignore', '.github', '.hgtags', '.hgignore', '*.orig', '*.rej' ]
+# filter the files out of the tarball passed to pristine-tar
+filter-pristine-tar = True
diff -Nru xnote-4.1.12/debian/upstream/metadata xnote-4.5.48/debian/upstream/metadata
--- xnote-4.1.12/debian/upstream/metadata 2023-09-03 11:17:55.000000000 +0200
+++ xnote-4.5.48/debian/upstream/metadata 2025-08-23 15:36:08.000000000 +0200
@@ -6,3 +6,4 @@
Documentation: https://github.com/xnotepp/xnote/wiki
Repository: https://github.com/xnotepp/xnote.git
Repository-Browse: https://github.com/xnotepp/xnote
+Reference: https://addons.thunderbird.net/en-US/thunderbird/addon/xnotepp/versions/
diff -Nru xnote-4.1.12/debian/watch xnote-4.5.48/debian/watch
--- xnote-4.1.12/debian/watch 2023-09-03 11:17:55.000000000 +0200
+++ xnote-4.5.48/debian/watch 2025-08-23 15:04:48.000000000 +0200
@@ -3,4 +3,4 @@
repack,compression=xz,\
uversionmangle=s/-?([^\d.]+)/~$1/;tr/A-Z/a-z/,\
filenamemangle=s/.+\/v?(\d\S+)\.*/$1/,
-https://addons.thunderbird.net/en-US/thunderbird/addon/xnotepp/versions/ (\d.\d.\d)
+https://addons.thunderbird.net/en-US/thunderbird/addon/xnotepp/versions/ (\d[\d\.]+)*
diff -Nru xnote-4.1.12/experiment-apis/customColumn/implementation.js xnote-4.5.48/experiment-apis/customColumn/implementation.js
--- xnote-4.1.12/experiment-apis/customColumn/implementation.js 1970-01-01 01:00:00.000000000 +0100
+++ xnote-4.5.48/experiment-apis/customColumn/implementation.js 2025-03-11 10:20:32.000000000 +0100
@@ -0,0 +1,98 @@
+var { ExtensionCommon } = ChromeUtils.import ? ChromeUtils.import("resource://gre/modules/ExtensionCommon.jsm")
+: ChromeUtils.importESModule(
+ "resource://gre/modules/ExtensionCommon.sys.mjs"
+);
+var { ExtensionSupport } = ChromeUtils.import ? ChromeUtils.import("resource:///modules/ExtensionSupport.jsm")
+: ChromeUtils.importESModule(
+ "resource:///modules/ExtensionSupport.sys.mjs"
+);
+
+var ThreadPaneColumns;
+try {
+ ({ ThreadPaneColumns } = ChromeUtils.importESModule("chrome://messenger/content/thread-pane-columns.mjs"));
+}
+catch (err) {
+ ({ ThreadPaneColumns } = ChromeUtils.importESModule("chrome://messenger/content/ThreadPaneColumns.mjs"));
+}
+
+
+var customColumnIds = [];
+var test = {};
+
+var customColumn = class extends ExtensionCommon.ExtensionAPI {
+ getAPI(context) {
+ context.callOnClose(this);
+ return {
+ customColumn: {
+ async refreshColumn(id) {
+ ThreadPaneColumns.refreshCustomColumn(id);
+ },
+
+ async add(id) {
+ var { xnote } = ChromeUtils.import ? ChromeUtils.import("resource://xnote/modules/xnote.jsm")
+ : ChromeUtils.importESModule("resource://xnote/modules/xnote.sys.mjs");
+ let customColumn = ThreadPaneColumns.getCustomColumns().find(
+ c => c.id == id
+ );
+ if (!customColumn) {
+ customColumnIds.push(id);
+
+ function getXNote(message) {
+ let xnotePrefs = xnote.ns.Commons.xnotePrefs;
+ let ic = '\u{1F4D2}';
+ let note = new xnote.ns.Note(message.messageId);
+ if (note.exists()) {
+ if (xnotePrefs.show_first_x_chars_in_col > 0) {
+
+ return ic + " " + note.text.substr(0, xnotePrefs.show_first_x_chars_in_col);//ic + " " +
+ } else {
+ return ic;
+ }
+ }
+ else {
+ return "";
+ }
+ }
+
+ if (typeof ThreadPaneColumns !== "undefined") {
+ ThreadPaneColumns.addCustomColumn(id, {
+ name: '\u{1F4D2}' + "XNote",
+ hidden: false,
+ // iconCallback: getImageSrc,
+ icon: false,
+ // iconHeaderUrl: "resource://xnote/skin/xnote_context.png",
+ resizable: true,
+ sortable: true,
+ textCallback: getXNote,
+ });
+ } else {
+ console.error("ThreadPaneColumns is not defined.");
+ };
+ };
+ },
+
+ async remove(id) {
+ const customColumn = ThreadPaneColumns.getCustomColumns().find(
+ c => c.id == id
+ );
+ if (customColumn) {
+ if (typeof ThreadPaneColumns !== "undefined") {
+ ThreadPaneColumns.removeCustomColumn(id);
+ }
+ customColumnIds = customColumnIds.filter(e => e !== id);
+ };
+ },
+ },
+ };
+ }
+
+ close() {
+ for (const id of customColumnIds) {
+ try {
+ ThreadPaneColumns.removeCustomColumn(id);
+ } catch (e) {
+ console.error(e);
+ }
+ }
+ }
+};
diff -Nru xnote-4.1.12/experiment-apis/customColumn/schema.json xnote-4.5.48/experiment-apis/customColumn/schema.json
--- xnote-4.1.12/experiment-apis/customColumn/schema.json 1970-01-01 01:00:00.000000000 +0100
+++ xnote-4.5.48/experiment-apis/customColumn/schema.json 2025-01-04 00:14:32.000000000 +0100
@@ -0,0 +1,39 @@
+[
+ {
+ "namespace": "customColumn",
+ "functions": [
+ {
+ "name": "add",
+ "type": "function",
+ "async": true,
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id"
+ } ]
+ },
+ {
+ "name": "remove",
+ "type": "function",
+ "async": true,
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id"
+ }
+ ]
+ },
+ {
+ "name": "refreshColumn",
+ "type": "function",
+ "async": true,
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id"
+ }
+ ]
+ }
+ ]
+ }
+]
diff -Nru xnote-4.1.12/experiment-apis/files/files-api.js xnote-4.5.48/experiment-apis/files/files-api.js
--- xnote-4.1.12/experiment-apis/files/files-api.js 2023-09-22 22:00:30.000000000 +0200
+++ xnote-4.5.48/experiment-apis/files/files-api.js 2025-03-11 10:27:56.000000000 +0100
@@ -1,4 +1,7 @@
-var { ExtensionCommon } = ChromeUtils.import("resource://gre/modules/ExtensionCommon.jsm");//,
+var { ExtensionCommon } = ChromeUtils.import ? ChromeUtils.import("resource://gre/modules/ExtensionCommon.jsm")
+: ChromeUtils.importESModule(
+ "resource://gre/modules/ExtensionCommon.sys.mjs"
+);
// { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"),
var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
win = Services.wm.getMostRecentWindow("mail:3pane");
@@ -12,13 +15,15 @@
selectDirectory: async function (window, startDirectory, title) {
let domWindow = window;
if (domWindow == null) {
- domWindow = Services.wm.getMostRecentWindow(null);
+ domWindow = Services.wm.getMostRecentWindow("mail:3pane");
}
let fp = Components.classes["@mozilla.org/filepicker;1"]
.createInstance(Components.interfaces.nsIFilePicker);
- fp.init(domWindow, title, fp.modeGetFolder);
- let FileUtils = ChromeUtils.import("resource://gre/modules/FileUtils.jsm").FileUtils;
- let startDir = new FileUtils.File(startDirectory);
+ fp.init(domWindow.browsingContext, title, fp.modeGetFolder);
+// let FileUtils = ChromeUtils.import("resource://gre/modules/FileUtils.jsm").FileUtils;
+ let { FileUtils } = ChromeUtils.import ? ChromeUtils.import("resource://gre/modules/FileUtils.jsm")
+ : ChromeUtils.importESModule("resource://gre/modules/FileUtils.sys.mjs");
+ let startDir = new FileUtils.File(startDirectory);
fp.displayDirectory = startDir;
return new Promise(function (resolve, reject) {
fp.open(rv => {
@@ -38,7 +43,8 @@
},
appendRelativePath: async function (path, extension) {
- let FileUtils = ChromeUtils.import("resource://gre/modules/FileUtils.jsm").FileUtils;
+ let { FileUtils } = ChromeUtils.import ? ChromeUtils.import("resource://gre/modules/FileUtils.jsm")
+ : ChromeUtils.importESModule("resource://gre/modules/FileUtils.sys.mjs");
var result = new FileUtils.File(path);
result.appendRelativePath(extension);
// console.debug(result);
diff -Nru xnote-4.1.12/experiment-apis/LegacyPrefs/legacyprefs.js xnote-4.5.48/experiment-apis/LegacyPrefs/legacyprefs.js
--- xnote-4.1.12/experiment-apis/LegacyPrefs/legacyprefs.js 2023-10-01 20:59:06.000000000 +0200
+++ xnote-4.5.48/experiment-apis/LegacyPrefs/legacyprefs.js 2025-03-11 10:28:10.000000000 +0100
@@ -1,8 +1,11 @@
/* eslint-disable object-shorthand */
-var { ExtensionCommon } = ChromeUtils.import("resource://gre/modules/ExtensionCommon.jsm");
+var { ExtensionCommon } = ChromeUtils.import ? ChromeUtils.import("resource://gre/modules/ExtensionCommon.jsm")
+: ChromeUtils.importESModule(
+ "resource://gre/modules/ExtensionCommon.sys.mjs"
+);
//var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
+//var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
var LegacyPrefs = class extends ExtensionCommon.ExtensionAPI {
getAPI(context) {
diff -Nru xnote-4.1.12/experiment-apis/NotifyTools/implementation.js xnote-4.5.48/experiment-apis/NotifyTools/implementation.js
--- xnote-4.1.12/experiment-apis/NotifyTools/implementation.js 2023-09-22 22:00:30.000000000 +0200
+++ xnote-4.5.48/experiment-apis/NotifyTools/implementation.js 2025-03-11 10:28:26.000000000 +0100
@@ -15,10 +15,16 @@
*/
// Get various parts of the WebExtension framework that we need.
-var { ExtensionCommon } = ChromeUtils.import("resource://gre/modules/ExtensionCommon.jsm");
-var { ExtensionSupport } = ChromeUtils.import("resource:///modules/ExtensionSupport.jsm");
+var { ExtensionCommon } = ChromeUtils.import ? ChromeUtils.import("resource://gre/modules/ExtensionCommon.jsm")
+: ChromeUtils.importESModule(
+ "resource://gre/modules/ExtensionCommon.sys.mjs"
+);
+var { ExtensionSupport } = ChromeUtils.import ? ChromeUtils.import("resource:///modules/ExtensionSupport.jsm")
+: ChromeUtils.importESModule(
+ "resource:///modules/ExtensionSupport.sys.mjs"
+);
//var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
+//var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
var NotifyTools = class extends ExtensionCommon.ExtensionAPI {
getAPI(context) {
diff -Nru xnote-4.1.12/experiment-apis/WindowListener/implementation.js xnote-4.5.48/experiment-apis/WindowListener/implementation.js
--- xnote-4.1.12/experiment-apis/WindowListener/implementation.js 2023-11-01 22:24:38.000000000 +0100
+++ xnote-4.5.48/experiment-apis/WindowListener/implementation.js 2025-03-11 10:20:08.000000000 +0100
@@ -2,9 +2,9 @@
* This file is provided by the addon-developer-support repository at
* https://github.com/thundernest/addon-developer-support
*
- * Version 1.62
+ * Version 1.62a
*
- * Author: John Bieling (john at thunderbird.net)
+ * Author: John Bieling (john at thunderbird.net), some fixes by opto/Klaus Buecher
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -12,14 +12,16 @@
*/
// Import some things we need.
-var { ExtensionCommon } = ChromeUtils.import(
- "resource://gre/modules/ExtensionCommon.jsm"
+var { ExtensionCommon } = ChromeUtils.import ? ChromeUtils.import("resource://gre/modules/ExtensionCommon.jsm")
+: ChromeUtils.importESModule(
+ "resource://gre/modules/ExtensionCommon.sys.mjs"
);
-var { ExtensionSupport } = ChromeUtils.import(
- "resource:///modules/ExtensionSupport.jsm"
+var { ExtensionSupport } = ChromeUtils.import ? ChromeUtils.import("resource:///modules/ExtensionSupport.jsm")
+: ChromeUtils.importESModule(
+ "resource:///modules/ExtensionSupport.sys.mjs"
);
-var Services = globalThis.Services ||
- ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
+//var Services = globalThis.Services || ChromeUtils.import(
+// "resource://gre/modules/Services.jsm").Services;
function getThunderbirdVersion() {
let parts = Services.appinfo.version.split(".");
@@ -280,11 +282,11 @@
for (let api of apis) {
switch (api) {
case "storage":
- XPCOMUtils.defineLazyGetter(messenger, "storage", () => getStorage());
+ ChromeUtils.defineLazyGetter(messenger, "storage", () => getStorage());
break;
default:
- XPCOMUtils.defineLazyGetter(messenger, api, () =>
+ ChromeUtils.defineLazyGetter(messenger, api, () =>
context.apiCan.findAPIPath(api)
);
}
@@ -430,7 +432,7 @@
Services.scriptloader.loadSubScript(url, prefsObj, "UTF-8");
},
- registerChromeUrl(data) {
+ async registerChromeUrl(data) {
let chromeData = [];
let resourceData = [];
for (let entry of data) {
@@ -462,7 +464,7 @@
uri,
resProto.ALLOW_CONTENT_ACCESS
);
- }
+ }
self.chromeData = chromeData;
self.resourceData = resourceData;
@@ -1322,11 +1324,11 @@
for (let api of apis) {
switch (api) {
case "storage":
- XPCOMUtils.defineLazyGetter(messenger, "storage", () => getStorage());
+ ChromeUtils.defineLazyGetter(messenger, "storage", () => getStorage());
break;
default:
- XPCOMUtils.defineLazyGetter(messenger, api, () =>
+ ChromeUtils.defineLazyGetter(messenger, api, () =>
context.apiCan.findAPIPath(api)
);
}
@@ -1478,8 +1480,8 @@
let url = context.extension.rootURI.resolve(defaultUrl);
let prefsObj = {};
- prefsObj.Services = globalThis.Services||
- ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
+ prefsObj.Services = Services;//globalThis.Services||
+ // ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
prefsObj.pref = function (aName, aDefault) {
let defaults = Services.prefs.getDefaultBranch("");
switch (typeof aDefault) {
@@ -1537,7 +1539,8 @@
uri,
resProto.ALLOW_CONTENT_ACCESS
);
- }
+ console.log("set resource url", uri);
+ }
self.chromeData = chromeData;
self.resourceData = resourceData;
diff -Nru xnote-4.1.12/experiment-apis/WindowListener/schema.json xnote-4.5.48/experiment-apis/WindowListener/schema.json
--- xnote-4.1.12/experiment-apis/WindowListener/schema.json 2023-09-22 22:00:30.000000000 +0200
+++ xnote-4.5.48/experiment-apis/WindowListener/schema.json 2024-10-07 15:09:24.000000000 +0200
@@ -32,6 +32,7 @@
{
"name": "data",
"type": "array",
+ "async": true,
"items": {
"type": "array",
"items": {
diff -Nru xnote-4.1.12/experiment-apis/xnote/xnote-experiments.js xnote-4.5.48/experiment-apis/xnote/xnote-experiments.js
--- xnote-4.1.12/experiment-apis/xnote/xnote-experiments.js 2024-01-09 21:06:10.000000000 +0100
+++ xnote-4.5.48/experiment-apis/xnote/xnote-experiments.js 2025-03-27 15:12:28.000000000 +0100
@@ -1,14 +1,76 @@
-var { ExtensionCommon } = ChromeUtils.import("resource://gre/modules/ExtensionCommon.jsm"),
- // { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"),
- { TagUtils } = ChromeUtils.import("resource:///modules/TagUtils.jsm");//,
-var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
+var { ExtensionCommon } = ChromeUtils.import ? ChromeUtils.import("resource://gre/modules/ExtensionCommon.jsm")
+: ChromeUtils.importESModule(
+ "resource://gre/modules/ExtensionCommon.sys.mjs"
+);
+var { TagUtils } = ChromeUtils.import ? ChromeUtils.import("resource:///modules/TagUtils.jsm")
+: ChromeUtils.importESModule("resource:///modules/TagUtils.sys.mjs");
+//var Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
var win = Services.wm.getMostRecentWindow("mail:3pane");
//var { FileUtils } = ChromeUtils.importESModule("resource://gre/modules/FileUtils.sys.mjs");
-var { FileUtils } = ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
+//var { FileUtils } = ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
+var { FileUtils } = ChromeUtils.import ? ChromeUtils.import("resource://gre/modules/FileUtils.jsm")
+: ChromeUtils.importESModule("resource://gre/modules/FileUtils.sys.mjs");
+
+
+async function wait(t) {
+ // let t = 5000;
+ await new Promise(resolve => win.setTimeout(resolve, t));
+ // console.log("waited in exp");
+}
+
+var resProto = Cc[
+ "@mozilla.org/network/protocol;1?name=resource"
+].getService(Ci.nsISubstitutingProtocolHandler);
+
+
+function waitForResourceUrl() {
+ let res = false;
+ let i = 0;
+
+ for (let i = 0; i < 5000; i++) {
+ //do {
+ try {
+ res = resProto.hasSubstitution("xnote");
+ }
+
+ catch (ev) { };
+ i++;
+ // console.log("res url exists", i, res);
+ if (res) break;
+ // await wait (100);
+ // } while (!res);
+ };
+};
+
+
+
+async function waitForResourceUrlA() {
+ let res = false;
+ let i = 0;
+
+ for (let i = 0; i < 5000; i++) {
+ //do {
+ try {
+ res = resProto.hasSubstitution("xnote");
+ }
+
+ catch (ev) { };
+ i++;
+ // console.log("res url exists", i, res);
+ if (res) break;
+ await wait(100);
+ // } while (!res);
+ };
+};
+
+
+//waitForResourceUrl();
+//var { xnote } = ChromeUtils.import("resource://xnote/modules/xnote.jsm");
+var xnote;
+
-var { xnote } = ChromeUtils.import("resource://xnote/modules/xnote.jsm");
const XNOTE_BASE_PREF_NAME = "extensions.xnote.";
@@ -76,7 +138,21 @@
getAPI(context) {
return {
xnoteapi: {
+
+
+ async loadXNoteJSM() {
+ // await waitForResourceUrlA();
+ let xnoteloc = ChromeUtils.import ? ChromeUtils.import("resource://xnote/modules/xnote.jsm")
+ : ChromeUtils.importESModule("resource://xnote/modules/xnote.sys.mjs");
+ await wait(2000);
+ // console.log("xnote", xnoteloc);
+ xnote = xnoteloc.xnote;
+
+ },
+
+
async init() {
+
xnote.ns.Commons.init();
// console.log("context", context );
xnote.ns.Commons.context = context;
@@ -112,7 +188,7 @@
"chrome,dialog=no,all,screenX=" + left + ",screenY=" + upper + ",height=200,width=200");
- console.log("xnotewnd-exp", window.xnoteOverlayObj.xnoteWindow, window);
+ // console.log("xnotewnd-exp", window.xnoteOverlayObj.xnoteWindow, window);
// debugger;
@@ -125,7 +201,7 @@
let msgHdr = context.extension.messageManager.get(messageId);
wnd.xnoteOverlayObj.closeNote();
wnd.xnoteOverlayObj.note = new xnote.ns.Note(msgHdr.messageId); // we could pass in the headerMessageId directly
- wnd.xnoteOverlayObj.msgHdr = msgHdr;
+ wnd.xnoteOverlayObj.msgHdr = msgHdr;
let note = wnd.xnoteOverlayObj.note;
// This uses a core function to update the currently selected message, bad, get rid of it
@@ -133,12 +209,13 @@
//now done in onload window.xnoteOverlayObj.updateTag(note.text);
let xnotePrefs = xnote.ns.Commons.xnotePrefs;
+ //console.log("open note", xnotePrefs.show_on_select, forceShowing, note.text != '', note.text);
if (
(xnotePrefs.show_on_select && note.text != '') ||
forceShowing
) {
- // console.log("shownote", note.text);
- wnd.xnoteOverlayObj.context_createNote(true);
+ // console.log("shownote", note.text);
+ wnd.xnoteOverlayObj.context_createNote(true,msgHdr.messageId); //parameter currently unused
/* */
/*
window.xnoteOverlayObj.xnoteWindow = window.openDialog(
@@ -212,6 +289,9 @@
window?.xnoteOverlayObj?.closeNote();
},
+ async isExperimentReady() {
+ return true;
+ },
async getAllXNoteKeys() {
@@ -222,53 +302,57 @@
// let fileDir = FileUtils.getFile("ProfD", ["XNote"]);
//_storageDir.clone();
//console.log("stordir", xnote.ns.Storage.noteStorageDir);
- let fileDir = xnote.ns.Storage.noteStorageDir;//Services.dirsvc.get(xnote.ns.Storage.noteStorageDir, Ci.nsIFile);
- let filename;
- // console.log("fi", fileDir, fileDir.directoryEntries);
- for (let dd of fileDir.directoryEntries) {
- // console.log("fn", dd.leafName);
- if (
- !dd.isFile() ||
- !dd.isReadable() ||
- !dd.leafName.endsWith(".xnote")
- ) {
- continue;
- };
- let jsNote = {};
-
-
-
-
+ try {
+ let fileDir = xnote.ns.Storage.noteStorageDir;//Services.dirsvc.get(xnote.ns.Storage.noteStorageDir, Ci.nsIFile);
+ let filename;
+// console.log("fi", fileDir, fileDir.directoryEntries, fileDir.directoryEntries.length);
+ for (let dd of fileDir.directoryEntries) {
+ // console.log("fn", dd.leafName);
+ if (
+ !dd.isFile() ||
+ !dd.isReadable() ||
+ !dd.leafName.endsWith(".xnote")
+ ) {
+ continue;
+ };
+ let jsNote = {};
- if (dd.isFile()) {
- try {
- filename = dd.leafName;
- keys_orig.push(filename);
- //name is: notesFile.append(escape(messageId).replace(/\//g, "%2F") + '.xnote');
- let convertedKey = filename.replace("/%2F/g", "/");
- convertedKey = unescape(filename);
- //console.log("converted fn", convertedKey);
- let hdrId = convertedKey.substring(0, convertedKey.length - 6);
- keys.push(hdrId);
- //let note = xnote.ns.Note(convertedKey.substring(0, convertedKey.length - 6));
- // console.log("legnote", note);
- //let jsn = JSON.stringify(note);
- //let jsNote1 = JSON.parse(jsn);
- // console.log("old note", filename, jsn,jsNote1);
- // note.saveNoteToLocalStorage(hdrId, jsNote1);
- // jsNote = [hdrId, jsNote1];
- // jsAll.push(jsNote);
- }
- catch (ex) {
- console.error("cannot convert xnote file", dd, ex);
+ if (dd.isFile()) {
+ try {
+
+
+ filename = dd.leafName;
+
+ keys_orig.push(filename);
+ //name is: notesFile.append(escape(messageId).replace(/\//g, "%2F") + '.xnote');
+
+ let convertedKey = filename.replace("/%2F/g", "/");
+ convertedKey = unescape(filename);
+ //console.log("converted fn", convertedKey);
+ let hdrId = convertedKey.substring(0, convertedKey.length - 6);
+ keys.push(hdrId);
+ //let note = xnote.ns.Note(convertedKey.substring(0, convertedKey.length - 6));
+ // console.log("legnote", note);
+ //let jsn = JSON.stringify(note);
+ //let jsNote1 = JSON.parse(jsn);
+ // console.log("old note", filename, jsn,jsNote1);
+ // note.saveNoteToLocalStorage(hdrId, jsNote1);
+ // jsNote = [hdrId, jsNote1];
+ // jsAll.push(jsNote);
+ }
+ catch (ex) {
+ console.error("cannot convert xnote file", dd, ex);
+ }
+ ;
}
- ;
- }
- };
+ };
+ } catch (ex) {
+ console.error("no directory entries for xnotes");
+ }
return { keys: keys, keys_orig: keys_orig };
},
@@ -359,6 +443,30 @@
return { text: note.text, date: note.modificationDate };
},
+ async syncXNote(msgKey, XNote) {
+ //not sending back to replicate after save
+ // debugger;
+ let note = new xnote.ns.Note(msgKey);
+ note.x = XNote.x;
+ note.y = XNote.y;
+ note.width = XNote.width;
+ note.height = XNote.height;
+ note.text = XNote.text;
+ note.modificationDate = XNote.modificationDate;
+ note.saveNote(false); //not sending back to replicate after save
+
+
+ },
+
+
+ async deleteXNoteFromMsgKey(msgKey) {
+ let note = new xnote.ns.Note(msgKey);
+ note.deleteNote(false); //not sending back to replicate after delete
+
+ },
+
+
+
async getXNoteFromMsgKey(msgKey) {
let note = {};
try {
@@ -376,7 +484,7 @@
} catch (ex) {
console.error(`Could not get TB mesg`);
}
- if (note == null) return false; else return JSON.parse(JSON.stringify(note));
+ if (note == null) return false; else return { note: JSON.parse(JSON.stringify(note)) };
},
@@ -386,7 +494,7 @@
async setPreferences(prefs) {
xnote.ns.Commons.xnotePrefs = prefs;
- // console.debug({"XnotePrefs" : xnote.ns.Commons.xnotePrefs});
+ // console.debug({"XnotePrefs" : xnote.ns.Commons.xnotePrefs});
xnote.ns.Storage.updateStoragePath();
xnote.ns.Commons.checkXNoteTag();
},
@@ -454,15 +562,15 @@
// console.debug(`onShutdown: isAppShutdown=${isAppShutdown}`);
if (isAppShutdown) return;
- Components.utils.unload("resource://xnote/modules/dateformat.jsm");
- Components.utils.unload("resource://xnote/modules/commons.jsm");
- Components.utils.unload("resource://xnote/modules/xnote.jsm");
+ if (Components.utils.unload) Components.utils.unload("resource://xnote/modules/dateformat.jsm");
+ if (Components.utils.unload) Components.utils.unload("resource://xnote/modules/commons.jsm");
+ if (Components.utils.unload) Components.utils.unload("resource://xnote/modules/xnote.jsm");
// invalidate the startup cache, such that after updating the addon the old
// version is no longer cached
Services.obs.notifyObservers(null, "startupcache-invalidate");
Services.obs.notifyObservers(null, "chrome-flush-caches", null);
- // console.log("end onShutdown in xn-exp")
+ // console.log("end onShutdown in xn-exp")
}
}
diff -Nru xnote-4.1.12/experiment-apis/xnote/xnote-experiments.json xnote-4.5.48/experiment-apis/xnote/xnote-experiments.json
--- xnote-4.1.12/experiment-apis/xnote/xnote-experiments.json 2023-11-02 13:52:56.000000000 +0100
+++ xnote-4.5.48/experiment-apis/xnote/xnote-experiments.json 2024-09-17 22:41:50.000000000 +0200
@@ -3,14 +3,20 @@
"namespace": "xnoteapi",
"functions": [
{
- "name": "init",
+ "name": "loadXNoteJSM",
"type": "function",
"async": true,
"parameters": []
},
+ {
+ "name": "init",
+ "type": "function",
+ "async": true,
+ "parameters": []
+ },
-
+
{
"name": "hasOpenNoteWindow",
@@ -92,6 +98,44 @@
]
},
+
+
+
+ {
+ "name": "deleteXNoteFromMsgKey",
+ "type": "function",
+ "async": true,
+ "parameters": [
+ {
+ "name": "msgKey",
+ "type": "any",
+ "description": "legacy message key"
+ }
+ ]
+ },
+
+
+
+ {
+ "name": "syncXNote",
+ "type": "function",
+ "async": true,
+ "parameters": [
+ {
+ "name": "msgKey",
+ "type": "any",
+ "description": "legacy message key"
+ },
+ {
+ "name": "XNote",
+ "type": "any",
+ "description": "XNote object"
+ }
+
+ ]
+ },
+
+
{
"name": "getXNoteFromMsgKey",
"type": "function",
@@ -107,6 +151,15 @@
{
+ "name": "isExperimentReady",
+ "type": "function",
+ "async": true,
+ "parameters": [ ]
+ },
+
+
+
+ {
"name": "getAllXNoteKeys",
"type": "function",
"async": true,
diff -Nru xnote-4.1.12/_locales/de/messages.json xnote-4.5.48/_locales/de/messages.json
--- xnote-4.1.12/_locales/de/messages.json 2024-01-08 12:14:00.000000000 +0100
+++ xnote-4.5.48/_locales/de/messages.json 2025-02-13 13:32:48.000000000 +0100
@@ -30,6 +30,6 @@
"Select.storage.dir": {"message": "W?hlen Sie bitte das Verzeichnis zum Speichern der XNotes."},
"show.in.messageDisplay": {"message": "XNote Zusammenfassung in der email anzeigen"},
"show.full.in.messageDisplay": {"message": "XNote voll in der email anzeigen"},
- "show.show.column": {"message": "XNote in der 'Gr?sse' Spalte anzeigen"}
+ "show.show.column": {"message": "XNote Spalte anzeigen"}
}
diff -Nru xnote-4.1.12/_locales/en_US/messages.json xnote-4.5.48/_locales/en_US/messages.json
--- xnote-4.1.12/_locales/en_US/messages.json 2024-01-08 12:16:10.000000000 +0100
+++ xnote-4.5.48/_locales/en_US/messages.json 2025-02-14 12:40:48.000000000 +0100
@@ -28,8 +28,8 @@
"show.on.select": {"message": "Show note on message selection"},
"show.first.x.chars.in.col": {"message": "Show first X characters in XNote column"},
"Select.storage.dir": {"message": "Please select the XNote storage directory."},
- "show.in.messageDisplay": {"message": "Show XNote summary in messsage display"},
- "show.full.in.messageDisplay": {"message": "Show full XNote in messsage display"},
- "show.show.column": {"message": "Show XNote in the 'size' column"}
+ "show.in.messageDisplay": {"message": "Show XNote summary in message display"},
+ "show.full.in.messageDisplay": {"message": "Show full XNote in message display"},
+ "show.show.column": {"message": "Show XNote column"}
}
diff -Nru xnote-4.1.12/_locales/fr_FR/messages.json xnote-4.5.48/_locales/fr_FR/messages.json
--- xnote-4.1.12/_locales/fr_FR/messages.json 2024-01-08 12:16:22.000000000 +0100
+++ xnote-4.5.48/_locales/fr_FR/messages.json 2025-02-14 12:40:40.000000000 +0100
@@ -28,8 +28,8 @@
"show.on.select": {"message": "Afficher la note du message s?lectionn?"},
"show.first.x.chars.in.col": {"message": "Montrer les n premiers caract?res de la note dans la colonne XNote"},
"Select.storage.dir": {"message": "Veuillez s?lectionner le dossier d'enregistrement des notes."},
- "show.in.messageDisplay": {"message": "Show XNote summary in messsage display"},
- "show.full.in.messageDisplay": {"message": "Show full XNote in messsage display"},
- "show.show.column": {"message": "Show XNote in the 'size' column"}
+ "show.in.messageDisplay": {"message": "Show XNote summary in message display"},
+ "show.full.in.messageDisplay": {"message": "Show full XNote in message display"},
+ "show.show.column": {"message": "Show XNote column"}
}
\ Kein Zeilenumbruch am Dateiende.
diff -Nru xnote-4.1.12/_locales/gl/messages.json xnote-4.5.48/_locales/gl/messages.json
--- xnote-4.1.12/_locales/gl/messages.json 2024-01-08 12:16:32.000000000 +0100
+++ xnote-4.5.48/_locales/gl/messages.json 2025-02-14 12:40:28.000000000 +0100
@@ -28,8 +28,8 @@
"show.on.select": {"message": "Amosar nota ao selecionar a mensaxe"},
"show.first.x.chars.in.col": {"message": "Amosar primeiros X caracteres na columna XNote"},
"Select.storage.dir": {"message": "Selecione o cartafol de almacenamento para XNote."},
- "show.in.messageDisplay": {"message": "Show XNote summary in messsage display"},
- "show.full.in.messageDisplay": {"message": "Show full XNote in messsage display"},
- "show.show.column": {"message": "Show XNote in the 'size' column"}
+ "show.in.messageDisplay": {"message": "Show XNote summary in message display"},
+ "show.full.in.messageDisplay": {"message": "Show full XNote in message display"},
+ "show.show.column": {"message": "Show XNote column"}
}
diff -Nru xnote-4.1.12/_locales/it_IT/messages.json xnote-4.5.48/_locales/it_IT/messages.json
--- xnote-4.1.12/_locales/it_IT/messages.json 2024-01-08 12:16:40.000000000 +0100
+++ xnote-4.5.48/_locales/it_IT/messages.json 2025-02-14 12:40:16.000000000 +0100
@@ -28,7 +28,7 @@
"show.on.select": {"message": "Mostra nota quando si seleziona il messaggio"},
"show.first.x.chars.in.col": {"message": "Mostra i primi x caratteri nella colonna XNote"},
"Select.storage.dir": {"message": "Selezionare la cartella dove salvare i file XNote."},
- "show.in.messageDisplay": {"message": "Show XNote summary in messsage display"},
- "show.full.in.messageDisplay": {"message": "Show full XNote in messsage display"},
- "show.show.column": {"message": "Show XNote in the 'size' column"}
+ "show.in.messageDisplay": {"message": "Show XNote summary in message display"},
+ "show.full.in.messageDisplay": {"message": "Show full XNote in message display"},
+ "show.show.column": {"message": "Show XNote column"}
}
diff -Nru xnote-4.1.12/_locales/ja_JP/messages.json xnote-4.5.48/_locales/ja_JP/messages.json
--- xnote-4.1.12/_locales/ja_JP/messages.json 2024-01-08 12:16:52.000000000 +0100
+++ xnote-4.5.48/_locales/ja_JP/messages.json 2025-02-14 12:40:06.000000000 +0100
@@ -28,7 +28,7 @@
"show.on.select": {"message": "??????????????????"},
"show.first.x.chars.in.col": {"message": "????????XNote??????????????"},
"Select.storage.dir": {"message": "???????????????"},
- "show.in.messageDisplay": {"message": "Show XNote summary in messsage display"},
- "show.full.in.messageDisplay": {"message": "Show full XNote in messsage display"},
- "show.show.column": {"message": "Show XNote in the 'size' column"}
+ "show.in.messageDisplay": {"message": "Show XNote summary in message display"},
+ "show.full.in.messageDisplay": {"message": "Show full XNote in message display"},
+ "show.show.column": {"message": "Show XNote column"}
}
diff -Nru xnote-4.1.12/_locales/nl_NL/messages.json xnote-4.5.48/_locales/nl_NL/messages.json
--- xnote-4.1.12/_locales/nl_NL/messages.json 2024-01-08 12:17:00.000000000 +0100
+++ xnote-4.5.48/_locales/nl_NL/messages.json 2025-02-13 17:13:42.000000000 +0100
@@ -28,8 +28,8 @@
"show.on.select": {"message": "Notitie tonen bij selectie"},
"show.first.x.chars.in.col": {"message": "Toon eerste x karakters in Xnote Kolom"},
"Select.storage.dir": {"message": "Selecteer standaard directory voor Xnote."},
- "show.in.messageDisplay": {"message": "Show XNote summary in messsage display"},
- "show.full.in.messageDisplay": {"message": "Show full XNote in messsage display"},
- "show.show.column": {"message": "Show XNote in the 'size' column"}
+ "show.in.messageDisplay": {"message": "Show XNote summary in message display"},
+ "show.full.in.messageDisplay": {"message": "Show full XNote in message display"},
+ "show.show.column": {"message": "Show XNote column"}
}
diff -Nru xnote-4.1.12/manifest.json xnote-4.5.48/manifest.json
--- xnote-4.1.12/manifest.json 2024-01-09 21:34:52.000000000 +0100
+++ xnote-4.5.48/manifest.json 2025-05-05 09:42:22.000000000 +0200
@@ -2,14 +2,14 @@
"manifest_version": 2,
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
- "version": "4.1.12",
+ "version": "4.5.48",
"author": "Lorenz Froihofer: support for TB >= 3.0, since Dec. 2009, Klaus B?cher since TB 78",
"homepage_url": "https://github.com/xnotepp/xnote/wiki",
- "applications": {
+ "browser_specific_settings": {
"gecko": {
"id": "xnote at froihofer.net",
"strict_min_version": "115.0",
- "strict_max_version": "115.*"
+ "strict_max_version": "138.*"
}
},
"default_locale" : "en_US",
@@ -45,7 +45,8 @@
},
- "permissions": ["activeTab", "tabs", "storage", "unlimitedStorage", "messagesRead", "messagesModify", "clipboardWrite", "accountsRead"],
+ "permissions": ["activeTab", "tabs", "storage", "unlimitedStorage", "messagesRead", "messagesModify",
+ "messagesUpdate", "clipboardWrite", "accountsRead", "notifications"],
"background": {
"scripts": ["xn-background.js"]
@@ -86,6 +87,24 @@
"paths": [["xnotefiles"]],
"script": "experiment-apis/files/files-api.js"
}
- }
+ },
+
+
+
+ "customColumn": {
+ "schema": "experiment-apis/customColumn/schema.json",
+ "parent": {
+ "scopes": [
+ "addon_parent"
+ ],
+ "paths": [
+ [
+ "customColumn"
+ ]
+ ],
+ "script": "experiment-apis/customColumn/implementation.js"
+ }
+ }
+
}
}
diff -Nru xnote-4.1.12/mDisplay.js xnote-4.5.48/mDisplay.js
--- xnote-4.1.12/mDisplay.js 2023-11-03 12:43:40.000000000 +0100
+++ xnote-4.5.48/mDisplay.js 2024-10-07 15:07:58.000000000 +0200
@@ -81,11 +81,15 @@
let btn = document.getElementById("chgSize");
btn.addEventListener("click", showAll, false);
//debugger;
- if (message.show_full_in_messageDisplay) showAll();
+ if (message.show_full_in_messageDisplay) {
+ //make sure it shows full, needs to be set to short for that
+ btnState = 0;
+ showAll();
+ };
}
}
function showAll() {
- // console.log("all", xnoteOrig);
+// console.log("all", xnoteOrig);
let img = document.getElementById("aa");
img.src = messenger.runtime.getURL("icons/iconfinder_minimize-2_2561246MIT16.png");
// btn.textContent = "Compact";
diff -Nru xnote-4.1.12/options/options.html xnote-4.5.48/options/options.html
--- xnote-4.1.12/options/options.html 2024-01-08 20:39:54.000000000 +0100
+++ xnote-4.5.48/options/options.html 2024-10-05 23:45:10.000000000 +0200
@@ -57,11 +57,13 @@
<input id="show.full.in.messageDisplay" type="checkbox" data-preference="show_full_in_messageDisplay" />
<label for="show.full.in.messageDisplay">__MSG_show.full.in.messageDisplay__</label>
</p>
- <p>
+<!---->
+ <p>
<label for="show.column">__MSG_show.show.column__:</label>
<input id="show.column" type="checkbox" data-preference="show_column" />
</p>
- <p>
+
+ <p>
<label for="colchars">__MSG_show.first.x.chars.in.col__:</label>
<input id="colchars" type="number" min="0" size="5" data-preference="show_first_x_chars_in_col" />
</p>
diff -Nru xnote-4.1.12/options/options.js xnote-4.5.48/options/options.js
--- xnote-4.1.12/options/options.js 2023-11-02 17:48:12.000000000 +0100
+++ xnote-4.5.48/options/options.js 2024-06-21 22:44:26.000000000 +0200
@@ -3,6 +3,7 @@
//The object only works if retrieved through chrome.extension, but not
//through browser.extension or messenger.extension
var bgPage = chrome.extension.getBackgroundPage();
+if (bgPage== null) console.error("no bgr page is found in options.js");
var prefs = bgPage.getPreferences();
diff -Nru xnote-4.1.12/popup/donations1.html xnote-4.5.48/popup/donations1.html
--- xnote-4.1.12/popup/donations1.html 2024-01-08 12:05:16.000000000 +0100
+++ xnote-4.5.48/popup/donations1.html 2024-09-08 12:46:02.000000000 +0200
@@ -2,14 +2,14 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
- <title>XNote++ for TB 115</title>
+ <title>XNote++ for TB 128</title>
<link1 rel="stylesheet" href="popup.css" type="text/css">
<script type="application/javascript" src="/scripts/tools.js"></script>
<script type="application/javascript" src="/scripts/listener.js"></script>
</head>
<body>
- <h1 style="text-align: center;"><span style="color: rgb(166, 77, 121);">TB 115: Test Version (not for production use) </span></h1>
+ <h1 style="text-align: center;"><span style="color: rgb(166, 77, 121);">TB 128: Test Version (not for production use) </span></h1>
<h2 style="text-align: center;"><span style="color: rgb(166, 77, 121);">New Features </span></h2>
<p><b>XNote column:</b> As a workaround for the time being, XNotes can be displayed in the size column. You need
to make the size column visible in the column picker and drag it to the position of your liking.<br>
@@ -17,35 +17,28 @@
click on the size column header, you will see the message size.<br>
If you do not want this, you can deselect the column in the addon settings.
</p>
- <p>This version implements XNotes forTB 115. Known issues:</p>
+ <p>This version implements XNotes forTB 128. Known issues:</p>
<ul>
<li>Print XNote does not work yet
</li>
- <li>For TB 115, Mozilla has not yet provided custom columns. So the XNote cannot be shown in a column in the threadtree.</b></li>
+ <li>For TB 115/TB128, Mozilla has not yet provided custom columns. So the XNote cannot be shown in a column in the threadtree.</b></li>
<br>
<li>Please report any other problems on github:
<a data-external-href="https://github.com/xnotepp/xnote/issues"
- rel="nofollow" style="box-sizing: border-box; color: red;background-color: rgb(255, 255, 255); color: var(--color-accent-fg); text-decoration: underline; font-size: 18px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal;">Help/list bugs in XNote for TB 115</a> </li>
+ rel="nofollow" style="box-sizing: border-box; color: red;background-color: rgb(255, 255, 255); color: var(--color-accent-fg); text-decoration: underline; font-size: 18px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal;">Help/list bugs in XNote for TB 128</a> </li>
</ul>
<h1 style="text-align: center;"><span style="color: rgb(166, 77, 121);">Asking for Donations for the XNote++ Update
- to TB 115 </span></h1>
+ to TB 128 </span></h1>
<p>
</p>
- <p>TB 115 comes and brings a lot of changes helping to manage our emails. But now there are very substantial code changes in TB 115. The main window has
- been converted from XUL to HTML, many elements are gone or have a
- different id. For example, the 'threadtree' in its old form is gone (where we select a message and then display the XNote), being replaced by a new
- element.<br>
- Custom columns (to display the XNote icon) are not yet possible in TB 115 for addons (they are promised to come later),
- so we may need a workaround to indicate when a message has a XNote...
- mail:3pane is now about:3pane, and ..... many more good
- changes in core TB, but they need time to incorporate into the addon.</p>
+ <p>TB 128 comes and brings a lot of changes helping to manage our emails. But now again there are very code changes in the core of TB 128. </p>
<p></p>
<h2 style="color: rgb(166, 77, 121);text-align:center"><span style="color: rgb(166, 77, 121);text-align:center"><strong>Donations are very much
welcome. <br>
Paypal: <a data-external-href="https://www.paypal.com/donate/?hosted_button_id=2AKE2G2B9J3ZS"
- rel="nofollow" style="box-sizing: border-box; color: red;background-color: rgb(255, 255, 255); color: var(--color-accent-fg); text-decoration: underline; font-size: 18px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal;">I want to support adapting XNote++ to TB 115</a></strong></span></h2>
+ rel="nofollow" style="box-sizing: border-box; color: red;background-color: rgb(255, 255, 255); color: var(--color-accent-fg); text-decoration: underline; font-size: 18px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal;">I want to support adapting XNote++ to TB 128</a></strong></span></h2>
<p>
Many thanks, Klaus<br>
diff -Nru xnote-4.1.12/popup/donations.html xnote-4.5.48/popup/donations.html
--- xnote-4.1.12/popup/donations.html 2024-01-08 12:04:36.000000000 +0100
+++ xnote-4.5.48/popup/donations.html 2024-10-06 20:26:30.000000000 +0200
@@ -2,22 +2,23 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
- <title>XNote++ for TB 115</title>
+ <title>XNote++ for TB 128</title>
<link1 rel="stylesheet" href="popup.css" type="text/css">
<script type="application/javascript" src="/scripts/tools.js"></script>
<script type="application/javascript" src="/scripts/listener.js"></script>
</head>
<body>
- <h1 style="text-align: center;"><span style="color: rgb(166, 77, 121);">XNote ++ for TB 115 </span></h1>
+ <h1 style="text-align: center;"><span style="color: rgb(166, 77, 121);">XNote ++ for TB 128 </span></h1>
<h2 style="text-align: center;"><span style="color: rgb(166, 77, 121);">New Features </span></h2>
- <p><b>XNote column:</b> As a workaround for the time being, XNotes can be displayed in the size column. You need
- to make the size column visible in the column picker and drag it to the position of your liking.<br>
- If you click into the messagelist, the size column will display the XNote beginning, and on hover the full XNote. If you
- click on the size column header, you will see the message size.<br>
- If you do not want this, you can deselect the column in the addon settings.
+ <p><b>XNote column:</b> In options, you can choose whether to display the XNote column. When the length is set
+ to 0, only the icon is displayed. Mouseover (hover) over the icon displays the note in a tooltip.
+ At this moment, the column picker does not propagate the column position into all subfolders, although
+ new code for custom columns provided by Thunderbird is used. You need
+ to drag the column to the position of your liking.<br>
+ If you click on the XNote column header, you can order by XNote presence and text.<br>
</p>
- <p>This version implements XNotes forTB 115. Known issues:</p>
+ <p>This version implements XNotes for TB 128. Known issues:</p>
<ul>
<li>Print XNote does not work yet
</li>
@@ -25,26 +26,19 @@
<li>Please report any other problems on github:
<a data-external-href="https://github.com/xnotepp/xnote/issues"
- rel="nofollow" style="box-sizing: border-box; color: red;background-color: rgb(255, 255, 255); color: var(--color-accent-fg); text-decoration: underline; font-size: 18px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal;">Help/list bugs in XNote for TB 115</a> </li>
+ rel="nofollow" style="box-sizing: border-box; color: red;background-color: rgb(255, 255, 255); color: var(--color-accent-fg); text-decoration: underline; font-size: 18px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal;">Help/list bugs in XNote for TB 128</a> </li>
</ul>
<h1 style="text-align: center;"><span style="color: rgb(166, 77, 121);">Asking for Donations for the XNote++ Update
- to TB 115 </span></h1>
+ to TB 128 </span></h1>
<p>
</p>
- <p>TB 115 comes and brings a lot of changes helping to manage our emails. But now there are very substantial code changes in TB 115. The main window has
- been converted from XUL to HTML, many elements are gone or have a
- different id. For example, the 'threadtree' in its old form is gone (where we select a message and then display the XNote), being replaced by a new
- element.<br>
- Custom columns (to display the XNote icon) are not yet possible in TB 115 for addons (they are promised to come later),
- so we may need a workaround to indicate when a message has a XNote...
- mail:3pane is now about:3pane, and ..... many more good
- changes in core TB, but they need time to incorporate into the addon.</p>
+ <p>TB 128 comes and brings a lot of changes helping to manage our emails. But now again there are very code changes in the core of TB 128. </p>
<p></p>
<h2 style="color: rgb(166, 77, 121);text-align:center"><span style="color: rgb(166, 77, 121);text-align:center"><strong>Donations are very much
welcome. <br>
Paypal: <a data-external-href="https://www.paypal.com/donate?hosted_button_id=2AKE2G2B9J3ZS"
- rel="nofollow" style="box-sizing: border-box; color: red;background-color: rgb(255, 255, 255); color: var(--color-accent-fg); text-decoration: underline; font-size: 18px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal;">I want to support adapting XNote++ to TB 115</a></strong></span></h2>
+ rel="nofollow" style="box-sizing: border-box; color: red;background-color: rgb(255, 255, 255); color: var(--color-accent-fg); text-decoration: underline; font-size: 18px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal;">I want to support adapting XNote++ to TB 128</a></strong></span></h2>
<p>
Many thanks, Klaus<br>
diff -Nru xnote-4.1.12/popup/ExprSearch.html xnote-4.5.48/popup/ExprSearch.html
--- xnote-4.1.12/popup/ExprSearch.html 2023-10-30 22:09:50.000000000 +0100
+++ xnote-4.5.48/popup/ExprSearch.html 2025-01-18 19:28:10.000000000 +0100
@@ -13,7 +13,13 @@
<p>
</p>
<p>It is now possible to search text in XNotes. This is done by using the addon Expression Search NG. You can add
- it from addons.thunderbird.net:
+ it from addons.thunderbird.net:
+<!-- <button id="ES-install">Open addon page on addons.thunderbird.net</button>
+ <a href = "https://addons.thunderbird.net/thunderbird/addon/expression-search-ng/" target = "_blank">https://addons.thunderbird.net/thunderbird/addon/expression-search-ng/</a>
+ -->
+ <A href = "" data-tab-href = "https://addons.thunderbird.net/thunderbird/addon/expression-search-ng/" >https://addons.thunderbird.net/thunderbird/addon/expression-search-ng/</a>
+
+
</p>
<p>You can search for XNotes in the current folder, and you can use general search to find XNotes over all folders.</p>
<p>To search in the current folder, enter xnote:text (or xn:text) into the Expression Search searchbox to search for emails having
@@ -23,5 +29,21 @@
as well as searching for XNotes not containing text or emails not having XNotes.
</p>
+ <br><br><b>Examples for XNote search queries:</b>
+ <ul style = " display: grid;grid-template-columns: 0.27fr 0.9fr; ">
+ <li>xn:subtext</li> <li style = "list-style-type: none; ">list only emails containing subtext, anywhere in a XNote</li>
+ <li>xn:subt</li> <li style = "list-style-type: none; ">list emails containing subtext, anywhere in a XNote. Other words with subt (e.g. subtle) might be
+ found as well.</li>
+ <li>-xn:subtext</li><li style = "list-style-type: none; ">list only emails not containing subtext in a XNote (but having a XNote)</li>
+ <li>xn:*</li><li style = "list-style-type: none; ">list all messages with a XNote</li>
+ <li>-xn:*</li><li style = "list-style-type: none; ">list all messages without XNotes</li>
+ <li>^xn:opto</li><li style = "list-style-type: none; ">list all messages starting with my nickname, "opto" (all employees, here, start their notes with their name)</li>
+ <li>^xn:opto xn:contract</li><li style = "list-style-type: none; ">list all messages starting with opto and containing the word contract</li>
+ <li>^xn:opto xn:contract f:companyname</li><li style = "list-style-type: none; ">list all messages from companyname, which start with opto (written by
+ myself) and the XNote contains the word contract</li>
+ <li>^xn:opto age:60 xn:contract f:companyname</li><li style = "list-style-type: none; ">as above, but list only emails from the last 60 days.</li>
+ <!-- <li></li><li style = "list-style-type: none; "></li>-->
+ </ul>
+
</body>
</html>
diff -Nru xnote-4.1.12/popup/update.html xnote-4.5.48/popup/update.html
--- xnote-4.1.12/popup/update.html 2023-11-16 23:16:18.000000000 +0100
+++ xnote-4.5.48/popup/update.html 2025-02-18 22:21:32.000000000 +0100
@@ -23,17 +23,10 @@
<p></p>
<h2 style="color: darkgreen !important;">Fulltext search with constraints</h2>
<p></p>
- <li><b>Search XNotes (v 3.5.5):</b></li>
- <p>XNote column: as a workaround until custom columns are fully implemented in TB for addons, we display
- the XNote column in the following way:<br>
- We "double-use" the location column to show the XNote text or toggle to the location.<br>
- In a normal view, the location column is not really needed, as it is just the foldername, which is identical
- for all messages. So we reuse this column to display the XNote text.
- <br>
- You need to activate this column in the column picker and shift it to the position where you want it displayed.
- <br> Clicking the sort arrow in the column header switches back to display the location. Selecting
- a message then toggles back to XNote display.
- <br>
+ <li><b>Bugfix: Resize/reposition XNotes, fix print note</b></li>
+ <li><b>XNote column:</b></li>
+ <p> You need to activate this column in the column picker and shift it to the position where you want it displayed.
+
Hovering over the abbreviated XNote column then displays the full XNote in a tooltip.
</p>
<br>
@@ -94,7 +87,7 @@
<h2>New/Hidden Features</h2>
<p></p>
<li><b>Version 3.5.4:</b></li>
- <p>XNote display in messagedisplay: options now allowto either display a XNote summary or the full XNote in the
+ <p>XNote display in messagedisplay: options now allow to either display a XNote summary or the full XNote in the
messagedisplay. The choice can be toggled by
options in the messagedisplay.</p>
<p>Toggle note window: Alt-m opens an XNote window or closes (and saves) the XNote. So Alt-m is equivalent to
diff -Nru xnote-4.1.12/scripts/listener.js xnote-4.5.48/scripts/listener.js
--- xnote-4.1.12/scripts/listener.js 2023-07-23 00:04:02.000000000 +0200
+++ xnote-4.5.48/scripts/listener.js 2025-02-18 00:33:02.000000000 +0100
@@ -7,6 +7,7 @@
*/
window.document.addEventListener("click", async (event) => {
+//debugger;
if (event.target.tagName == "A") {
if (event.target.dataset.externalHref) {
event.preventDefault();
@@ -19,6 +20,12 @@
let [url, anchor] = event.target.dataset.windowHref.split("#");
messenger.windows.create({type: "popup", url: translateURL(url, anchor)});
}
+ if (event.target.dataset.tabHref) {
+ event.preventDefault();
+ event.stopPropagation();
+ let [url, anchor] = event.target.dataset.tabHref.split("#");
+ messenger.tabs.create({ url: translateURL(url, anchor)});
+ }
diff -Nru xnote-4.1.12/xn-background.js xnote-4.5.48/xn-background.js
--- xnote-4.1.12/xn-background.js 2024-01-09 21:30:18.000000000 +0100
+++ xnote-4.5.48/xn-background.js 2025-03-27 15:38:16.000000000 +0100
@@ -31,21 +31,9 @@
xnote.window = null;
xnote.currentDisplayedMessage = -1;
-// Register the chrome url, so any code running after this can access them.
-messenger.WindowListener.registerChromeUrl([
- ["content", "xnote", "chrome/content/"],
- ["resource", "xnote", "chrome/"],
-
- ["locale", "xnote", "en-US", "chrome/locale/en-US/"],
- ["locale", "xnote", "de", "chrome/locale/de/"],
- ["locale", "xnote", "fr-FR", "chrome/locale/fr-FR/"],
- ["locale", "xnote", "gl", "chrome/locale/gl/"],
- ["locale", "xnote", "it-IT", "chrome/locale/it-IT/"],
- ["locale", "xnote", "ja-JP", "chrome/locale/ja-JP/"],
- ["locale", "xnote", "nl-NL", "chrome/locale/nl-NL/"],
- ["locale", "xnote", "pl-PL", "chrome/locale/pl-PL/"],
- ["locale", "xnote", "pt-BR", "chrome/locale/pt-BR/"],
-]);
+var xnoteSyncTest = {};
+
+
// This is the current "migration" version for preferences. You can increase it later
// if you happen to need to do more pref (or maybe other migrations) only once
@@ -69,6 +57,21 @@
show_column: true,
};
+async function waitForExperiment() {
+ let res = false;
+
+ for (let i = 0; i < 500; i++) {
+ try {
+ res = await messenger.xnoteapi.isExperimentReady();
+ }
+
+ catch (ev) { };
+ // console.log("notif exp", i, res);
+ if (res) break;
+ await wait(100);
+ };
+};
+
async function migratePrefs() {
//console.debug("migratePrefs called.")
const results = await browser.storage.local.get("preferences");
@@ -128,7 +131,7 @@
}
prefs.migratedLegacy = kCurrentLegacyMigration;
- //console.debug("Storing migrated preferences.");
+ console.debug("Storing migrated preferences.");
await browser.storage.local.set({ "preferences": prefs });
}
@@ -146,9 +149,19 @@
}
async function setPreferences(preferences) {
+ let oldShow_column = preferenceCache.show_column;
+ // console.log("col", oldShow_column , preferences.show_column);
preferenceCache = preferences;
browser.storage.local.set({ preferences });
browser.xnoteapi.setPreferences(preferences);
+ // if (oldShow_column != preferences.show_column)
+ if (preferences.show_column) {
+ await browser.customColumn.add("XNote");
+
+ } else {
+ await browser.customColumn.remove("XNote");
+
+ };
}
async function selectDirectory(startDir, title) {
@@ -186,7 +199,17 @@
await messenger.tabs.create({ url });
// let wID1 = await browser.windows.create({ url, type: "popup", width: 910, height: 750, });
// console.log ("wid", wID1);
- }
+
+ let answ;
+ try {
+ answ = await messenger.runtime.sendMessage("expressionsearch at opto.one", { command: "setXNoteInstalled" });
+ }
+ catch (e) {
+ // let url = messenger.runtime.getURL("popup/ExprSearch.html"); messenger.windows.create({ url: url, type: "popup" });
+ // console.log("ans exp", answ);
+ };
+
+ };
break;
// see below
case "update":
@@ -221,8 +244,26 @@
};
+async function updateXNoteTag(msgId, removeTag) {
+ let msg1 = await messenger.messages.get(msgId);
+ let tags = msg1.tags;
+ // console.log("tags", tags, msg1);// msgs);
+ let hasXNoteTag = false;
+ if (tags.length) hasXNoteTag = tags.toString().includes("xnote");
+ if (!removeTag && !hasXNoteTag) {
+ tags.push("xnote");
+ await messenger.messages.update(msgId, { tags: tags }); //
+ };
+ if (removeTag) {
+ let index = tags.indexOf("xnote");
+ if (index > -1) tags.splice(index, 1);
+ if (tags.length == 0) tags.push("");
+ await messenger.messages.update(msgId, { tags: tags }); //
+ };
+
+};
messenger.NotifyTools.onNotifyBackground.addListener(async (info) => {
switch (info.command) {
@@ -265,11 +306,25 @@
/*
//coming later
*/
- //115 let resp = await browser.runtime.sendMessage(
- // "expressionsearch at opto.one",
- // msg
- // );
-
+ try {
+ let resp = await browser.runtime.sendMessage(
+ "expressionsearch at opto.one",
+ msg
+ );
+ } catch (ev) { };
+ if (info.sync) {
+ //only sync if created locally, not if just received by sync
+ msg.command = "syncXNote";
+ // console.log("msg", msg);
+ try {
+ let resp = await browser.runtime.sendMessage(
+ "sync at opto.one",
+ msg
+ );
+ } catch (ev) {
+ //console.log("sync not installed", ev);
+ };
+ };
break;
case "deleteXNote":
@@ -281,6 +336,15 @@
// xnote.date = xnote1.date;
await messenger.storage.local.set({ "xnote": xnote }); //to forward to messagedisplayscript
+ let msgD = { command: "deleteXnote", xnoteKeys: xnoteKeys, hdrMsgId: info.hdrMsgId };
+ try {
+ let respD = await browser.runtime.sendMessage(
+ "expressionsearch at opto.one",
+ msgD
+ );
+ } catch (ev) { };
+
+
/*115
let msgD = { command: "deleteXnote", xnoteKeys: xnoteKeys, hdrMsgId: info.hdrMsgId };
let respD = await browser.runtime.sendMessage(
@@ -288,6 +352,16 @@
msgD
);
*/
+ if (info.sync) {
+ //only sync if deleted locally, not if just received by sync
+
+ try {
+ let resp = await browser.runtime.sendMessage(
+ "sync at opto.one",
+ msgD
+ );
+ } catch (ev) { console.log("syncdel", ev); };
+ };
break;
case "getXNote":
@@ -428,11 +502,11 @@
async function waitForWindow() {
let windows = await browser.windows.getAll({ windowTypes: ["normal"] });
for (let win of windows) {
- let activeTabs = await messenger.tabs.query({ active: true, windowId: win.windowId });
+ let activeTabs = await messenger.tabs.query({ active: true, windowId: win.id });
if (activeTabs.length == 1) {
onSafeActivated({ tabId: activeTabs[0].id, windowId: activeTabs[0].windowId });
} else {
- console.error(`Did not find exactly one active tab in window ${win.windowId}:`, activeTabs);
+ console.error(`Did not find exactly one active tab in window ${win.id}:`, activeTabs);
}
}
}
@@ -441,10 +515,41 @@
//var portFromBookmarks = null;
async function main() {
+ // await wait(1000); //to allow rsourceurl to be created
+
+ // Register the chrome url, so any code running after this can access them.
+ await messenger.WindowListener.registerChromeUrl([
+ ["content", "xnote", "chrome/content/"],
+ ["resource", "xnote", "chrome/"],
+
+ ["locale", "xnote", "en-US", "chrome/locale/en-US/"],
+ ["locale", "xnote", "de", "chrome/locale/de/"],
+ ["locale", "xnote", "fr-FR", "chrome/locale/fr-FR/"],
+ ["locale", "xnote", "gl", "chrome/locale/gl/"],
+ ["locale", "xnote", "it-IT", "chrome/locale/it-IT/"],
+ ["locale", "xnote", "ja-JP", "chrome/locale/ja-JP/"],
+ ["locale", "xnote", "nl-NL", "chrome/locale/nl-NL/"],
+ ["locale", "xnote", "pl-PL", "chrome/locale/pl-PL/"],
+ ["locale", "xnote", "pt-BR", "chrome/locale/pt-BR/"],
+ ]);
+
+ await waitForExperiment();
await waitForWindow();
+
await new Promise(resolve => setTimeout(resolve, 1000));
//console.log("before WL in main");
+
+
+ preferenceCache = (await browser.storage.local.get("preferences")).preferences;
+ await browser.xnoteapi.loadXNoteJSM();
+ await migratePrefs();
+ preferenceCache = (await browser.storage.local.get("preferences")).preferences;
+ // console.log("bgr-prefs", preferenceCache);
+ await browser.xnoteapi.setPreferences(preferenceCache);
+ await browser.xnoteapi.init();
+
+
messenger.WindowListener.registerWindow(
"chrome://messenger/content/messenger.xhtml",
// "about:3pane",
@@ -457,14 +562,10 @@
"chrome/content/scripts/xn-xnote-aboutOverlay.js"
);
- messenger.WindowListener.startListening();
-
- await migratePrefs();
+ await messenger.WindowListener.startListening();
+ // await migratePrefs();
- preferenceCache = (await browser.storage.local.get("preferences")).preferences;
- await browser.xnoteapi.setPreferences(preferenceCache);
- await browser.xnoteapi.init();
//if (preferenceCache["fetched_old_XNotes"] == false) getOldXNotes();
getOldXNotesOneByOne();
@@ -486,15 +587,16 @@
return;
}
else {
- try { let xnote_displayed = await messenger.xnoteapi.hasOpenNoteWindow(activeInfo.windowId);
- if (!xnote_displayed) {
+ try {
+ let xnote_displayed = await messenger.xnoteapi.hasOpenNoteWindow(activeInfo.windowId);
+ if (!xnote_displayed) {
- let message = await browser.messageDisplay.getDisplayedMessage(activeInfo.tabId)
- let xnote1 = await messenger.xnoteapi.getXNote(message.id);
- if (xnote1.text != "") await messenger.xnoteapi.openNoteWindow(activeInfo.windowId, message.id, true, true);
+ let message = await browser.messageDisplay.getDisplayedMessage(activeInfo.tabId)
+ let xnote1 = await messenger.xnoteapi.getXNote(message.id);
+ if (xnote1.text != "") await messenger.xnoteapi.openNoteWindow(activeInfo.windowId, message.id, true, true);
+ }
}
- }
- catch (e) {};
+ catch (e) { };
};
if (tabInfo.type != "mail") {
@@ -518,13 +620,95 @@
messenger.mailTabs.onSelectedMessagesChanged.addListener(removeNoteOnFolderChange);
browser.browserAction.onClicked.addListener(async (tab, info) => {
- // messenger.xnoteapi.getAllXNoteKeys();
- let xnote_displayed = await messenger.xnoteapi.hasOpenNoteWindow(tab.windowId);
- if (!xnote_displayed) {
+
+
+ if (info.modifiers.includes("Shift")) {
+ // console.log("Shift");
let message = await browser.messageDisplay.getDisplayedMessage(tab.id)
- await messenger.xnoteapi.openNoteWindow(tab.windowId, message.id, true, true);
+ let xnote1 = await messenger.xnoteapi.getXNote(message.id);
+
+ xnoteSyncTest = await messenger.xnoteapi.getXNoteFromMsgKey(message.headerMessageId);
+ // console.log("XNote", xnote1, xnoteSyncTest, message, xnoteSyncTest.note);
+ let actTab = await messenger.mailTabs.getCurrent();
+ let selFolders = await messenger.mailTabs.getSelectedFolders(actTab.id);
+ if (selFolders.length);
+ // messenger.ExpressionSearchTools.openSearchInTab(selFolders[0].accountId, selFolders[0].path); // use first selected folder
} else {
- messenger.xnoteapi.closeNoteWindow(tab.windowId);
+ if (info.modifiers.includes("Alt")) {
+ // console.log("Shift");
+ // let message = await browser.messageDisplay.getDisplayedMessage(tab.id)
+ // let xnote1 = await messenger.xnoteapi.getXNote(message.id);
+ // console.log("XNote", xnote1);
+ let actTab = await messenger.mailTabs.getCurrent();
+ let selFolders = await messenger.mailTabs.getSelectedFolders(actTab.id);
+ if (selFolders.length) {
+ let msgList = await messenger.messages.list(selFolders[0].id);
+ let jsn = JSON.stringify(xnoteSyncTest.note);
+ // console.log("JSON", xnoteSyncTest.note, jsn);
+ let cleanNote = JSON.parse(jsn);
+ // console.log("JSON", xnoteSyncTest.note, jsn, cleanNote);
+
+ // Do something with msgList.messages.
+ for (let message of msgList.messages) {
+ // let cleanNote = JSON.parse(JSON.stringify( xnoteSyncTest.note));
+ await messenger.xnoteapi.syncXNote(message.headerMessageId, cleanNote);
+
+ }
+
+ while (msgList.id) {
+ msgList = await messenger.messages.continueList(msgList.id);
+ // Do something with page.messages.
+ for (let message of msgList.messages) {
+ await messenger.xnoteapi.syncXNote(message.headerMessageId, xnoteSyncTest);
+
+ }
+ };
+ // console.log("copy notes finished");
+ let show_column = getTbPref("show_column");
+ if (show_column) {
+ await browser.customColumn.refreshColumn("XNote");
+
+ };
+ let mt = await messenger.mailTabs.getCurrent();
+ //not updating view: await messenger.mailTabs.update({displayedFolder: mt.displayedFolder});
+ };
+ // messenger.ExpressionSearchTools.openSearchInTab(selFolders[0].accountId, selFolders[0].path); // use first selected folder
+ } else { // messenger.xnoteapi.getAllXNoteKeys();
+ let xnote_displayed = await messenger.xnoteapi.hasOpenNoteWindow(tab.windowId);
+ if (!xnote_displayed) {
+ // let message = await browser.messageDisplay.getDisplayedMessage(tab.id);
+ // console.log("messDispl1", tab);
+ if (tab.mailTab) {
+ let msgs = (await browser.mailTabs.getSelectedMessages(tab.id));
+ let message = msgs.messages[0];
+ // console.log("messDispl", tab, message, msgs);
+ if (msgs.messages.length == 1) await messenger.xnoteapi.openNoteWindow(tab.windowId, message.id, true, true);
+ else messenger.notifications.create({ title: "Attention", message: "Cannot create XNote if multiple messages are selected", type: "basic" });
+ } else {
+ if (tab.type == "messageDisplay") {
+ let msgs = await browser.messageDisplay.getDisplayedMessages(tab.id);
+ if (msgs.length == 1) {
+ let msg = msgs[0];
+ let xnote1 = await messenger.xnoteapi.getXNote(msg.id);
+ // console.log("messD", xnote1, msg);
+ if (xnote1.text == "") {
+ // console.log("new note");
+ await messenger.xnoteapi.openNoteWindow(tab.windowId, msg.id, true, true);
+
+ } else {
+ await messenger.xnoteapi.openNoteWindow(tab.windowId, msg.id, true, true);
+
+ };
+ } else {
+ messenger.notifications.create({ title: "Attention", message: "Cannot create XNote if multiple messages are selected", type: "basic" });
+
+ };
+ };
+ };
+ } else {
+ messenger.xnoteapi.closeNoteWindow(tab.windowId);
+ }
+ }
}
});
@@ -535,14 +719,20 @@
xnote.currentDisplayedMessage = message.id;
//debugger;
let xnote1 = await messenger.xnoteapi.getXNote(message.id);
- if (preferenceCache["show_in_messageDisplay"] == false) xnote1.text = "";
- xnote1.show_full_in_messageDisplay = preferenceCache["show_full_in_messageDisplay"];
xnote.text = xnote1.text;
xnote.date = xnote1.date;
+ if (preferenceCache["show_in_messageDisplay"] == false) xnote.text = "";
await messenger.storage.local.set({ "xnote": xnote });
+ // if (preferenceCache["show_in_messageDisplay"] == false) xnote1.text = "";
+ // xnote1.show_full_in_messageDisplay = preferenceCache["show_full_in_messageDisplay"];
+ // xnote.text = xnote1.text;
+ // xnote.date = xnote1.date;
+ // await messenger.storage.local.set({ "xnote": xnote });
+ // console.log("onMessageDisplayed", xnote1);
await messenger.xnoteapi.closeNoteWindow(tab.windowId);
- if (xnote1.text != "") await messenger.xnoteapi.openNoteWindow(tab.windowId, message.id, false, true);
+ //bugfix: prefs are stored in legacy in 2 places, so use forceshowing
+ if (xnote1.text != "") await messenger.xnoteapi.openNoteWindow(tab.windowId, message.id, preferenceCache["show_on_select"], true);//was show_column
// console.log("onMessDispl messid", message.headerMessageId);
/* let note = (await messenger.storage.local.get(message.headerMessageId))[message.headerMessageId];
// console.log("note", note);
@@ -566,7 +756,9 @@
/**/
+ // console.log("before messageExternal");
messenger.runtime.onMessageExternal.addListener(async (message, sender, sendResponse) => {
+ // console.log("in messageExternal", message, sender);
if (sender.id === "expressionsearch at opto.one") {
if (message.command == "getXnote") {
// console.log("hdr", message.hdrID);
@@ -590,7 +782,7 @@
// let notes = await messenger.storage.local.get(null);
let keys = await messenger.storage.local.get("keys");
// console.log("keys", keys);
- let all = [];
+ let all = {};
// let one = {};
for (let i = 0; i < keys.keys.length; i++) {
let key = keys.keys[i];
@@ -608,7 +800,136 @@
};
+ if (sender.id === "sync at opto.one") {
+ if (message.command == "getXnote") {
+ // console.log("hdr", message.hdrID);
+ let note = await messenger.storage.local.get(message.hdrID);
+ // console.log("note", note);
+ return note;
+ };
+
+ if (message.command == "isXnoteReady") {
+ // console.log("hdr", message.hdrID);
+ await waitForExperiment();
+ // console.log("note", note);
+ return true;
+
+ };
+
+
+ if (message.command == "getXnoteDir") {
+ //console.log("prefs", getPreferences().storage_path);
+
+ // console.log("note", note);
+ //sendResponse({resp:"test3"});//note);
+ return getPreferences().storage_path;
+
+ };
+
+
+
+ if (message.command == "saveXnoteFromSync") {
+ if (!message.deleted) messenger.xnoteapi.syncXNote(message.hdrMsgId, message.note);
+ else messenger.xnoteapi.deleteXNoteFromMsgKey(message.hdrMsgId);
+ //display or change tag
+ let msgs = await messenger.messages.query({ "headerMessageId": message.hdrMsgId });
+ if (msgs.messages.length) {
+ for (let i = 0; i < msgs.messages.length; i++) {
+ updateXNoteTag(msgs.messages[i].id, message.deleted);
+ };
+ };
+ //sendResponse({resp:"test3"});//note);
+ //return getPreferences().storage_path;
+
+ };
+
+ if (message.command == "getAllXNotesToSync") {
+ // let notes = await messenger.storage.local.get(null);
+ //get it from XNote directory
+ let notesk = await browser.xnoteapi.getAllXNotesFromDirectory();
+
+ /*
+ //get it from storage,local
+ let keys = await messenger.storage.local.get("keys");
+ // console.log("keys", keys);
+ let all = [], jsAll = [];
+ // let one = {};
+ for (let i = 0; i < keys.keys.length; i++) {
+ let key = keys.keys[i];
+ let elem = await messenger.storage.local.get(key);
+ // console.log("key", key, "elem", elem);
+ // console.log("elkey", elem[key]);
+ let jsNote = [key, elem[key] ];
+ jsAll.push(jsNote);
+
+ //all[key] = elem[key];
+ };
+ // console.log("all", notes, "onebyone", all );
+ return jsAll;
+ */
+ return notesk.all;
+
+ };
+
+ if (message.command == "getAllXNoteKeysToSync") {
+ // let notes = await messenger.storage.local.get(null);
+ //get it from XNote directory
+ let notesk = await browser.xnoteapi.getAllXNoteKeys();
+
+ /*
+ //get it from storage,local
+ let keys = await messenger.storage.local.get("keys");
+ // console.log("keys", keys);
+ let all = [], jsAll = [];
+ // let one = {};
+ for (let i = 0; i < keys.keys.length; i++) {
+ let key = keys.keys[i];
+ let elem = await messenger.storage.local.get(key);
+ // console.log("key", key, "elem", elem);
+ // console.log("elkey", elem[key]);
+ let jsNote = [key, elem[key] ];
+ jsAll.push(jsNote);
+
+ //all[key] = elem[key];
+ };
+// console.log("all", notes, "onebyone", all );
+ return jsAll;
+ */
+ // console.log("allKeys", notesk );
+ return notesk;
+
+ };
+ //
+ if (message.command == "getXNoteFromMsgKey") {
+ // let notes = await messenger.storage.local.get(null);
+ //get it from XNote directory
+ let note = await browser.xnoteapi.getXNoteFromMsgKey(message.hdrMsgId);
+
+ /*
+ //get it from storage,local
+ let keys = await messenger.storage.local.get("keys");
+ // console.log("keys", keys);
+ let all = [], jsAll = [];
+ // let one = {};
+ for (let i = 0; i < keys.keys.length; i++) {
+ let key = keys.keys[i];
+ let elem = await messenger.storage.local.get(key);
+ // console.log("key", key, "elem", elem);
+ // console.log("elkey", elem[key]);
+ let jsNote = [key, elem[key] ];
+ jsAll.push(jsNote);
+
+ //all[key] = elem[key];
+ };
+ // console.log("all", notes, "onebyone", all );
+ return jsAll;
+ */
+ // console.log("noteByKey", note );
+ return note;
+
+ };
+ };
@@ -742,6 +1063,15 @@
});
+ if (preferenceCache.show_column) {
+ await browser.customColumn.add("XNote");
+
+ } else {
+ await browser.customColumn.remove("XNote");
+
+ };
+
+
/*
//leaving in, but seems double
messenger.messageDisplay.onMessageDisplayed.addListener(async (tab, message) => {
More information about the Pkg-mozext-maintainers
mailing list