Page MenuHomePhabricator

Changes to DSN for more width and finer css/js control
Closed, ResolvedPublic

Description

Author: c.stafford

Description:
very small changes that have a large impact on how useful this extension is

This patch does a few things.

@line 30
When in 'user' mode, the mw:sitenotice->encNotice text is copied into a javascript variable, then used in output.
Yet, when in 'anon' mode, it is not, it is only directly output and never assigned to a javascript accessible variable.
This causes any javascript that may be looking for that variable to fail when the user is logged out.

@line 31
When in 'user' mode, the mw:sitenotice->encNotice is wrapped in a table with the message and dismiss link in separate cells.
Yet, when in 'anon' mode, there is no table, only direct output.
This causes any css that was affecting the user version via the css ID of #mw-dismissable-notice to fail as there is now no table with that ID, or a table at all.
Line 31 corrects this by replicating the table used in the 'user' mode notice.

@line 65:part 1
When in 'user' mode, the sitenotice area is in a table, and the notice is in a table cell with the hard coded width of 80% of its parent (the table having width=100%).
This causes the available area to be significantly more narrow for logged in users then logged out.
My change is to make this cell attempt to take as much width as possible by setting (still doing an ugly hard coded width sadly) a width of 100%

@line 65:part 2
The table cell with the contents of the message does not have a direct reference, and any attempt to apply styling to just that requires an odd CSS syntax (that doesn't even work currently for logged out users because of lack of table at all, see above change)
To correct this, I set a ID attribute of mw-dismissable-notice-content

@line 66: part 1
The more annoying part of the 80/20 values was the 20% space allowed for the one tiny [dismiss] link.
This is a very large amount of space to allocate for a link that is only a few em wide even in the longer languages.
By removing the width=20% attribute, combined with the width=100% set in line65:p1, this cell will take up as little space as possible.

@line 66: part2
As with L65:2, the cell containing the [dismiss] link is also not easily accessible via CSS or JavaScript.
Again I simply add a ID attribute to the cell of mw-dismissable-notice-dismiss to allow CSS or JavaScript to reference it (likely to hide the cell or modify the link's style)


Version: unspecified
Severity: enhancement

Attached:

Details

Reference
bz18249

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:36 PM
bzimport set Reference to bz18249.
bzimport added a subscriber: Unknown Object (MLST).

sumanah wrote:

Chris, I'm sorry for the wait in response! Thank you for the patch.

If this issue is still something that you'd like to follow up on, take a look at our current codebase and consider updating and submitting your patch directly into our new Git source control system.

https://www.mediawiki.org/wiki/Git/Workflow

You can do this by getting and using "developer access"

https://www.mediawiki.org/wiki/Developer_access

Thanks again, and I apologize for the wait.

DismissableSiteNotice no longer uses tables (see bug 25475), so I'll call this "FIXED". Please reopen this ticket if similar issues still exist.