-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project C.A.T.S. #82
Project C.A.T.S. #82
Conversation
tomasko126
commented
Sep 15, 2016
- Added detection code, whether CB has been installed from CWS/homepage or the dedicated page for C.A.T.S. project
- When installed from a special link, “Project C.A.T.S.” mode will be enabled (this means that CB will be subscribed to another Flickr channel with cats from the project)
Signed-off-by: Tomáš Taro <tomas@getadblock.com>
Signed-off-by: Tomáš Taro <tomas@getadblock.com>
Signed-off-by: Tomáš Taro <tomas@getadblock.com>
Signed-off-by: Tomáš Taro <tomas@getadblock.com>
Signed-off-by: Tomáš Taro <tomas@getadblock.com>
…when Project CATS is enabled Signed-off-by: Tomáš Taro <tomas@getadblock.com>
Signed-off-by: Tomáš Taro <tomas@getadblock.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a few things that need changing. Let me know when it's ready to review again.
} catch(e) { | ||
return undefined; | ||
} | ||
return intFor(el.getAttribute(prop) || window.getComputedStyle(el)[prop]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this not part of another PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kpeckett This was changed as part of a merge commit from master
to project-cats
branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try rebasing next time: https://www.atlassian.com/git/tutorials/merging-vs-rebasing/ avoids extra commits appearing.
@@ -7,6 +7,9 @@ function mayDelete(channelData) { | |||
if (channelData.name === "TheCatsOfCatBlockUsersChannel") { | |||
return false; | |||
} | |||
if (channelData.name === "TheCatsOfProjectCATS") { | |||
return false; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be changed to a switch statement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kpeckett I will update the code accordingly.
if (self.isEnabled() === undefined && sessionstorage_get("installed")) { | ||
sessionstorage_set("installed"); // present with a new user | ||
|
||
var installURL = "https://catblock.tk/installed.html"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not a local page?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kpeckett When a user installs CatBlock from the special link, some data to localStorage will be saved (project-cats will be saved as true).
After we open a post-installation URL, CatBlock will try to get project-cats
data from localStorage.
When CB detects there is not such an entry, it won't enable "Project CATS" mode. When there is, it will send a message to CatBlock to enable "Project CATS" mode.
// Init "Project CATS" | ||
CATS.init(function(enabled) { | ||
channels = new Channels(); | ||
console.log("initialized ", enabled); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover debugging code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kpeckett I will delete debugging code accordingly.
Signed-off-by: Tomáš Taro <tomas@getadblock.com>
Signed-off-by: Tomáš Taro <tomas@getadblock.com>
Signed-off-by: Tomáš Taro <tomas@getadblock.com>
@kpeckett Is this ready to be merged? |
switch (channelData.name) { | ||
case "AprilFoolsCatsChannel": return false; | ||
case "TheCatsOfCatBlockUsersChannel": return false; | ||
case "TheCatsOfProjectCATS": return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking more along the lines of:
switch (channelData.name) {
case "AprilFoolsCatsChannel":
case "TheCatsOfCatBlockUsersChannel":
case "TheCatsOfProjectCATS":
return false;
break;
defualt:
return true;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You sort of got the idea with the case statements, but it can be made to look cleaner.
Signed-off-by: Tomáš Taro <tomas@getadblock.com>
Signed-off-by: Tomáš Taro <tomas@getadblock.com>
@kpeckett Codacy is wrong here with the intendation. Anyway, I've made changes you've requested. Requesting PR merge approval. |