From 5db841cbaafe2d4f4bfe9009f5ecca996f21b4d3 Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Fri, 25 Sep 2020 22:06:12 +0200 Subject: Require jQuery using composer --- .gitignore | 1 - INSTALL.md | 6 --- build.sh | 2 - composer.json | 3 +- composer.lock | 44 +++++++++++++++++++++- ratatoeskr/js/backend.js | 15 +++----- ratatoeskr/libs/INFO | 6 --- .../templates/src/systemtemplates/master.html | 2 +- 8 files changed, 51 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index c04d68f..076eff0 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ ratatoeskr/templates/src/usertemplates/* ratatoeskr/templates/transc/* ratatoeskr/libs/ste ratatoeskr/libs/kses.php -ratatoeskr/libs/jquery.min.js ratatoeskr/config.php .php_cs.cache ratatoeskr/vendor/ diff --git a/INSTALL.md b/INSTALL.md index e9be995..06162fe 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -26,12 +26,6 @@ You need these libraries to run Ratatöskr (it is probably already bundled with kses can be found at -2. jQuery - - Place jquery.min.js into this folder. - - jQuery can be found at - Step 3: Copy files to your Webspace ----------------------------------- diff --git a/build.sh b/build.sh index 7e3389d..8efe267 100755 --- a/build.sh +++ b/build.sh @@ -24,8 +24,6 @@ install_dependencies() { rm -rf kses-* rm kses.zip - wget http://code.jquery.com/jquery.min.js - cd ../.. } diff --git a/composer.json b/composer.json index fed18c1..0e22b52 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,8 @@ "require": { "php": ">=7.3", "r7r/ste": "^2.0.1", - "michelf/php-markdown": "^1.9" + "michelf/php-markdown": "^1.9", + "components/jquery": "^3.5" }, "config": { "vendor-dir": "ratatoeskr/vendor" diff --git a/composer.lock b/composer.lock index 7e40506..ca731cc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,50 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b24fa722b1b134feabc31603beda3933", + "content-hash": "9cb5c30495a0e70e4fc6c1368f601408", "packages": [ + { + "name": "components/jquery", + "version": "3.5.1", + "source": { + "type": "git", + "url": "https://github.com/components/jquery.git", + "reference": "b33e8f0f9a1cb2ae390cf05d766a900b53d2125b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/components/jquery/zipball/b33e8f0f9a1cb2ae390cf05d766a900b53d2125b", + "reference": "b33e8f0f9a1cb2ae390cf05d766a900b53d2125b", + "shasum": "" + }, + "type": "component", + "extra": { + "component": { + "scripts": [ + "jquery.js" + ], + "files": [ + "jquery.min.js", + "jquery.min.map", + "jquery.slim.js", + "jquery.slim.min.js", + "jquery.slim.min.map" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "JS Foundation and other contributors" + } + ], + "description": "jQuery JavaScript Library", + "homepage": "http://jquery.com", + "time": "2020-05-05T13:21:02+00:00" + }, { "name": "michelf/php-markdown", "version": "1.9.0", diff --git a/ratatoeskr/js/backend.js b/ratatoeskr/js/backend.js index 8b60c2d..cb276b1 100644 --- a/ratatoeskr/js/backend.js +++ b/ratatoeskr/js/backend.js @@ -1,16 +1,11 @@ -$(function() -{ - $("div.articleeditor-metabar-element h2").addClass("metabar_element_expanded").click(function() - { - self = $(this); - if(self.hasClass("metabar_element_expanded")) - { +$(function() { + $("div.articleeditor-metabar-element h2").addClass("metabar_element_expanded").on("click", function() { + var self = $(this); + if (self.hasClass("metabar_element_expanded")) { self.removeClass("metabar_element_expanded"); self.addClass("metabar_element_collapsed"); $("div.articleeditor-metabar-element-content", self.parent()).hide("fast"); - } - else - { + } else { self.removeClass("metabar_element_collapsed"); self.addClass("metabar_element_expanded"); $("div.articleeditor-metabar-element-content", self.parent()).show("fast"); diff --git a/ratatoeskr/libs/INFO b/ratatoeskr/libs/INFO index f1ef415..e821828 100644 --- a/ratatoeskr/libs/INFO +++ b/ratatoeskr/libs/INFO @@ -5,9 +5,3 @@ This directory will hold some libraries Ratatöskr needs. Place "kses.php" from the archive directly into this directory. kses can be found at - -2. jQuery - - Place jquery.min.js into this folder. - - jQuery can be found at \ No newline at end of file diff --git a/ratatoeskr/templates/src/systemtemplates/master.html b/ratatoeskr/templates/src/systemtemplates/master.html index aa2bf4e..3cf3b73 100755 --- a/ratatoeskr/templates/src/systemtemplates/master.html +++ b/ratatoeskr/templates/src/systemtemplates/master.html @@ -32,7 +32,7 @@ <ste:get_translation for="section_$section" />::<ste:escape>$pagetitle</ste:escape> - Ratatöskr - + layout.css -- cgit v1.2.3-70-g09d2