Merge lp:~sinzui/launchpad/obsolete-js into lp:launchpad
| Status: | Merged | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Approved by: | j.c.sackett on 2012-03-29 | ||||||||
| Approved revision: | no longer in the source branch. | ||||||||
| Merged at revision: | 15043 | ||||||||
| Proposed branch: | lp:~sinzui/launchpad/obsolete-js | ||||||||
| Merge into: | lp:launchpad | ||||||||
| Diff against target: | 0 lines | ||||||||
| To merge this branch: | bzr merge lp:~sinzui/launchpad/obsolete-js | ||||||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| j.c.sackett (community) | 2012-03-29 | Approve on 2012-03-29 | |
| Richard Harding (community) | code* | 2012-03-29 | Approve on 2012-03-29 |
|
Review via email:
|
|||
Commit Message
Remove obsolete JavaScript.
Description of the Change
Pre-implementation: no one
While investigating a forbidden error during an ajax request, I was
surprised to see comments by kiko about obsolete code. While the
forbidden error should have been handled gracefully by the ajax request,
there is a separate issue that every page in Lp is serving obsolete
JavaScript functions via base-layout-
All the functions in <metal:
need review:
* VOID_URL is already inlined in it's only callsite, remove it.
* registerLaunchp
the function.
* updateField() is only used by codeimport-new.pt; inline the function.
* setBetaRedirect() is used by the deprecated edge server; remove it.
* popup_window() has no callsites; remove it.
* switchBugBranch
* switchSpecBranc
and branch-macros.pt. It could be inlined but it might belong in a
code/
-------
RULES
* Delete and move until happiness is achieved.
ADDENDUM
* Bug #968310 javascript error editing a branch's related blueprints
switchSpe
the form/markup that it used was removed. The function is 5 years
old an probably broke in the 2x or 3x redesign.
DOUBLE ADDENDUM
* WTF. The switchSpecBranc
causing scripting errors on the branch page, it was disabled
on the merge page years ago because it just does not work.
* delete switchSpecBranc
QA
* Visit https:/
* Verify that when a repo type is selectected, its url field is
is enabled and the other are disabled.
* Visit https:/
* Verify there is not a green 'Edit' text after the blueprint link.
* Verify there is not a JS error when the edit link is followed.
LINT
lib/
lib/
lib/
lib/
TEST
None. These were untested functions though I do know exactly how I will
QA the moved functions.
IMPLEMENTATION
Inlined updateWidgets() and registerLaunchp
changed the call to run on DOMREADY and I chose to make it clear that
that the functions are global vars.
lib/
I deleted the uses of switchSpecBranc
branch page (branch-
proposal page (branch-macros). In the former case I chose to keep the
edit link which is what my browser failed over to use. In the later
case, the edit links were never generated, so I choose to just deleted.
lib/
lib/
I removed all the unused functions. The two remaining functions are used
by LaunchpadForm and Widgets to set the field that has focus and ensure
that keyboard commands are not misinterpreted by <select>.
lib/
| j.c.sackett (jcsackett) wrote : | # |
This looks good to land; I agree the spacing is inconsistent, I leave how (and if) to resolve that to you.
| Curtis Hovey (sinzui) wrote : | # |
Indeed the spaces was inconsistent.
| Curtis Hovey (sinzui) wrote : | # |
I got brutal with the script block. It was using == instead of === and the indentation was not 4-space. Lint likes it now.

Thanks for this. We definitely new these 'global' functions needed some clean up and research after moving them there during the thunder epic.
My only nitpick is just a lint issue in that the spacing around function () isn't consistent. Since I don't think JSLint hits the .pt files. Most of the cases have no space, but I think JSLint and updateField in the code below does have the space.