Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Added a '/' in front of path to editor.js
Browse files Browse the repository at this point in the history
Also moved away from jsdelivr
  • Loading branch information
bleutzinn committed Mar 28, 2022
1 parent f375215 commit 43f5e9b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions editable-contenttools.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ public function addAssets()
$assets = $this->grav['assets'];

// Add styles
$assets->addCss('https://cdn.jsdelivr.net/npm/ContentTools@1.6.12/build/content-tools.min.css');
$assets->addCss('https://cdnjs.cloudflare.com/ajax/libs/ContentTools/1.6.13/content-tools.min.css');
$assets->addCss('plugin://' . $this->plugin_name . '/css/editor.css', 1);

// Add code
$assets->addJs('https://cdn.jsdelivr.net/npm/turndown@7.0.0/dist/turndown.js');
$assets->addJs('https://cdn.jsdelivr.net/npm/ContentTools@1.6.12/build/content-tools.min.js');
$assets->AddJs('https://cdn.jsdelivr.net/npm/turndown-plugin-gfm@1.0.2/dist/turndown-plugin-gfm.js');
$assets->addJs('https://unpkg.com/turndown/dist/turndown.js');
$assets->addJs('https://cdnjs.cloudflare.com/ajax/libs/ContentTools/1.6.13/content-tools.min.js');
$assets->AddJs('https://unpkg.com/turndown-plugin-gfm/dist/turndown-plugin-gfm.js');

// Add reference to dynamically created asset editor.js
$route = $this->grav['uri']->baseIncludingLanguage() . $this->grav['uri']->route();
Expand All @@ -41,7 +41,7 @@ public function addAssets()
array_shift($path);
}
$route = '/' . implode('/', $path);
$assets->addJs(Uri::cleanPath($this->plugin_name . '-api' . $route . '/' . 'editor.js'));
$assets->addJs(Uri::cleanPath('/' . $this->plugin_name . '-api' . $route . '/' . 'editor.js'));
}

/**
Expand Down

0 comments on commit 43f5e9b

Please sign in to comment.