Merge branch 'stable-2.16'
* stable-2.16:
Upgrade bazlets to latest stable-2.16
Upgrade bazlets to latest stable-2.15
Upgrade bazlets to latest stable-2.14
Update bazlets to fix build with bazel 0.23
Update bazlets to fix build with bazel 0.23
Upgrade bazlets to latest stable-2.16 to build with 2.16.6 API
Upgrade bazlets to latest stable-2.15 to build with 2.15.11 API
Fix preference retrieval
Change-Id: I045e2152fc38ffa8eafb05c20a626b1985bbe114
diff --git a/WORKSPACE b/WORKSPACE
index 69ea309..d286432 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -3,7 +3,7 @@
load("//:bazlets.bzl", "load_bazlets")
load_bazlets(
- commit = "b084bd74743f4303971a2a057bcea4f3352ddf4e",
+ commit = "86562a4c8c2e885aac89eafab34a90571be2ef09",
#local_path = "/home/<user>/projects/bazlets",
)
diff --git a/src/main/resources/static/emoticons.js b/src/main/resources/static/emoticons.js
index 1a29d94..996487d 100644
--- a/src/main/resources/static/emoticons.js
+++ b/src/main/resources/static/emoticons.js
@@ -13,12 +13,21 @@
// limitations under the License.
Gerrit.install(function(self) {
+
+ function get(url, callback) {
+ if (window.Polymer) {
+ self.restApi().get(url).then(callback)
+ } else {
+ Gerrit.get(url, callback)
+ }
+ }
+
function onComment(e) {
var prefs = getPrefsFromCookie();
if (prefs !== null) {
insertEmoticons(e, prefs)
} else {
- self.get('/accounts/self/' + self.getPluginName()
+ get('/accounts/self/' + self.getPluginName()
+ '~preference', function(prefs) {
storePrefsInCookie(prefs);
insertEmoticons(e, prefs)