Skip to content
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

Remove unused JavaScript code #3652

Merged
merged 8 commits into from
Sep 11, 2019
Merged

Remove unused JavaScript code #3652

merged 8 commits into from
Sep 11, 2019

Conversation

javierm
Copy link
Member

@javierm javierm commented Jul 2, 2019

Objectives

  • Remove obsolete code which isn't used anymore
  • Make it easier to migrate CoffeeScript code to JavaScript

@javierm javierm self-assigned this Jul 2, 2019
@javierm javierm force-pushed the remove_unused_javascript branch 2 times, most recently from 05e5789 to 5167622 Compare July 2, 2019 15:35
@javierm
Copy link
Member Author

javierm commented Jul 3, 2019

Travis failure is not related to this pull request.

@@ -21,10 +21,8 @@ App.WatchFormChanges =
if App.WatchFormChanges.forms().length == 0 || App.WatchFormChanges.msg() == undefined
return

$(document).off("page:before-change").on("page:before-change", (e) -> App.WatchFormChanges.checkChanges(e))
$(document).off("page:before-change").on("page:before-change", -> App.WatchFormChanges.checkChanges())

Choose a reason for hiding this comment

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

Line exceeds maximum allowed length. Length is 106, max is 100.

@javierm javierm added this to Testing in Roadmap Sep 10, 2019
@javierm javierm moved this from Testing to Doing in Roadmap Sep 10, 2019
@javierm javierm changed the base branch from remove_ie8_code to master September 10, 2019 23:43
@javierm javierm moved this from Doing to Testing in Roadmap Sep 10, 2019
We don't load the token message since commit 585f9ea, so the JavaScript
to show it wasn't doing anything anymore.
The banner `update_style` method isn't used since commit 82cb8d4.
The `initialize` functions don't need to return anything, since their
returned value is never used.

Returning false is a common practice in jQuery to stop an event, but in
plain JavaScript methods it doesn't have any side effects.
This code isn't used since commit 54e59a8.
The `removeCookie` function is never called, and the `initialize`
function doesn't do anything. The only functions we use here are
`getCookie` and `saveCookie`.
This code requires the variable `_paq` to be set somewhere, but we never
set it.

In the past Decide Madrid added some custom JavaScript using this code.
However, in CONSUL we're using Ahoy to track events, and we don't have
any documentation about adding custom JavaScript to use piwik nor we've
got any other piwik integration.
@javierm javierm merged commit 031fb08 into master Sep 11, 2019
Roadmap automation moved this from Testing to Release 1.1.0 Sep 11, 2019
@javierm javierm deleted the remove_unused_javascript branch September 11, 2019 00:41
smarques pushed a commit to venetochevogliamo/consul that referenced this pull request Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Roadmap
  
Release 1.1.0
Development

Successfully merging this pull request may close these issues.

None yet

2 participants