Skip to content

Commit

Permalink
Merge pull request #9 from bootscore/Update-classes-to-Bootstrap-5.3
Browse files Browse the repository at this point in the history
Create composer.json
  • Loading branch information
crftwrk authored Jun 9, 2023
2 parents 5fff8a5 + cb7b22e commit f80e1b3
Show file tree
Hide file tree
Showing 114 changed files with 11,541 additions and 15 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 bootScore
Copyright (c) 2022 - 2023 bootScore

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,5 @@ Make sure that the links to your legal note and privacy policy are not covered b
## License & Credits

- cookieconsent script by Orest Bida, MIT License https://github.com/orestbida/cookieconsent/blob/master/LICENSE
- Plugin Update Checker by YahnisElsts, MIT License <a href="https://github.com/YahnisElsts/plugin-update-checker/blob/master/license.txt">https://github.com/YahnisElsts/plugin-update-checker/blob/master/license.txt
- bS Cookie Settings, MIT License https://github.com/bootscore/bs-cookie-settings/blob/main/LICENSE
27 changes: 27 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "bootscore/bs-cookie-settings",
"description": "Adds Bootstrap to Contact Form 7",
"type": "wordpress-plugin",
"license": "MIT",
"authors": [
{
"name": "The bootScore Authors"
}
],
"readme": "README.md",
"homepage": "https://bootscore.me/documentation/plugin/bs-cookie-settings/",
"support": {
"issues": "https://github.com/bootscore/bs-cookie-settings/issues",
"forum": "https://github.com/bootscore/bootscore/discussions",
"source": "https://github.com/bootscore/bs-cookie-settings",
"docs": "https://bootscore.me/documentation/plugin/bs-cookie-settings/"
},
"minimum-stability": "stable",
"keywords": [
"wordpress",
"plugin",
"bootscore",
"bootstrap",
"contact form 7"
]
}
2 changes: 1 addition & 1 deletion css/cookie-settings.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/cookie-settings.min.js

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions main.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*Plugin Name: bS Cookie Settings
Plugin URI: https://bootscore.me/plugins/bs-cookie-settings/
Description: This plugin adds a cookie modal to bootScore
Version: 5.2.1.0
Version: 5.3.0
Author: bootScore
Author URI: https://bootscore.me
License: MIT License
Expand All @@ -19,4 +19,13 @@ function bs_cookie_settings() {

}

add_action('wp_enqueue_scripts','bs_cookie_settings');
add_action('wp_enqueue_scripts','bs_cookie_settings');


// Update checker
require 'update/update-checker.php';
$myUpdateChecker = Puc_v4_Factory::buildUpdateChecker(
'https://bootscore.me/wp-content/plugins/bs-cookie-settings-main/update/plugin.json',
__FILE__, //Full path to the main plugin file or functions.php.
'bs-cookie-settings-main'
);
13 changes: 10 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

=== bS Cookie Settings ===

Contributors: Bastian Kreiter
Contributors: The bootScore contributors

Requires at least: 4.5
Tested up to: 6.0.1
Tested up to: 6.2.2
Requires PHP: 5.6
Stable tag: 5.2.1.0
Stable tag: 5.3.0
License: MIT License
License URI: https://github.com/bootscore/bs-cookie-settings/blob/main/LICENSE

Expand All @@ -31,6 +31,13 @@ Read documentation https://bootscore.me/documentation/plugin/bs-cookie-settings/

== Changelog ==

= 5.3.0 - June 09 2023 =

* [FEATURE] Add composer.json
* [FEATURE] Add plugin update checker
* [IMPROVEMENT] Change btn-outline-secondary to btn-outline-primary
* [UPDATE] Bootstrap 5.3 color classes

= 5.2.1.0 - August 24 2022 =

* Refactored modal
Expand Down
4 changes: 2 additions & 2 deletions src/css/cookie-settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ button.b-tl.exp[aria-expanded="true"]::before {

.desc.b-acc {
border-top: 2px solid;
border-color: var(--bs-white);
border-color: var(--bs-modal-bg);
}

#s-bl tr {
padding: 1rem;
border-top: 2px solid;
border-color: var(--bs-white);
border-color: var(--bs-modal-bg);
}

#s-bl td,
Expand Down
10 changes: 5 additions & 5 deletions src/js/cookie-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@
//var overlay = _createNode('div');

consent_modal.id = 'bs-cookie-bar';
consent_modal.className = "py-4 py-md-5 bg-light fixed-bottom d-block";
consent_modal.className = "py-4 py-md-5 bg-body-tertiary fixed-bottom d-block";
consent_modal_container.className = "container";
consent_modal_inner.id = 'c-inr';
consent_modal_inner.className = "row";
Expand Down Expand Up @@ -410,7 +410,7 @@

