Skip to content

Commit 96f6f66

Browse files
committed
Fix for unvisible settings
1 parent aad95d8 commit 96f6f66

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"role": "Developer"
1313
}
1414
],
15-
"version": "2.2.1",
15+
"version": "2.2.2",
1616
"repositories": [
1717
{
1818
"type": "composer",

syncmarks.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Roundcube Bookmarks Plugin
33
*
4-
* @version 2.2.1
4+
* @version 2.2.2
55
* @author Offerel
66
* @copyright Copyright (c) 2020, Offerel
77
* @license GNU General Public License, version 3
@@ -27,6 +27,7 @@ function bookmarks_cmd() {
2727

2828
function add_url(format) {
2929
var t = encodeURIComponent(prompt(rcmail.gettext("bookmarks_url", "syncmarks")));
30+
console.log(format);
3031
0 < t.length && (t.startsWith("http") || t.startsWith("ftp")) && rcmail.http_post("syncmarks/add_url", "_url=" + t + "&_format=" + format)
3132
}
3233

@@ -42,6 +43,7 @@ function get_bookmarks(response) {
4243
}
4344

4445
function en_noti() {
46+
console.log("test");
4547
if (!("Notification" in window)) {
4648
alert("This browser does not support desktop notification");
4749
}

syncmarks.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

syncmarks.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22
/**
33
* Roundcube Bookmarks Plugin
44
*
5-
* @version 2.2.1
5+
* @version 2.2.2
66
* @author Offerel
77
* @copyright Copyright (c) 2020, Offerel
88
* @license GNU General Public License, version 3
99
*/
1010
class syncmarks extends rcube_plugin
11-
{
12-
public $task = '?(?!login|logout).*';
11+
{
12+
public $task = '?(?!login).*';
1313

1414
public function init() {
1515
$rcmail = rcmail::get_instance();
16+
$this->load_config();
1617
$this->add_texts('localization/', true);
1718
$this->register_task('syncmarks');
1819
$this->include_stylesheet($this->local_skin_path().'/plugin.css');
@@ -54,13 +55,17 @@ function bms_preferences_list($p) {
5455
if ($p['section'] != 'syncmarks') {
5556
return $p;
5657
}
58+
5759
$rcmail = rcmail::get_instance();
5860
$p['blocks']['main']['name']=$this->gettext('mainoptions');
5961
$field_id='bms_notifications';
6062
$input = new html_checkbox(array( 'name' => 'bms_notifications',
6163
'onchange' => 'en_noti()',
6264
'id' => 'bms_notifications',
6365
'value' => 1));
66+
67+
$p['blocks']['main']['options']['bms_noti'] = array('title' => html::label($field_id, $this->gettext('bookmarks_not')),
68+
'content' => $input->show(intval($rcmail->config->get('bms_notifications'))));
6469
return $p;
6570
}
6671

@@ -80,8 +85,8 @@ function unset_cookie() {
8085

8186
function get_notifications() {
8287
$rcmail = rcmail::get_instance();
88+
$this->load_config();
8389
if($_COOKIE['sycmarks_n'] != '1' && $rcmail->config->get('bms_notifications') == "1") {
84-
//$this->load_config();
8590
$path = $rcmail->config->get('bookmarks_path', false);
8691
$filename = $rcmail->config->get('bookmarks_filename', false);
8792

@@ -288,6 +293,7 @@ function get_title($url) {
288293

289294
function add_url() {
290295
$rcmail = rcmail::get_instance();
296+
$this->load_config();
291297
$new_url = rcube_utils::get_input_value('_url', rcube_utils::INPUT_POST);
292298
$format = rcube_utils::get_input_value('_format', rcube_utils::INPUT_POST);
293299
$path = $rcmail->config->get('bookmarks_path', false);
@@ -387,11 +393,11 @@ function add_url() {
387393

388394
function add_bookmarks() {
389395
$rcmail = rcmail::get_instance();
390-
$this->include_script('syncmarks.js');
391396
$exctasks = array("login","logout");
392397

393398
if(!in_array($rcmail->task,$exctasks)) {
394399
$this->load_config();
400+
$this->include_script('syncmarks.js');
395401
$filename = $rcmail->config->get('bookmarks_filename', false);
396402
$ext = pathinfo($filename, PATHINFO_EXTENSION);
397403
$rcmail->output->add_footer("<div id=\"bookmarkpane\"></div>");
@@ -450,7 +456,6 @@ function makeHTMLTree($arr) {
450456
}
451457

452458
function parseHTMLMarks($bookmarks, $bdate, $button, $format='html') {
453-
$rcmail = rcmail::get_instance();
454459
$bookmarks = preg_replace("/<DD>[^>]*?</i", "<", $bookmarks);
455460
$bookmarks = preg_replace("/<DT><H3 [^>]*? PERSONAL_TOOLBAR_FOLDER=\"true\">(.+?)<\/H3>/is", "</ol><H1>$1</H1>", $bookmarks);
456461
$bookmarks = preg_replace("/<DT><H3 [^>]*? UNFILED_BOOKMARKS_FOLDER=\"true\">(.+?)<\/H3>/is", "<H1>$1</H1>", $bookmarks);

0 commit comments

Comments
 (0)