diff --git a/src/bb-library/Box/Update.php b/src/bb-library/Box/Update.php index 0c6fac346..4fc188ebd 100644 --- a/src/bb-library/Box/Update.php +++ b/src/bb-library/Box/Update.php @@ -59,7 +59,8 @@ class Box_Update public function getLatestReleaseNotes() { if($this->getUpdateBranch() === "preview"){ - return "Release notes are not available for preview builds. You can check the latest changes on our [Github](https://github.com/FOSSBilling/FOSSBilling/commits/main)"; + $compareLink = 'https://github.com/FOSSBilling/FOSSBilling/compare/' . $this->getLatestVersion() . '...main'; + return "Release notes are not available for preview builds. You can check the latest changes on our [Github]($compareLink)"; } $response = $this->_getLatestVersionInfo(); diff --git a/src/bb-modules/System/Service.php b/src/bb-modules/System/Service.php index 12e1a6cfc..36fb24ca0 100644 --- a/src/bb-modules/System/Service.php +++ b/src/bb-modules/System/Service.php @@ -247,14 +247,14 @@ class Service $disableAutoCron = $this->di['config']['disable_auto_cron'] ?? false; if (false === $runFromTest && false === $disableAutoCron) { if (!$last_exec) { - $msgs['info'][] = 'Cron was never executed. FOSSBilling will automatically execute cron when you access the admin panel, but you should make sure you have setup cron the job.'; + $msgs['info'][] = 'Cron was never executed. FOSSBilling will automatically execute cron when you access the admin panel, but you should make sure you have setup the cron job.'; $cronService = $this->di['mod_service']('cron'); - $cronService->runCrons($interval); + $cronService->runCrons(); } else { $minSinceLastExec = (time() - strtotime($last_exec)) / 60; if ($minSinceLastExec >= 15) { $minSinceLastExec = round($minSinceLastExec, 2); - $msgs['info'][] = 'Cron hasn\'t been executed in ' . $minSinceLastExec . ' minutes. FOSSBilling will automatically execute cron when you access the admin panel, but you should make sure you have setup cron the job.'; + $msgs['info'][] = 'Cron hasn\'t been executed in ' . $minSinceLastExec . ' minutes. FOSSBilling will automatically execute cron when you access the admin panel, but you should make sure you have setup the cron job.'; $cronService = $this->di['mod_service']('cron'); $cronService->runCrons(); error_log("Cron hasn't been run in $minSinceLastExec minutes. Manually executing."); diff --git a/src/bb-modules/Wysiwyg/assets/markitup/sets/default/set.js b/src/bb-modules/Wysiwyg/assets/markitup/sets/default/set.js index b7fdf8182..fd3b3efce 100644 --- a/src/bb-modules/Wysiwyg/assets/markitup/sets/default/set.js +++ b/src/bb-modules/Wysiwyg/assets/markitup/sets/default/set.js @@ -9,22 +9,38 @@ // ---------------------------------------------------------------------------- // Basic set. Feel free to add more tags // ---------------------------------------------------------------------------- -var mySettings = { - onShiftEnter: {keepDefault:false, replaceWith:'
\n'}, - onCtrlEnter: {keepDefault:false, openWith:'\n

', closeWith:'

'}, - onTab: {keepDefault:false, replaceWith:' '}, - markupSet: [ - {name:'Bold', key:'B', openWith:'(!(|!|)!)', closeWith:'(!(|!|)!)' }, - {name:'Italic', key:'I', openWith:'(!(|!|)!)', closeWith:'(!(|!|)!)' }, - {name:'Stroke through', key:'S', openWith:'', closeWith:'' }, - {separator:'---------------' }, - {name:'Bulleted List', openWith:'
  • ', closeWith:'
  • ', multiline:true, openBlockWith:''}, - {name:'Numeric List', openWith:'
  • ', closeWith:'
  • ', multiline:true, openBlockWith:'
      \n', closeBlockWith:'\n
    '}, - {separator:'---------------' }, - {name:'Picture', key:'P', replaceWith:'[![Alternative text]!]' }, - {name:'Link', key:'L', openWith:'', closeWith:'', placeHolder:'Your text to link...' }, - {separator:'---------------' }, - {name:'Clean', className:'clean', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } }, - {name:'Preview', className:'preview', call:'preview'} - ] +function returnSettings(assetPath){ + var mySettings = { + previewParser: function(content) { + var r = ''; + $.ajax({ + url: $('meta[property="bb:client_area"]').attr("content") + 'preview/markdown', + data: {content: content}, + type: "POST", + success: function(data){ r = data; }, + async: false + }); + return r; + }, + onShiftEnter: {keepDefault:false, openWith:'\n\n'}, + onTab: {keepDefault:false, replaceWith:' '}, + markupSet: [ + {name:'Bold', key:'B', openWith:'**', closeWith:'**'}, + {name:'Italic', key:'I', openWith:'_', closeWith:'_'}, + {name:'Stroke through', key:'S', openWith:'~~~', closeWith:'~~~' }, + {separator:'---------------' }, + {name:'Bulleted List', openWith:'- '}, + {name:'Numeric List', openWith:function(markItUp) { + return markItUp.line+'. '; + }}, + {separator:'---------------' }, + {name:'Picture', key:'P', replaceWith:'![[![Alternative text]!]]([![Url:!:http://]!])'}, + {name:'Link', key:'L', openWith:'[', closeWith:']([![Url:!:http://]!])', placeHolder:'Your text to link here...'}, + {separator:'---------------' }, + {name:'Clean', className:'clean', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } }, + {name:'Preview', className:'preview', call:'preview'} + ], + previewTemplatePath: assetPath + } + return mySettings; } diff --git a/src/bb-modules/Wysiwyg/assets/markitup/templates/preview.css b/src/bb-modules/Wysiwyg/assets/markitup/templates/preview.css deleted file mode 100644 index ad91a871c..000000000 --- a/src/bb-modules/Wysiwyg/assets/markitup/templates/preview.css +++ /dev/null @@ -1,5 +0,0 @@ -/* preview style examples */ -body { - background-color:#EFEFEF; - font:70% Verdana, Arial, Helvetica, sans-serif; -} \ No newline at end of file diff --git a/src/bb-modules/Wysiwyg/assets/markitup/templates/preview.html b/src/bb-modules/Wysiwyg/assets/markitup/templates/preview.html index b8b3702eb..7d840db4e 100644 --- a/src/bb-modules/Wysiwyg/assets/markitup/templates/preview.html +++ b/src/bb-modules/Wysiwyg/assets/markitup/templates/preview.html @@ -3,7 +3,13 @@ markItUp! preview template - + diff --git a/src/bb-modules/Wysiwyg/html_admin/mod_wysiwyg_js.html.twig b/src/bb-modules/Wysiwyg/html_admin/mod_wysiwyg_js.html.twig index 1ae9d1a51..9fae8747a 100644 --- a/src/bb-modules/Wysiwyg/html_admin/mod_wysiwyg_js.html.twig +++ b/src/bb-modules/Wysiwyg/html_admin/mod_wysiwyg_js.html.twig @@ -1,11 +1,12 @@ {% set bb_editor = admin.wysiwyg_editor %} {% if bb_editor == 'markitup' %} -{{ 'markitup/skins/boxbilling/style.css' | mod_asset_url('wysiwyg') | stylesheet_tag }} -{{ 'markitup/sets/markdown/style.css' | mod_asset_url('wysiwyg') | stylesheet_tag }} +{{ 'markitup/skins/simple/style.css' | mod_asset_url('wysiwyg') | stylesheet_tag }} +{{ 'markitup/sets/default/style.css' | mod_asset_url('wysiwyg') | stylesheet_tag }} {{ 'markitup/jquery.markitup.js' | mod_asset_url('wysiwyg') | script_tag }} -{{ 'markitup/sets/markdown/set.js' | mod_asset_url('wysiwyg') | script_tag }} +{{ 'markitup/sets/default/set.js' | mod_asset_url('wysiwyg') | script_tag }}