Closed
Bug 498825
Opened 15 years ago
Closed 15 years ago
Rewrite install/download buttons so they don't have so many problems
Categories
(addons.mozilla.org Graveyard :: Public Pages, defect, P1)
addons.mozilla.org Graveyard
Public Pages
Tracking
(Not tracked)
RESOLVED
FIXED
5.2
People
(Reporter: clouserw, Assigned: rdoherty)
References
Details
Attachments
(3 files, 1 obsolete file)
222.72 KB,
image/png
|
Details | |
63.45 KB,
patch
|
clouserw
:
review+
|
Details | Diff | Splinter Review |
37.67 KB,
patch
|
clouserw
:
review+
|
Details | Diff | Splinter Review |
We have a bunch of bugs with the install/download buttons and we've talked about rewriting the code for a long time. It seems like we touch that code a lot and every time we do we collectively cringe and QA senses our concern and gets stressed out.
If we rewrite them with all the edge cases in mind we can make them easier to work on and more correct for the users.
Comment 1•15 years ago
|
||
+1
Reporter | ||
Updated•15 years ago
|
Updated•15 years ago
|
Priority: -- → P3
Target Milestone: --- → 5.0.8
Reporter | ||
Updated•15 years ago
|
Target Milestone: 5.0.8 → 5.0.9
Updated•15 years ago
|
Assignee: buchanae → rdoherty
Reporter | ||
Comment 2•15 years ago
|
||
<3
Assignee | ||
Comment 3•15 years ago
|
||
::gulp::
Reporter | ||
Updated•15 years ago
|
Priority: P3 → P2
Reporter | ||
Comment 4•15 years ago
|
||
If you just got into the office you might want to grab some more coffee before you open this.
Comment 5•15 years ago
|
||
That is my new wallpaper.
Reporter | ||
Updated•15 years ago
|
Target Milestone: 5.0.9 → 5.1
Assignee | ||
Comment 6•15 years ago
|
||
Here's a small patch to show the direction I'm going. Would like feedback earlier rather than later so I don't have to rewrite it twice ;)
Attachment #395968 -
Flags: review?(clouserw)
Assignee | ||
Updated•15 years ago
|
Attachment #395968 -
Flags: review?(jbalogh)
Reporter | ||
Comment 7•15 years ago
|
||
Comment on attachment 395968 [details] [diff] [review]
Rough outline of plan
I think the plan looks good
Attachment #395968 -
Flags: review?(clouserw) → review+
Updated•15 years ago
|
Attachment #395968 -
Flags: review?(jbalogh) → review+
Comment 8•15 years ago
|
||
Comment on attachment 395968 [details] [diff] [review]
Rough outline of plan
I wish you good luck sir.
Reporter | ||
Updated•15 years ago
|
Target Milestone: 5.1 → 5.2
Assignee | ||
Comment 10•15 years ago
|
||
PHP rewrite review commence!
JS rewrite is for next week.
Attachment #395968 -
Attachment is obsolete: true
Attachment #404390 -
Flags: review?(clouserw)
Assignee | ||
Updated•15 years ago
|
Attachment #404390 -
Flags: review?(jbalogh)
Reporter | ||
Comment 11•15 years ago
|
||
Comment on attachment 404390 [details] [diff] [review]
v1
I think it's looking good. There are still some corner cases, but we can tweak it after the main classes have landed.
Also, it would be nice to fix this while you are creating the methods:
$buttonMessage = sprintf(___('Add to %1$s %2$s'), APP_PRETTYNAME, "%s");
Attachment #404390 -
Flags: review?(clouserw) → review+
Assignee | ||
Comment 12•15 years ago
|
||
r52887
For QA:
Install buttons can be tested now, backend code was re-written. I'll put together a list of where they are displayed.
Assignee | ||
Comment 13•15 years ago
|
||
(In reply to comment #11)
> Also, it would be nice to fix this while you are creating the methods:
>
> $buttonMessage = sprintf(___('Add to %1$s %2$s'), APP_PRETTYNAME, "%s");
This involves changes to the JavaScript too, I'll make it part of my next patch.
Assignee | ||
Comment 14•15 years ago
|
||
URLs afaik (linking to preview for testing):
https://preview.addons.mozilla.org/en-US/firefox/browse/type:1/cat:22 (category landing)
https://preview.addons.mozilla.org/en-US/firefox/addon/3895 (add-on display)
https://preview.addons.mozilla.org/en-US/firefox/addons/policy/0/2032/57017 (policy page)
https://preview.addons.mozilla.org/en-US/firefox/pages/collector (collector info)
https://preview.addons.mozilla.org/en-US/firefox/addon/5579/developers (contributions)
https://preview.addons.mozilla.org/en-US/firefox/ (homepage)
https://preview.addons.mozilla.org/en-US/firefox/search?q=xmarks&cat=all (search)
https://preview.addons.mozilla.org/en-US/firefox/collection/webdeveloper (collection detail)
Ryan, so far, I think the changes are looking pretty good (haven't found anything obvious, anyway); how extensive is the JS rewrite, and what will it touch?
Thanks!
Assignee | ||
Comment 16•15 years ago
|
||
The JS rewrite isn't as extensive as the PHP one, there is a lot less JS. But it will touch all button functions:
* Platform detection (FF too old/new)
* Experimental status (checkbox, etc)
* Thunderbird/sunbird install instructions
* Show/hide correct platform buttons
Rewrite will probably finish friday.
Assignee | ||
Comment 17•15 years ago
|
||
Finally done (I hope)
Attachment #405815 -
Flags: review?(clouserw)
Reporter | ||
Comment 18•15 years ago
|
||
Comment on attachment 405815 [details] [diff] [review]
v2 (js)
works well for me! Thanks.
Can you add L10n comments for any strings with substitutions in them? I'd also like to see this die:
> + $buttonMessage = sprintf(___('Add to %1$s %2$s'), $appName, "%s");
but I realize it was grandfathered in. We can do a separate bug if you don't get to it this time around.
Attachment #405815 -
Flags: review?(clouserw) → review+
Assignee | ||
Comment 19•15 years ago
|
||
(In reply to comment #18)
> > + $buttonMessage = sprintf(___('Add to %1$s %2$s'), $appName, "%s");
Oh, yeah. I took a look at that and wasn't sure how to fix it initially. I'm guessing this would be better?
$buttonMessage = sprintf(___('Add to %1$s %%s'), $appName);
In JS, the string is then sprintf'd again to add the platform name.
Reporter | ||
Comment 20•15 years ago
|
||
I think a switch/case. :-/
switch (appName):
case 'firefox':
sprintf(___(/* L10n: %s is a platform name. Example: Windows*/ 'Add to Firefox (%s)'), $platform);
break;
...
Substituting the platform like that isn't the best, but I think it works.
Assignee | ||
Comment 21•15 years ago
|
||
r53267
will spin off string fixes.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•15 years ago
|
Keywords: push-needed
Updated•15 years ago
|
Keywords: push-needed
Assignee | ||
Updated•15 years ago
|
Attachment #404390 -
Flags: review?(jbalogh)
Updated•9 years ago
|
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•