Skip to content

Commit

Permalink
v1.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
optipic-io committed May 5, 2021
1 parent 0cd9080 commit 2c35271
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion optipic/core/components/optipic/ImgUrlConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ImgUrlConverter {
/**
* Library version number
*/
const VERSION = '1.14';
const VERSION = '1.15';

/**
* ID of your site on CDN OptiPic.io service
Expand Down Expand Up @@ -448,6 +448,9 @@ public static function getUrlFromRelative($relativeUrl, $baseUrl=false) {
*/
public static function getBaseDirOfUrl($url) {
$urlParsed = parse_url($url);
if(empty($urlParsed['path'])) {
return '/';
}
$urlPath = $urlParsed['path'];
$pathinfo = pathinfo($urlPath);
if(!empty($pathinfo['extension'])) {
Expand Down
3 changes: 1 addition & 2 deletions optipic/core/components/optipic/plugins/optipic.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
$settings = $optipic->getSettings();

if ($currentHost) {
$srcJs = 'https://optipic.io/api/cp/stat?domain='.$currentHost.'&sid='.$settings['site_id'].'&cms=modx&stype=cdn&append_to=%23modx-panel-element-properties&version=1.14.0';
/*$modx->regClientStartupHTMLBlock('<script src="https://optipic.io/api/cp/stat?domain='.$currentHost.'&sid='.$settings['site_id'].'&cms=modx&stype=cdn&append_to=%23modx-header&version=1.14.0"></script>');*/
$srcJs = 'https://optipic.io/api/cp/stat?domain='.$currentHost.'&sid='.$settings['site_id'].'&cms=modx&stype=cdn&append_to=%23modx-panel-element-properties&version=1.15.0';
$modx->regClientStartupHTMLBlock('<script>
window.setTimeout(function() {
var s = document.createElement("script");
Expand Down
2 changes: 1 addition & 1 deletion optipic/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

$modx->loadClass('transport.modPackageBuilder','',false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage('optipic','1.14.0');
$builder->createPackage('optipic','1.15.0');
$builder->registerNamespace('optipic',false,true,'{core_path}components/optipic/');

$plugin = $modx->newObject('modPlugin');
Expand Down

0 comments on commit 2c35271

Please sign in to comment.