Skip to content
This repository has been archived by the owner on Jan 10, 2019. It is now read-only.

broken site button #153

Open
wants to merge 2 commits into
base: beta
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion css/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,14 @@
}
}


@mixin button () {
.button {
background:none;
border:none;
margin:0;
padding:0;
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a new blank line between this and next line, and add a space between properties and values above.

/* Images & icons */
@mixin icon_display () {
background-repeat: no-repeat;
Expand Down
4 changes: 2 additions & 2 deletions css/_vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ $color--neutral-bg: #f5f5f5;

/* Popup */
$popup__width: 270px;
$popup__height: 505px;
$popup__height--moz: 520px;
$popup__height: 540px;
$popup__height--moz: 540px;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice that originally the heights across browsers were different and now they are the same. Did you verify that the height was correct in FF and Chrome? I would think that FF would be taller.


/* Cards */
$card__bg-color: $white;
Expand Down
16 changes: 15 additions & 1 deletion css/trackers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,20 @@ body {
margin-top: 5px;
}
}

.site-info__li--report {
height: 24.5px;

.site-info__report-text {
font-weight: bold;
margin-top: 3.5px;
display: inline-block;
}

.pull-right {
margin-top: 5px;
}
}
}

.linkable {
Expand Down Expand Up @@ -372,7 +386,7 @@ body {

/* Generic toggle button styling */
@include toggle_button();

@include button();

/* Sliding subviews */
@include sliding_subview();
11 changes: 11 additions & 0 deletions js/ui/templates/shared/button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const bel = require('bel');

module.exports = function (site, text, klass) {

return bel`
<button class="${klass}"
type="button">
${text}
</button>`;
}

5 changes: 5 additions & 0 deletions js/ui/templates/site.es6.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const bel = require('bel');
const toggleButton = require('./shared/toggle-button');
const Button = require('./shared/button');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shared/button is a function not a constructor, so it should be const button not const Button.


module.exports = function () {

Expand Down Expand Up @@ -32,6 +33,10 @@ module.exports = function () {
<span class="site-info__toggle-text">${this.model.whitelistStatusText}</span>
${toggleButton(!this.model.isWhitelisted, 'js-site-toggle pull-right')}
</li>
<li class="site-info__li--report">
${Button(this.model.domain, 'Report Broken Site', 'button site-info__report-text js-site-report')}
<span class="icon icon__arrow pull-right"></span>
</li>
</ul>
</section>`;

Expand Down
11 changes: 9 additions & 2 deletions js/ui/views/site.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ Site.prototype = $.extend({},

this._cacheElems('.js-site', [
'toggle',
'show-all-trackers'
'show-all-trackers',
'report'
]);

this.bindEvents([
[this.$toggle, 'click', this._whitelistClick],
[this.$showalltrackers, 'click', this._showAllTrackers]
[this.$showalltrackers, 'click', this._showAllTrackers],
[this.$report, 'click', this._reportSiteClick]
]);

},
Expand Down Expand Up @@ -76,6 +78,11 @@ Site.prototype = $.extend({},
});
},

_reportSiteClick: function() {
let reportURL = "https://www.surveymonkey.com/r/V6L5ZY2?url="
chrome.tabs.create({url: reportURL + this.model.domain})
},

_whitelistClick: function (e) {
this.model.toggleWhitelist();
console.log('isWhitelisted: ', this.model.isWhitelisted);
Expand Down