Skip to content

Commit 5941a99

Browse files
committed
Add the WebPG userdocs to the option pages
1 parent cc4f218 commit 5941a99

File tree

6 files changed

+177
-2
lines changed

6 files changed

+177
-2
lines changed

extension/about.html

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
<button id="genkeybutton"></button>
9090
<button id="optionsbutton"></button>
9191
<button id="aboutbutton"></button>
92+
<button id="docsbutton"></button>
9293
</span>
9394
<span class="webpg-info-version"><span id="webpg-info-version-string"></span>
9495
<br/>

extension/buttonbar.js

+20-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ webpg.jq(function() {
77
var _ = webpg.utils.i18n.gettext;
88
var href = window.location.href;
99
var page = (href.indexOf('key_manager.html') > 0) ? 'keymanager' :
10-
(href.indexOf('options.html') > 0) ? 'options' : 'about';
10+
(href.indexOf('options.html') > 0) ? 'options' :
11+
(href.indexOf('about.html') > 0) ? 'about' :
12+
(href.indexOf('userdocs.html') > 0) ? 'docs' : '_unknown';
1113

1214
webpg.jq('#genkeybutton')
1315
.button({
@@ -254,7 +256,19 @@ webpg.jq(function() {
254256
.click(function(e) {
255257
window.location = webpg.utils.resourcePath + "about.html?auto_init=true";
256258
webpg.jq(this).blur();
257-
}).val(_("About WebPG"));
259+
});
260+
261+
webpg.jq('#docsbutton')
262+
.button({
263+
'icons': {
264+
'primary':'ui-icon-help'
265+
},
266+
})
267+
.val(_("User Guide"))
268+
.click(function(e) {
269+
window.location = webpg.utils.resourcePath + "userdocs.html";
270+
webpg.jq(this).blur();
271+
});
258272

259273
webpg.jq("#webpg-buttonbar")
260274
.mouseleave(
@@ -274,5 +288,9 @@ webpg.jq(function() {
274288
.css({'padding-right': '6px'});
275289
}
276290
);
291+
292+
// Hide the currently active page-button
293+
webpg.jq("#" + page + "button")
294+
.hide();
277295
});
278296
/* ]]> */

extension/key_manager.html

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<button id="genkeybutton"></button>
3434
<button id="optionsbutton"></button>
3535
<button id="aboutbutton"></button>
36+
<button id="docsbutton"></button>
3637
</span>
3738
<span class="webpg-info-version"><span id="webpg-info-version-string"></span>
3839
</ul>

extension/options.html

+1
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@
211211
<button id="genkeybutton"></button>
212212
<button id="optionsbutton"></button>
213213
<button id="aboutbutton"></button>
214+
<button id="docsbutton"></button>
214215
</span>
215216
<span class="webpg-info-version" id="webpg-info-version-string"></span>
216217
</div>

extension/userdocs.html

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
<html>
2+
<head>
3+
<title>WebPG User Documentation/Guides</title>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5+
<link type="text/css" href="resources/jquery/css/dot-luv/jquery-ui-1.10.3.custom.css" rel="stylesheet"/>
6+
<script type="text/javascript" src="resources/jquery/js/jquery-1.10.2.min.js"></script>
7+
<script type="text/javascript" src="resources/jquery/js/jquery-ui-1.10.3.custom.min.js"></script>
8+
<script type="text/javascript" src="constants.js"></script>
9+
<script type="text/javascript" src="utils.js"></script>
10+
<script type="text/javascript" src="preferences.js"></script>
11+
<script type="text/javascript" src="userdocs.js"></script>
12+
<script type="text/javascript" src="buttonbar.js"></script>
13+
<style>
14+
body{
15+
font:62.5% "Trebuchet MS", sans-serif;
16+
background-color:#000;
17+
text-shadow:#000 1px 1px 1px;
18+
margin:0;
19+
padding:0;
20+
}
21+
#webpg-buttonbar {
22+
z-index:9999;
23+
margin: 0 0 0 30px;
24+
padding: 0 2px 0 4px;
25+
display:inline-block;
26+
background-color:transparent;
27+
border:none;
28+
background-image:none;
29+
position:absolute;
30+
top:6px;
31+
left:350px;
32+
}
33+
#webpg-buttonbar button {
34+
padding-right:4px;
35+
}
36+
/* support: IE7 */
37+
*+html #webpg-buttonbar {
38+
display: inline;
39+
}
40+
#webpg-buttonbar button>.ui-button-text {
41+
height:14px;
42+
margin-right:-2px;
43+
padding-right:0;
44+
}
45+
.webpg-info-box {
46+
margin:auto;
47+
padding:12px 0 0 0;
48+
border-radius:4px;
49+
-moz-border-radius:4px;
50+
-webkit-border-radius:4px;
51+
color:#fff;
52+
}
53+
.webpg-info-img {
54+
float:left;
55+
top:-1px;
56+
position:relative;
57+
margin:0 8px 0px 4px;
58+
padding-right:4px;
59+
border-radius:4px;
60+
-moz-border-radius:4px;
61+
-webkit-border-radius:4px;
62+
height:30px;
63+
}
64+
.webpg-info-title {
65+
font-size:22px;
66+
}
67+
.webpg-info-version {
68+
font-size:12px;
69+
padding:6px 10px 0 0;
70+
float:right;
71+
margin-left:2px;
72+
}
73+
.webpg-info-text {
74+
}
75+
.webpg-title {
76+
font-weight: bold;
77+
}
78+
.info-block {
79+
margin-left: 16px;
80+
}
81+
iframe {
82+
border:none;
83+
height:87%;
84+
width:100%;
85+
border-radius:4px;
86+
-moz-border-radius:4px;
87+
-webkit-border-radius:4px;
88+
}
89+
</style>
90+
</head>
91+
<body>
92+
<div class="ui-tabs ui-widget ui-widget-content ui-corner-all">
93+
<div class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
94+
<img class="webpg-info-img" src="skin/images/webpg-64.png"/>
95+
<span class="webpg-info-title"></span>
96+
<span id="webpg-buttonbar" class="webpg-buttonbar ui-widget-header ui-corner-all">
97+
<button id="genkeybutton"></button>
98+
<button id="optionsbutton"></button>
99+
<button id="aboutbutton"></button>
100+
<button id="docsbutton"></button>
101+
</span>
102+
<span class="webpg-info-version"><span id="webpg-info-version-string"></span></span>
103+
<br/>
104+
</div>
105+
<div class="webpg-info-box">
106+
<iframe src="https://webpg.org/docs/webpg-userdocs/index.html"></iframe>
107+
</div>
108+
</div>
109+
</body>
110+
</html>

