Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
andreas-web committed Dec 18, 2023
1 parent c4ff803 commit 9a24d79
Showing 2 changed files with 23 additions and 22 deletions.
32 changes: 16 additions & 16 deletions filter.php
Original file line number Diff line number Diff line change
@@ -174,7 +174,7 @@ public function filter($text, array $options = []) {
}

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

$this->settings = $this->get_adminsettings();
$this->set_versions();
@@ -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);
@@ -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();
@@ -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);
@@ -249,7 +249,7 @@ public function filter($text, array $options = []) {
/**
* Create a new div node for a given JSXGraph node.
*
* @param domNode $node JSXGraph node
* @param domNode $node JSXGraph node.
* @param Integer $index Index in taglist.
*
* @return domNode
@@ -320,8 +320,8 @@ private function apply_js($node) {
$attributes = $this->get_tagattributes($node);
$code = "";

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

if ($this->settings['globalJS'] !== '' && $attributes['useGlobalJS'][0]) {
$code .=
@@ -331,8 +331,8 @@ private function apply_js($node) {
"\n\n";
}

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

$code .=
"// Define BOARDID constants.\n" .
@@ -357,8 +357,8 @@ private function apply_js($node) {
"JXG.Options.board.description = '" . $attributes['description'][0] . "';\n" .
"}\n";

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

$usercode = $this->document->saveHTML($node);
// Remove <jsxgraph> tags.
@@ -371,14 +371,14 @@ private function apply_js($node) {
"////////////////////////\n";
$code .= $usercode;

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

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

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

if ($this->settings['HTMLentities'] && $attributes['entities']) {
$code = html_entity_decode($code);
13 changes: 7 additions & 6 deletions thirdpartylibs.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<?xml version="1.0"?>
<libraries>

<library>
<location>amd/build/jsxgraphcore-v1.6.2-lazy.js</location>
<name>JSXGraph 1.6.2</name>
<version>1.6.2</version>
<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.1-lazy.js</location>
<name>JSXGraph 1.6.1</name>
<version>1.6.1</version>
<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>

0 comments on commit 9a24d79

Please sign in to comment.