commit 8f0aded179bb448f11213e365a9a468f49fcbba8
parent d574a358729b90f8b0257fcb3c51b37716b8bcc7
Author: markseu <mark2011@mayberg.se>
Date: Mon, 18 Sep 2023 20:59:12 +0200
Updated extensions, better link normalisation
Diffstat:
4 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/system/extensions/edit.js b/system/extensions/edit.js
@@ -901,8 +901,11 @@ yellow.edit = {
bindActions: function(element) {
var elements = element.getElementsByTagName("a");
for (var i=0, l=elements.length; i<l; i++) {
- if (elements[i].getAttribute("href") && elements[i].getAttribute("href").substring(0, 13)=="#data-action-") {
- elements[i].setAttribute("data-action", elements[i].getAttribute("href").substring(13));
+ if (elements[i].getAttribute("href") && elements[i].getAttribute("href").indexOf("#data-action-")!=-1) {
+ var position = elements[i].getAttribute("href").indexOf("#data-action-");
+ var action = elements[i].getAttribute("href").substring(position+13);
+ var href = elements[i].getAttribute("href").substring(0, position);
+ if (href=="" || href==yellow.page.base+yellow.page.location) elements[i].setAttribute("data-action", action);
}
if (elements[i].getAttribute("data-action")) elements[i].onclick = yellow.onClickAction;
if (elements[i].getAttribute("data-action")=="toolbar") elements[i].onmousedown = function(e) { e.preventDefault(); };
diff --git a/system/extensions/edit.php b/system/extensions/edit.php
@@ -2,7 +2,7 @@
// Edit extension, https://github.com/annaesvensson/yellow-edit
class YellowEdit {
- const VERSION = "0.8.75";
+ const VERSION = "0.8.76";
public $yellow; // access to API
public $response; // web response
public $merge; // text merge
diff --git a/system/extensions/markdown.php b/system/extensions/markdown.php
@@ -2,7 +2,7 @@
// Markdown extension, https://github.com/annaesvensson/yellow-markdown
class YellowMarkdown {
- const VERSION = "0.8.25";
+ const VERSION = "0.8.26";
public $yellow; // access to API
// Handle initialisation
@@ -3844,7 +3844,7 @@ class YellowMarkdownParser extends MarkdownExtraParser {
$this->idAttributes = array();
$this->noticeLevel = 0;
$this->url_filter_func = function($url) use ($yellow, $page) {
- return $yellow->lookup->normaliseLocation($url, $page->location);
+ return $yellow->lookup->normaliseLocation($url, $page->getPage("main")->location);
};
$this->span_gamut += array("doStrikethrough" => 55);
$this->block_gamut += array("doNoticeBlocks" => 65);
diff --git a/system/extensions/update-current.ini b/system/extensions/update-current.ini
@@ -17,11 +17,11 @@ system/layouts/navigation.html: navigation.html, create, update, careful
system/layouts/pagination.html: pagination.html, create, update, careful
Extension: Edit
-Version: 0.8.75
+Version: 0.8.76
Description: Edit your website in a web browser.
DocumentationUrl: https://github.com/annaesvensson/yellow-edit
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/main/downloads/edit.zip
-Published: 2023-05-19 00:50:31
+Published: 2023-09-18 20:10:06
Developer: Anna Svensson
Tag: feature
system/extensions/edit.php: edit.php, create, update
@@ -76,11 +76,11 @@ media/downloads/yellow.pdf: yellow.pdf, create
./robots.txt: robots.txt, create
Extension: Markdown
-Version: 0.8.25
+Version: 0.8.26
Description: Text formatting for humans.
DocumentationUrl: https://github.com/annaesvensson/yellow-markdown
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/main/downloads/markdown.zip
-Published: 2023-09-12 11:14:17
+Published: 2023-09-18 20:49:33
Developer: Anna Svensson
Tag: feature
system/extensions/markdown.php: markdown.php, create, update