Skip to content

Commit

Permalink
test2
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-web committed Dec 18, 2023
1 parent 9a24d79 commit c7ad759
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 27 deletions.
22 changes: 11 additions & 11 deletions filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function filter($text, array $options = []) {
}

// 0. STEP: Do some initial stuff.
// ...............................
//////////////////////////////////

$this->settings = $this->get_adminsettings();
$this->set_versions();
Expand All @@ -183,7 +183,7 @@ public function filter($text, array $options = []) {
}

// 1. STEP: Convert HTML string to a dom object.
// .............................................
////////////////////////////////////////////////

// Create a new dom object.
$this->document = new domDocument('1.0', static::ENCODING);
Expand All @@ -204,12 +204,12 @@ public function filter($text, array $options = []) {
$this->document->recover = true;

// 2. STEP: Get tag elements.
// ..........................
/////////////////////////////

$this->taglist = $this->document->getElementsByTagname(static::TAG);

// 3.+4. STEP: Load library (if needed) and iterate backwards through the <jsxgraph> tags.
// .......................................................................................
//////////////////////////////////////////////////////////////////////////////////////////

if (!empty($this->taglist)) {
$this->load_jsxgraph();
Expand All @@ -227,7 +227,7 @@ public function filter($text, array $options = []) {
}

// 5. STEP: Paste new div node in web page.
// ........................................
///////////////////////////////////////////

// Remove DOCTYPE.
$this->document->removeChild($this->document->firstChild);
Expand Down Expand Up @@ -321,7 +321,7 @@ private function apply_js($node) {
$code = "";

// Let's load global JavaScript code from administrator settings.
// ..............................................................
/////////////////////////////////////////////////////////////////

if ($this->settings['globalJS'] !== '' && $attributes['useGlobalJS'][0]) {
$code .=
Expand All @@ -332,7 +332,7 @@ private function apply_js($node) {
}

// Define the BOARDID constants and some attributes for accessibility.
// ...................................................................
//////////////////////////////////////////////////////////////////////

$code .=
"// Define BOARDID constants.\n" .
Expand All @@ -358,7 +358,7 @@ private function apply_js($node) {
"}\n";

// Load the code from <jsxgraph>-node.
// ...................................
//////////////////////////////////////

$usercode = $this->document->saveHTML($node);
// Remove <jsxgraph> tags.
Expand All @@ -372,20 +372,20 @@ private function apply_js($node) {
$code .= $usercode;

// Surround the code with version-specific strings, e.g. "require".
// ................................................................
///////////////////////////////////////////////////////////////////

$surroundings = $this->get_code_surroundings();
$code = $surroundings["pre"] . "\n\n" . $code . $surroundings["post"];

// Convert the HTML-entities in the variable $code.
// ................................................
///////////////////////////////////////////////////

if ($this->settings['HTMLentities'] && $attributes['entities']) {
$code = html_entity_decode($code);
}

// Paste the code.
// ...............
//////////////////

// POI: Version differences.
if ($this->versionmoodle["is_newer_version"]) {
Expand Down
16 changes: 0 additions & 16 deletions thirdpartylibs.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
<?xml version="1.0"?>
<libraries>

<library>
<location>amd/build/jsxgraphcore-v1.6.1-lazy.js</location>
<name>JSXGraph 1.6.1</name>
<version>1.6.1</version>
<license>LGPL</license>
<licenseversion>3.0+</licenseversion>
</library>

<library>
<location>amd/build/jsxgraphcore-v1.6.2-lazy.js</location>
<name>JSXGraph 1.6.2</name>
<version>1.6.2</version>
<license>LGPL</license>
<licenseversion>3.0+</licenseversion>
</library>

<library>
<location>amd/build/jsxgraphcore-v1.6.0-lazy.js</location>
<name>JSXGraph 1.6.0</name>
Expand Down

0 comments on commit c7ad759

Please sign in to comment.