Thursday, August 28, 2014

Naming in code

Code should be able to tell you: what, how and why.

What is method name.

How is the code itself.

Why is in the comments.

I also add vague "when", in cases I don't use CVS and file date isn't always accurate, because the last change could be just beautification or comment.

Saturday, August 2, 2014

Mouse Events

asasdf some of them are confusing

  • mousedown: the user presses the mouse button down on an element. You can use this event to initiate a drag-and-drop operation or display a context menu.
  • mouseup: the user releases the mouse button on an element. You can use this event to complete a drag-and-drop operation or trigger an action, such as submitting a form.
  • click: the user clicks the mouse button on an element. You can use this event to respond to user input, such as by toggling a menu or submitting a form.
  • dblclick: user double-clicks the mouse button on an element. You can use this event to provide a shortcut for a common action, such as opening a modal dialog or zooming in on an image.
  • mousemove: This event is triggered when the mouse pointer moves over an element. You can use this event to track the mouse position or implement a custom mouse cursor. The event will fire for any pointer movement, but not for every pixel.
  • mouseover: mouse pointer moves over an element – including descendants, so the event fires every time the pointer changes elements. You can use this event to provide feedback to the user, such as by highlighting a link or displaying a tooltip.
  • mouseenter: mouse pointer enters an element's boundaries. Unlike mouseover, it does not propagate upwards or downwards to any of the element's descendants. This event is often more favorable, than mouseover.
  • mouseout: mouse pointer moves out of an element. You can use this event to remove feedback or hide a tooltip when the user moves the mouse away from an element.
  • mouseleave: mouse pointer leaves an element's boundaries. Like mouseenter, it does not propagate to the element's descendants. You can use this event to detect when the user stops hovering over an element and trigger an action, such as hiding a tooltip or removing a highlight.
  • contextmenu: user right-clicks on an element to open a context menu. You can use this event to display a custom context menu or prevent the default context menu from appearing.
  • wheel: user scrolls the mouse wheel. You can use this event to implement custom scrolling behavior or zooming on a web page. The mousewheel event has been deprecated in favor of the wheel event.
  • selectstart: user begins to select text on a web page with the mouse. You can use this event to prevent the user from selecting certain elements or implement custom selection behavior.

asdf