[Pkg-mozext-commits] [wot] 94/226: Added showing a message in RW
David Prévot
taffit at moszumanska.debian.org
Fri May 1 00:35:38 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository wot.
commit 0e65798e3ab4aa5b17da6512353caf4205c60817
Author: Sergey Andryukhin <sorgoz at yandex.com>
Date: Fri Aug 2 13:47:34 2013 +0300
Added showing a message in RW
---
content/overlay.xul | 4 ++--
content/ratingwindow.js | 61 +++++++++++++++++++++++++++++++++++++------------
content/rw/proxies.js | 7 ++++++
skin/ratingwindow.css | 8 +++----
skin/wot.css | 3 ++-
5 files changed, 62 insertions(+), 21 deletions(-)
diff --git a/content/overlay.xul b/content/overlay.xul
index 1a0a84b..071358f 100644
--- a/content/overlay.xul
+++ b/content/overlay.xul
@@ -69,10 +69,10 @@
<!-- Testimony window -->
<menupopup id="wot-popup" noautohide="true" position="after_start"
onpopupshowing="wot_rw.on_rw_open(event);"
- onpopuphiding="wot_rw.on_hide_popup();">
+ onpopuphiding="wot_rw.on_hide_popup();" showcaret="true">
<iframe id="wot-rwframe" src="chrome://wot/content/rw/ratingwindow.html" type="content-primary"
- transparent="false" showcaret="true" width="100%" height="418px"/>
+ transparent="false" showcaret="true" width="100%" height="414px"/>
</menupopup>
diff --git a/content/ratingwindow.js b/content/ratingwindow.js
index ab367cd..ee7c148 100644
--- a/content/ratingwindow.js
+++ b/content/ratingwindow.js
@@ -89,6 +89,33 @@ var wot_rw = {
}
},
+ update_messages: function () {
+ /* Sets message data into RW */
+ try {
+ var rw = this.get_rw_window();
+ if (!rw) return;
+
+ var msg_data = {
+ text: "",
+ id: null,
+ url: null,
+ status: null
+ };
+
+ if (wot_api_query.message.length != 0 && wot_api_query.message_type.length != 0) {
+ msg_data.text = wot_api_query.message;
+ msg_data.status = wot_api_query.message_type;
+ msg_data.id = wot_api_query.message_id;
+ msg_data.url = wot_api_query.message_url;
+ }
+
+ rw.wot_bg.wot.core.moz_set_usermessage(JSON.stringify(msg_data));
+
+ } catch (e) {
+ wdump("ERROR: wot_ratingwindow.update_messages(): Failed / " + e);
+ }
+ },
+
update: function () {
// Updates content of Rating Window. RW must be already initialized (locales, categories info, etc).
wdump("RW.update()");
@@ -137,6 +164,8 @@ var wot_rw = {
data.cached.value.cats = wot_categories.target_categories(target);
data.cached.value.blacklist = wot_categories.target_blacklists(target);
+ wot_rw.update_messages();
+
} else {
data = {
target: target,
@@ -224,28 +253,32 @@ var wot_rw = {
},
initialize: function (rw, rw_doc, rw_wot) {
+ try {
+ this.init_channel(this.CHAN_ELEM_ID, this.CHAN_EVENT_ID);
- this.init_channel(this.CHAN_ELEM_ID, this.CHAN_EVENT_ID);
+ var locale_strings = wot_util.get_all_strings();
+ rw.chrome.i18n.loadMessages(JSON.stringify(locale_strings)); // using JSON to push data to sandboxed content
- var locale_strings = wot_util.get_all_strings();
- rw.chrome.i18n.loadMessages(JSON.stringify(locale_strings)); // using JSON to push data to sandboxed content
+ // TODO: provide preferences to RW
+ wdump(JSON.stringify(this.get_preferences()));
- // TODO: provide preferences to RW
- wdump(JSON.stringify(this.get_preferences()));
+ var prefs = this.get_preferences();
+ this.push_preferences(rw, prefs);
- var prefs = this.get_preferences();
- this.push_preferences(rw, prefs);
+ // setup categories data in the RW
+ rw_wot.categories = wot_categories.categories;
+ rw_wot.grouping = wot_categories.grouping;
+ rw_wot.cgroups = wot_categories.cgroups;
- // setup categories data in the RW
- rw_wot.categories = wot_categories.categories;
- rw_wot.grouping = wot_categories.grouping;
- rw_wot.cgroups = wot_categories.cgroups;
+ // TODO: provide "level" (decrypted) value
- // TODO: provide "level" (decrypted) value
+ rw_wot.ratingwindow.onload(); // this runs only once in FF
- rw_wot.ratingwindow.onload(); // this runs only once in FF
+ this.is_inited = true;
- this.is_inited = true;
+ } catch (e) {
+
+ }
}
};
diff --git a/content/rw/proxies.js b/content/rw/proxies.js
index d4bd955..35396e3 100644
--- a/content/rw/proxies.js
+++ b/content/rw/proxies.js
@@ -67,6 +67,13 @@ var wot_bg = { // background page object
wot_bg.wot.core.moz_send("unseenmessage", null);
},
+ moz_set_usermessage: function (json_data) {
+ // Takes jsoned message to show it user in RW
+
+ var data = JSON.parse(json_data);
+ if (data && data.text) wot_bg.wot.core.usermessage = data;
+ },
+
moz_connect: function (element_id, event_id) {
// init communication channel's properties
wot_bg.wot.core._moz_element_id = element_id;
diff --git a/skin/ratingwindow.css b/skin/ratingwindow.css
index bf75662..52375ea 100644
--- a/skin/ratingwindow.css
+++ b/skin/ratingwindow.css
@@ -1184,7 +1184,7 @@ body {
content: "";
width: 100%;
margin-top: 0px;
- margin-left: -19px;
+ margin-left: -24px; /* Different in FF */
}
#wot-message-text {
@@ -1194,7 +1194,7 @@ body {
height: auto;
line-height: 13px;
overflow: hidden;
- padding: 8px 20px 8px;
+ padding: 8px 20px 2px;
text-align: center;
white-space: normal;
}
@@ -1251,7 +1251,7 @@ body {
#rate-buttons,
#ok-button {
position: absolute;
- bottom: 0.5em;
+ bottom: 0.2em; /* different in FF */
width: 529px;
height: 30px;
display: none;
@@ -1369,7 +1369,7 @@ body {
width: 500px;
margin-top: -1px;
font-size: 11px;
- padding: 3px 5px 5px;
+ padding: 2px 5px 6px; /* Different in FF */
border-radius: 3px;
color: #5b5d5e;
line-height: 1.2em;
diff --git a/skin/wot.css b/skin/wot.css
index 845fe9f..bd9f71d 100644
--- a/skin/wot.css
+++ b/skin/wot.css
@@ -401,8 +401,9 @@
margin: 0;
font-family: Tahoma, Arial, sans-serif;
width: 580px;
- height: 426px;
+ height: 422px;
overflow: hidden;
+ border: 0;
}
#wot-rwframe {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/wot.git
More information about the Pkg-mozext-commits
mailing list