Skip to content

Commit

Permalink
Merge pull request #12 from jhonatasrm/security-fixes
Browse files Browse the repository at this point in the history
Security fixes
Updated README.md
Updated loading appearence
Updated Strings
  • Loading branch information
jhonatasrm authored Jul 21, 2019
2 parents 957477e + e430200 commit 06137d3
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 17 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ We are looking forward to see what you think is a good idea implement in the fut
## How Contribute
Have a suggestion, doubt or encountered an error? Please open a new [issue](https://github.com/mozillabrasil/sumo_live_helper/issues).

Contributions are welcome, feel free to submit a pull :)

## Learn More
To learn more about webextensions development, see this [Mozilla developer Network documentation](https://developer.mozilla.org/en-US/Add-ons/WebExtensions).

Expand Down
10 changes: 5 additions & 5 deletions src/css/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ a.active {
.question-settings {
margin-left:20px;
margin-top:5px;
max-width:230px;
min-width:230px;
max-width:255px;
min-width:255px;
font-size:13px;
}

Expand All @@ -102,8 +102,8 @@ a.active {
}

.distances-loading {
margin-left:230px;
margin-top:30px;
margin-left:222px;
margin-top:50px;
margin-bottom:50px;
}

Expand All @@ -112,6 +112,6 @@ a.active {
color:white;
cursor:pointer;
font-color:white;
width:80px;
width:90px;
font-size:13px;
}
6 changes: 3 additions & 3 deletions src/html/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
<!-- Questions -->
<div class="col-md-12" style="display: none;" id="questions">
<!-- Questions opened -->
<div class="col-md-12 margin-and-top-distance">
<img src="../res/icons/firefox.png" class="icon-size-and-distance" title="Firefox for Desktop"><label class="text-justify question-settings"></label><a class="btn btn-primary btn-settings" data-i18n="open_tab" id="open_tab"></a>
</div></br>
<section>

</section>
</div>
<!-- No questions -->
<div class="col-md-12 margin-and-top-distance" id="empty" style="display: none;">
Expand Down
41 changes: 32 additions & 9 deletions src/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,38 @@ request.onload = function() {
// url of the question
var url = "https://support.mozilla.org/"+locale+"/questions/"+responseSUMO.results[i].id;

questionOpened += '<div class="col-md-12 margin-and-top-distance">';
questionOpened += '<img src="../res/icons/firefox.png" class="icon-size-and-distance" title="Firefox for Desktop">';
questionOpened += '<label class="text-justify question-settings">'+responseSUMO.results[i].title+'</label>';
questionOpened += '<a href='+url+' class="btn btn-primary btn-settings" data-i18n="open_tab" id="open_tab" style="color:white;">'+browser.i18n.getMessage("open_tab");
questionOpened += '</a>';
questionOpened += '</div></br>';
questionOpened += '<div class="panel-section-separator"></div>';

questions.innerHTML = questionOpened;
// create elements
var questionOrder = document.createElement("div");
var questionTitle = document.createElement("label");
var iconProduct = document.createElement("img");
var zeroDiv = document.createElement("div");
var firstDiv = document.createElement("div");
var secondDiv = document.createElement("div");
var buttonOpen = document.createElement("a");
var section = document.querySelector("section");

//
zeroDiv.className = "col-md-12 margin-and-top-distance";
firstDiv.className = "col-md-12 margin-and-top-distance";
secondDiv.className = "panel-section-separator"
questionTitle.className = "text-justify question-settings";
questionTitle.textContent = responseSUMO.results[i].title;
iconProduct.className = "icon-size-and-distance";
iconProduct.title = browser.i18n.getMessage("firefox_for_desktop");
iconProduct.src = "../res/icons/firefox.png";
buttonOpen.className = "btn btn-primary btn-settings";
buttonOpen.text = browser.i18n.getMessage("open_tab");
buttonOpen.href = url;

//
questionOrder.appendChild(zeroDiv);
questionOrder.appendChild(iconProduct);
questionOrder.appendChild(questionTitle);
questionOrder.appendChild(buttonOpen);
questionOrder.appendChild(firstDiv);
questionOrder.appendChild(secondDiv);

section.appendChild(questionOrder);
}
}
}
Expand Down

0 comments on commit 06137d3

Please sign in to comment.