extension/userdocs.js

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/* <![CDATA[ */
2+
if (typeof(webpg)=='undefined') { webpg = {}; }
3+
// Enforce jQuery.noConflict if not already performed
4+
if (typeof(jQuery)!='undefined') webpg.jq = jQuery.noConflict(true);
5+
6+
/*
7+
Class: webpg.userdocs
8+
Proivides the class to handle the "userdocs" page
9+
*/
10+
webpg.userdocs = {
11+
/*
12+
Function: init
13+
Sets up the page to reflect the correct host application
14+
*/
15+
init: function(browserWindow) {
16+
var _ = webpg.utils.i18n.gettext;
17+
document.title = _("WebPG User Documentation/Guides");
18+
19+
webpg.utils.extension.version(function(version) {
20+
webpg.jq("#webpg-info-version-string").text(
21+
_("Version") + ": " + webpg.utils.escape(version)
22+
);
23+
});
24+
25+
webpg.jq(".webpg-info-title").text(_("WebPG Documentation"));
26+
27+
}
28+
};
29+
30+
webpg.jq(function() {
31+
var browserWindow = null;
32+
if (webpg.utils.detectedBrowser['vendor'] == 'mozilla') {
33+
browserWindow = webpg.utils.mozilla.getChromeWindow();
34+
if (browserWindow.webpg.plugin === undefined) {
35+
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
36+
.getService(Components.interfaces.nsIWindowMediator);
37+
var winType = (webpg.utils.detectedBrowser['product'] == "thunderbird") ?
38+
"mail:3pane" : "navigator:browser";
39+
browserWindow = wm.getMostRecentWindow(winType);
40+
}
41+
}
42+
webpg.userdocs.init(browserWindow);
43+
});
44+
/* ]]> */

0 commit comments

Comments
 (0)