var consent_secondary_btn = _createNode('button');
consent_secondary_btn.id = 'c-s-bn';
consent_secondary_btn.className = "c-bn c_link btn btn-outline-secondary";
consent_secondary_btn.className = "c-bn c_link btn btn-outline-primary";
consent_secondary_btn[innerText] = conf_params.languages[lang]['consent_modal']['secondary_btn']['text'];

if(secondary_btn_data['role'] === 'accept_necessary'){
Expand Down Expand Up @@ -640,7 +640,7 @@
_addClass(block_title_container, 'position-relative');
_addClass(block_section, 'b-ex');
_addClass(block_section, 'p-0');
_addClass(block_section, 'bg-light');
_addClass(block_section, 'bg-body-tertiary');
_addClass(block_section, 'rounded');
//_addClass(block_section, 'border-0');
_addClass(block_section, 'mb-2');
Expand Down Expand Up @@ -773,7 +773,7 @@
settings_buttons.className = 'modal-footer d-grid gap-1 d-sm-flex';
settings_save_btn.id = 's-sv-bn';
settings_accept_all_btn.id = 's-all-bn';
settings_save_btn.className ='c-bn btn btn-outline-secondary ms-sm-auto';
settings_save_btn.className ='c-bn btn btn-outline-primary ms-sm-auto';
settings_accept_all_btn.className ='c-bn btn btn-primary';
settings_save_btn.insertAdjacentHTML('beforeend', conf_params.languages[_config.current_lang]['settings_modal']['save_settings_btn']);
settings_accept_all_btn.insertAdjacentHTML('beforeend', conf_params.languages[_config.current_lang]['settings_modal']['accept_all_btn']);
Expand All @@ -792,7 +792,7 @@

var reject_all_btn = _createNode('button');
reject_all_btn.id = 's-rall-bn';
reject_all_btn.className = 'c-bn btn btn-outline-secondary';
reject_all_btn.className = 'c-bn btn btn-outline-primary';
reject_all_btn.insertAdjacentHTML('beforeend', reject_all_btn_text);
reject_all_btn.setAttribute('data-bs-dismiss', 'modal');

Expand Down
15 changes: 15 additions & 0 deletions update/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[*]
charset=utf-8
end_of_line=lf
insert_final_newline=false
indent_style=tab
tab_width=4

[{phpunit.xml.dist,*.jhm,*.xslt,*.xul,*.rng,*.xsl,*.xsd,*.ant,*.tld,*.fxml,*.jrxml,*.xml,*.jnlp,*.wsdl}]
indent_style=space
indent_size=4

[*.svg]
indent_style=space
indent_size=4

6 changes: 6 additions & 0 deletions update/Puc/v4/Factory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
if ( !class_exists('Puc_v4_Factory', false) ):

class Puc_v4_Factory extends Puc_v4p11_Factory { }

endif;
63 changes: 63 additions & 0 deletions update/Puc/v4p11/Autoloader.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php

if ( !class_exists('Puc_v4p11_Autoloader', false) ):

class Puc_v4p11_Autoloader {
private $prefix = '';
private $rootDir = '';
private $libraryDir = '';

private $staticMap;

public function __construct() {
$this->rootDir = dirname(__FILE__) . '/';
$nameParts = explode('_', __CLASS__, 3);
$this->prefix = $nameParts[0] . '_' . $nameParts[1] . '_';

$this->libraryDir = $this->rootDir . '../..';
if ( !self::isPhar() ) {
$this->libraryDir = realpath($this->libraryDir);
}
$this->libraryDir = $this->libraryDir . '/';

$this->staticMap = array(
'PucReadmeParser' => 'vendor/PucReadmeParser.php',
'Parsedown' => 'vendor/Parsedown.php',
'Puc_v4_Factory' => 'Puc/v4/Factory.php',
);

spl_autoload_register(array($this, 'autoload'));
}

/**
* Determine if this file is running as part of a Phar archive.
*
* @return bool
*/
private static function isPhar() {
//Check if the current file path starts with "phar://".
static $pharProtocol = 'phar://';
return (substr(__FILE__, 0, strlen($pharProtocol)) === $pharProtocol);
}

public function autoload($className) {
if ( isset($this->staticMap[$className]) && file_exists($this->libraryDir . $this->staticMap[$className]) ) {
/** @noinspection PhpIncludeInspection */
include ($this->libraryDir . $this->staticMap[$className]);
return;
}

if (strpos($className, $this->prefix) === 0) {
$path = substr($className, strlen($this->prefix));
$path = str_replace('_', '/', $path);
$path = $this->rootDir . $path . '.php';

if (file_exists($path)) {
/** @noinspection PhpIncludeInspection */
include $path;
}
}
}
}

endif;
Loading

0 comments on commit f80e1b3

Please sign in to comment.