fs-feedback-creator
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -21,4 +21,5 @@ import { FeedbackResource } from "./resources/feedback.resource"; | ||
renderThanksModal(): void; | ||
restartFeedback(): void; | ||
private _addStyle; | ||
setMapsValues(): void; | ||
} |
@@ -31,5 +31,4 @@ export class FeedbackCreator { | ||
return; | ||
if (this.fb.wgAlternateColor) { | ||
if (this.fb.wgAlternateColor == true) | ||
this.textColor = "white"; | ||
} | ||
else | ||
@@ -40,6 +39,8 @@ this.textColor = "black"; | ||
<div id="widgetButtonTextContainer"> | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22" id="widgetButtonIcon"> <g fill="none" fill-rule="evenodd"> <g fill="${this.textColor}" fill-rule="nonzero"> <g transform="translate(-198 -779) translate(198 779)"> <path d="M11 0C4.935 0 0 4.935 0 11s4.935 11 11 11 11-4.935 11-11S17.065 0 11 0zm0 20.81c-2.695 0-5.14-1.091-6.914-2.856-.709-.705-1.31-1.517-1.779-2.41C1.594 14.184 1.19 12.64 1.19 11 1.19 5.59 5.59 1.19 11 1.19c2.566 0 4.905.99 6.655 2.608.907.84 1.656 1.847 2.196 2.973.615 1.281.96 2.716.96 4.229 0 5.41-4.401 9.81-9.811 9.81z"/> <circle cx="7" cy="9" r="1"/> <circle cx="15" cy="9" r="1"/> <path d="M10.48 17c2.202 0 4.312-1.247 5.52-3.316L15.044 13c-1.11 1.9-3.139 2.961-5.17 2.702C8.29 15.499 6.824 14.489 5.955 13L5 13.684c1.052 1.802 2.825 3.024 4.743 3.27.246.03.492.046.737.046z"/> </g> </g> </g> </svg> <p id="widgetButtonText">${this.language_map.get(this.fb.wgLanguage)}</p> | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22" id="widgetButtonIcon"> <g fill="none" fill-rule="evenodd"> <g fill="${this.textColor}" fill-rule="nonzero"> <g transform="translate(-198 -779) translate(198 779)"> <path d="M11 0C4.935 0 0 4.935 0 11s4.935 11 11 11 11-4.935 11-11S17.065 0 11 0zm0 20.81c-2.695 0-5.14-1.091-6.914-2.856-.709-.705-1.31-1.517-1.779-2.41C1.594 14.184 1.19 12.64 1.19 11 1.19 5.59 5.59 1.19 11 1.19c2.566 0 4.905.99 6.655 2.608.907.84 1.656 1.847 2.196 2.973.615 1.281.96 2.716.96 4.229 0 5.41-4.401 9.81-9.811 9.81z"/> <circle cx="7" cy="9" r="1"/> <circle cx="15" cy="9" r="1"/> <path d="M10.48 17c2.202 0 4.312-1.247 5.52-3.316L15.044 13c-1.11 1.9-3.139 2.961-5.17 2.702C8.29 15.499 6.824 14.489 5.955 13L5 13.684c1.052 1.802 2.825 3.024 4.743 3.27.246.03.492.046.737.046z"/> </g> </g> </g> </svg> | ||
<p id="widgetButtonText">${this.language_map.get(this.fb.wgLanguage)}</p> | ||
</div> | ||
</button> | ||
`; | ||
console.log(this.textColor); | ||
this.root.innerHTML = html; | ||
@@ -90,3 +91,3 @@ const button = document.getElementById("feedbackButton"); | ||
this.emojiPosition = 12; | ||
this.responseData.reactionType = 1; | ||
this.responseData.reactionType = 5; | ||
this.renderForm("commentLoveText"); | ||
@@ -97,3 +98,4 @@ }); | ||
this.emojiPosition = 30; | ||
this.responseData.reactionType = 2; | ||
this.responseData.reactionType = 4; | ||
console.log(this.responseData); | ||
this.renderForm("commentLikeText"); | ||
@@ -110,3 +112,3 @@ }); | ||
this.emojiPosition = 67; | ||
this.responseData.reactionType = 4; | ||
this.responseData.reactionType = 2; | ||
this.renderForm("commentDislikeText"); | ||
@@ -117,3 +119,3 @@ }); | ||
this.emojiPosition = 86; | ||
this.responseData.reactionType = 5; | ||
this.responseData.reactionType = 1; | ||
this.renderForm("commentHateText"); | ||
@@ -191,3 +193,3 @@ }); | ||
this.emojiPosition = 12; | ||
this.responseData.reactionType = 1; | ||
this.responseData.reactionType = 5; | ||
this.renderForm("commentLoveText"); | ||
@@ -198,3 +200,3 @@ }); | ||
this.emojiPosition = 30; | ||
this.responseData.reactionType = 2; | ||
this.responseData.reactionType = 4; | ||
this.renderForm("commentLikeText"); | ||
@@ -211,3 +213,3 @@ }); | ||
this.emojiPosition = 67; | ||
this.responseData.reactionType = 4; | ||
this.responseData.reactionType = 2; | ||
this.renderForm("commentDislikeText"); | ||
@@ -218,3 +220,3 @@ }); | ||
this.emojiPosition = 86; | ||
this.responseData.reactionType = 5; | ||
this.responseData.reactionType = 1; | ||
this.renderForm("commentHateText"); | ||
@@ -246,2 +248,3 @@ }); | ||
this.isSent = true; | ||
console.log(this.responseData); | ||
this.renderThanksModal(); | ||
@@ -254,2 +257,3 @@ }); | ||
this.isSent = true; | ||
console.log(this.responseData); | ||
this.renderThanksModal(); | ||
@@ -268,2 +272,3 @@ }); | ||
this.root.innerHTML = html; | ||
this.restartFeedback(); | ||
const closeButton = document.getElementsByClassName("closeButton")[0]; | ||
@@ -274,2 +279,8 @@ closeButton.addEventListener("click", () => { | ||
} | ||
restartFeedback() { | ||
setTimeout(() => { | ||
this.onResponseSend; | ||
this.renderButton(); | ||
}, 3000); | ||
} | ||
_addStyle() { | ||
@@ -284,2 +295,3 @@ const css = ` | ||
cursor: pointer; | ||
position: fixed; | ||
} | ||
@@ -299,3 +311,3 @@ #feedbackButton:hover { | ||
margin-top: -26px; | ||
color: ${this.textColor}; | ||
color: ${this.fb.wgAlternateColor ? 'white' : 'black'}; | ||
} | ||
@@ -315,3 +327,3 @@ #widgetButtonTextContainer{ | ||
${this.modalViews.get(this.fb.wgPosition)}; | ||
animation: reactionModal .4s ease-in | ||
animation: reactionModal .2s ease-in | ||
} | ||
@@ -451,11 +463,11 @@ @keyframes reactionModal{ | ||
this.language_map.set("fr", "Rétroaction"); | ||
this.style_map.set(0, "float:right; margin-top:350px; margin-right:-8px; border-top-left-radius: 3px; border-bottom-left-radius: 3px;"); | ||
this.style_map.set(1, "float:left; margin-top:350px; margin-left:-8px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;"); | ||
this.style_map.set(2, "float:right; margin-top:700px; margin-right:-8px; border-top-left-radius: 3px; border-bottom-left-radius: 3px;"); | ||
this.style_map.set(3, "float:left; margin-top:700px; margin-left:-8px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;"); | ||
this.modalViews.set(0, "float:right; margin-top:322px; margin-right: 40px;"); | ||
this.modalViews.set(1, "float:left; margin-top:322px; margin-left: 40px;"); | ||
this.modalViews.set(2, "float:right; margin-top:644px; margin-right: 40px;"); | ||
this.modalViews.set(3, "float:left; margin-top:644px; margin-left: 40px;"); | ||
this.style_map.set(0, "right: 0px; top:50%; border-top-left-radius: 3px; border-bottom-left-radius: 3px;"); | ||
this.style_map.set(1, "left: 0px; top:50%; border-top-right-radius: 3px; border-bottom-right-radius: 3px;"); | ||
this.style_map.set(2, "right: 0px; top:70%; border-top-left-radius: 3px; border-bottom-left-radius: 3px;"); | ||
this.style_map.set(3, "left: 0px; top:70%; border-top-right-radius: 3px; border-bottom-right-radius: 3px;"); | ||
this.modalViews.set(0, "right: 32px; top: 45%; position: fixed;"); | ||
this.modalViews.set(1, "left: 32px; top: 45%; position: fixed;"); | ||
this.modalViews.set(2, "right: 32px; top: 65%; position: fixed;"); | ||
this.modalViews.set(3, "left: 32px; top: 65%; position: fixed;"); | ||
} | ||
} |
{ | ||
"name": "fs-feedback-creator", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "web-based module that's responsible to inject fullsession feedback modal", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
34155
565