From 3de3de8049b2a54f0dc81f14c88be5948125c86d Mon Sep 17 00:00:00 2001 From: Bogdan Tara Date: Mon, 29 Oct 2018 21:42:21 +0200 Subject: [PATCH] Backed out changeset efd80121bf41 (bug 1501459) for ES lint failure CLOSED TREE --HG-- rename : browser/components/pocket/content/panels/tmpl/ho2/ho2_sharebutton.handlebars => browser/components/pocket/content/panels/tmpl/ho2/ho2_sharebutton_v2.handlebars --- .../content/panels/css/sendtomobile.css | 11 +++++++++ .../pocket/content/panels/js/sendtomobile.js | 23 +++++++++++++++---- .../pocket/content/panels/js/tmpl.js | 8 ++++++- .../tmpl/ho2/ho2_sharebutton_v1.handlebars | 18 +++++++++++++++ ...ndlebars => ho2_sharebutton_v2.handlebars} | 0 .../tmpl/ho2/ho2_sharebutton_v3.handlebars | 7 ++++++ 6 files changed, 61 insertions(+), 6 deletions(-) create mode 100644 browser/components/pocket/content/panels/tmpl/ho2/ho2_sharebutton_v1.handlebars rename browser/components/pocket/content/panels/tmpl/ho2/{ho2_sharebutton.handlebars => ho2_sharebutton_v2.handlebars} (100%) create mode 100644 browser/components/pocket/content/panels/tmpl/ho2/ho2_sharebutton_v3.handlebars diff --git a/browser/components/pocket/content/panels/css/sendtomobile.css b/browser/components/pocket/content/panels/css/sendtomobile.css index 3d4e92cee934..6eed91f61e2a 100644 --- a/browser/components/pocket/content/panels/css/sendtomobile.css +++ b/browser/components/pocket/content/panels/css/sendtomobile.css @@ -2,6 +2,10 @@ top: -5px; } +.pkt_ext_saved_sendtomobile.pkt_ext_ho2_v1 .pkt_ext_loadingspinner { + top: 110px; +} + .pkt_ext_save_title_wrapper { position: relative; display: inline-flex; @@ -91,6 +95,13 @@ cursor: pointer; } +.pkt_ext_ho2_v1 { + background-color: #EBEBEB; + border-top: 1px solid #C3C3C3; + padding: 17px; + height: 144px; +} + .pkt_ext_experiment_saved_tile { position: relative; margin: 0 auto 17px; diff --git a/browser/components/pocket/content/panels/js/sendtomobile.js b/browser/components/pocket/content/panels/js/sendtomobile.js index 19004bec63d4..ba96f43f5a83 100644 --- a/browser/components/pocket/content/panels/js/sendtomobile.js +++ b/browser/components/pocket/content/panels/js/sendtomobile.js @@ -3,7 +3,8 @@ var PKT_SENDTOMOBILE = (function() { var width = 350; - var ctaHeight = 200; + var variant1Height = 312; + var variant2Height = 200; var confirmHeight = 275; var premDetailsHeight = 110; var email = null; @@ -48,10 +49,22 @@ var PKT_SENDTOMOBILE = (function() { $("body").addClass("pkt_ext_ho2_experiment"); var height = (adjustHeight) ? premDetailsHeight : 0; - // Show "Send to your phone" CTA - height += ctaHeight; - $("body").append(Handlebars.templates.ho2_sharebutton()); - thePKT_SAVED.sendMessage("resizePanel", { width, height }); + if (ho2 == "show_prompt_preview") { + height += variant1Height; + $("body").append(Handlebars.templates.ho2_sharebutton_v1()); + thePKT_SAVED.sendMessage("resizePanel", { width, height }); + thePKT_SAVED.sendMessage("getArticleInfo", {}, function(data) { + _swapPlaceholder(data); + }); + } else if (ho2 == "show_prompt_no_preview") { + height += variant2Height; + $("body").append(Handlebars.templates.ho2_sharebutton_v2()); + thePKT_SAVED.sendMessage("resizePanel", { width, height }); + } else if (ho2 == "show_prompt_get_app") { + height += variant2Height; + $("body").append(Handlebars.templates.ho2_sharebutton_v3()); + thePKT_SAVED.sendMessage("resizePanel", { width, height }); + } _initPanelOneClicks(); } diff --git a/browser/components/pocket/content/panels/js/tmpl.js b/browser/components/pocket/content/panels/js/tmpl.js index 45de96fc673d..adf89d9ca43c 100644 --- a/browser/components/pocket/content/panels/js/tmpl.js +++ b/browser/components/pocket/content/panels/js/tmpl.js @@ -33,9 +33,15 @@ templates['ho2_download'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":fu templates['ho2_download_error'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { return "
\n

There was a problem

\n

Email failed to send, please try again later

\n\n
\n

You can also get the Pocket app on the App Store here:

\n\n
\n
\n Get it on Google Play\n
\n
\n
\n"; },"useData":true}); -templates['ho2_sharebutton'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { +templates['ho2_sharebutton_v1'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { + return "
\n
\n
\n
\n\n
\n
 
\n
 
\n
\n
\n
\n\n \n
\n"; +},"useData":true}); +templates['ho2_sharebutton_v2'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { return "
\n \n
\n"; },"useData":true}); +templates['ho2_sharebutton_v3'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { + return "
\n \n
\n"; +},"useData":true}); templates['saved_premiumextras'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { return "
\r\n
"; },"useData":true}); diff --git a/browser/components/pocket/content/panels/tmpl/ho2/ho2_sharebutton_v1.handlebars b/browser/components/pocket/content/panels/tmpl/ho2/ho2_sharebutton_v1.handlebars new file mode 100644 index 000000000000..89429659b4ac --- /dev/null +++ b/browser/components/pocket/content/panels/tmpl/ho2/ho2_sharebutton_v1.handlebars @@ -0,0 +1,18 @@ +
+
+
+
+ +
+
 
+
 
+
+
+
+ + +
diff --git a/browser/components/pocket/content/panels/tmpl/ho2/ho2_sharebutton.handlebars b/browser/components/pocket/content/panels/tmpl/ho2/ho2_sharebutton_v2.handlebars similarity index 100% rename from browser/components/pocket/content/panels/tmpl/ho2/ho2_sharebutton.handlebars rename to browser/components/pocket/content/panels/tmpl/ho2/ho2_sharebutton_v2.handlebars diff --git a/browser/components/pocket/content/panels/tmpl/ho2/ho2_sharebutton_v3.handlebars b/browser/components/pocket/content/panels/tmpl/ho2/ho2_sharebutton_v3.handlebars new file mode 100644 index 000000000000..306628b63d48 --- /dev/null +++ b/browser/components/pocket/content/panels/tmpl/ho2/ho2_sharebutton_v3.handlebars @@ -0,0 +1,7 @@ +
+ +