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 onclick attributes #529

Closed
wants to merge 10 commits into from
Closed

Conversation

cweider
Copy link
Contributor

@cweider cweider commented Mar 2, 2012

Shifts event handling into from onclick attributes into pad_editbar. Also has an irrelevant, but maybe nice, change from anchors to buttons in the editbar markup (IE7 looks a little funny… thoughts?). Addresses concerns from #504.

@Pita
Copy link
Contributor

Pita commented Mar 2, 2012

This changes makes it more difficult for new programmers to understand where the onclick event ends up. I also guess that this change will cause problems in different IE versions...

@JohnMcLear
Copy link
Member

I will test this tomorrow.

@yadutaf
Copy link

yadutaf commented Mar 3, 2012

Removing the "onclick" attribute sounds like a good idea. This is indeed a common practice to "bind" events to a DOM on the JS side to avoid code mixing. Then an array could hold a correspondence between the buttons ids and the corresponding action or even "guess" the corresponding action using a naming convention.

example:

  • id attribute-bold => toggle bold on the selected text
  • id paragraph-list-bullet => toggle bullet lists on the selected lines

But there is something I still do not understand. Why are you replacing the links by buttons ? Buttons are much harder to work with in cross-browsers applications...

@JohnMcLear
Copy link
Member

Good work @cweider. A few Q's and pointers.

  • Did we profile page load speed before/after to see if it actually made a difference?
  • Buttons have lost their "spacers" IE the space between groups
  • Some of the icons inside of the buttons have shifted down a few PX
  • All buttons seem to function properly.
  • Clear all authorship colors doesn't work in IE7/8/9 in IETester as perhaps the popup is suppressed or something, selecting a piece of text and clearing works. I'm going to assume this is an IEtester bug
  • There is a new require bug in IE on the timeslider (Not replace to this pull request)

@cweider
Copy link
Contributor Author

cweider commented Mar 4, 2012

@jtlebi, yea, moving the bar’s construction further into JavaScript would be a good idea (see #470). Regarding <button> versus <a>, that’s mostly a stylistic thing, though it can help with accessibility a bit (tabbing works automatically).

@johnyma22, I doubt it has any effect on loading time (the <script> elements are the (minor) problem there) – just cleanup.

@JohnMcLear
Copy link
Member

The soonest I can test and pull this is Thursday. Two reasons

a) I'm really busy at the mo
b) We're not pulling any new code until the plugin framework is finally merged

@JohnMcLear
Copy link
Member

testing this today

@JohnMcLear
Copy link
Member

The padding beneath the buttons is slightly too small in firefox

@JohnMcLear
Copy link
Member

Can you please give this a quick polish then open a pull request so it goes into the develop branch? Should be good to pretty much merge once it's been polished slightly. IE seems fine

@0ip
Copy link
Member

0ip commented May 5, 2012

Update? :)

A few remarks:

  • editbar buttons aren't vertically centered
  • background-color: gradient... isn't valid, it has to be either background or background-image (why did you change this?)
  • mobile view is a bit broken

@cweider
Copy link
Contributor Author

cweider commented May 12, 2012

This pull is invalid, at least because it’s headed into master. A version of this without converting to button tags would be better, though still may or may not makes until plugin stuff is all finished.

@cweider cweider closed this May 12, 2012
@cweider cweider mentioned this pull request May 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants