Skip to content

Commit f8c68a2

Browse files
committed
Added option button to jump to plugin options
1 parent 2d7a8c7 commit f8c68a2

File tree

9 files changed

+50
-10
lines changed

9 files changed

+50
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### v2.0.2
2+
- Added option button to jump directly to plugin options (thanks to Aleksander Machniak)
3+
14
### v2.0.1
25
- Remove ToC button in edit mode
36
- Fix for creating new notes s

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"homepage": "https://github.com/Offerel/roundcube_primitivenotes",
66
"type": "roundcube-plugin",
77
"license": "AGPL-3.0",
8-
"version": "2.0.1",
8+
"version": "2.0.2",
99
"authors": [
1010
{
1111
"name": "Offerel",

js/primitivenotes.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Roundcube Notes Plugin
33
*
4-
* @version 2.0.1
4+
* @version 2.0.2
55
* @author Offerel
66
* @copyright Copyright (c) 2021, Offerel
77
* @license GNU General Public License, version 3
@@ -13,10 +13,16 @@ window.rcmail && rcmail.addEventListener("init", function(a) {
1313
rcmail.register_command("sendnote", send_note, !0);
1414
rcmail.register_command("addnote", add_note, !0);
1515
rcmail.register_command("mdnote", new_note, !0);
16-
rcmail.register_command("txtnote", new_note, !0);
17-
document.getElementById('upl').addEventListener('change', sform, false );
16+
rcmail.register_command("txtnote", new_note, !0);
17+
rcmail.register_command("pnoptions", pnoptions, !0);
18+
if(document.getElementById('upl')) document.getElementById('upl').addEventListener('change', sform, false );
19+
if(window.location.hash == '#pnotes')rcmail.sections_list.select_row('primitivenotes');
1820
});
1921

22+
function pnoptions() {
23+
location.href = window.location.origin + window.location.pathname + '?_task=settings&_action=preferences#pnotes';
24+
}
25+
2026
function add_note() {
2127
document.getElementById("upl").click()
2228
}

js/primitivenotes.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.

notes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Roundcube Notes Plugin
44
*
5-
* @version 2.0.1
5+
* @version 2.0.2
66
* @author Offerel
77
* @copyright Copyright (c) 2021, Offerel
88
* @license GNU General Public License, version 3

primitivenotes.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Roundcube Notes Plugin
44
*
5-
* @version 2.0.1
5+
* @version 2.0.2
66
* @author Offerel
77
* @copyright Copyright (c) 2021, Offerel
88
* @license GNU General Public License, version 3
@@ -15,7 +15,8 @@ public function init() {
1515
$rcmail = rcmail::get_instance();
1616
$this->load_config();
1717
$this->add_texts('localization/', true);
18-
$this->include_stylesheet($this->local_skin_path() . '/plugin.css');
18+
$this->include_stylesheet($this->local_skin_path() . '/plugin.min.css');
19+
$this->include_script('js/primitivenotes.min.js');
1920
$this->register_task('notes');
2021

2122
$this->add_button(array(

skins/elastic/plugin.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,24 @@
99
display: block;
1010
text-align: center;
1111
}
12+
#pnoptions::before {
13+
content: "\f1de";
14+
display: block;
15+
text-align: center;
16+
}
17+
#pnsettings {
18+
position: absolute;
19+
z-index: 100;
20+
width: 400px;
21+
height: auto;
22+
background: #fff;
23+
box-shadow: 3px 3px 5px 0 rgba(50,50,50,.75);
24+
padding: 10px;
25+
border-radius: 5px;
26+
top: 50%;
27+
left: 50%;
28+
transform: translate(-50%,-50%);
29+
}
1230
#notestoolbar a {
1331
font-family: "Icons";
1432
font-size: 1.35rem;
@@ -110,4 +128,9 @@
110128
}
111129
.listing.iconized tr.primitivenotes > td.section::before {
112130
content: "\f249";
131+
}
132+
.pnlisth {
133+
width: 395px;
134+
float: left;
135+
border-right: 1px solid #d4dbde;
113136
}

skins/elastic/plugin.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

skins/elastic/templates/template.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
<roundcube:include file="includes/menu.html" />
33
<h1 class="voice"><roundcube:label name="primitivenotes.notes" /></h1>
44
<div id="content" class="content selected" role="main">
5+
<div class="header pnlisth">
6+
<ul class="menu toolbar listing iconized">
7+
<li role="menuitem">
8+
<roundcube:button innerclass="inner" id="pnoptions" command="pnoptions" type="link" class="button pnoptions" label="options" title="options" />
9+
</li>
10+
</ul>
11+
</div>
512
<div class="header">
613
<ul class="menu toolbar listing iconized">
714
<li role="menuitem">

0 commit comments

Comments
 (0)