Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+C | copy current line (if no selection) |
| Ctrl+X | cut current line (if no selection) |
| Ctrl+⇧+K | delete line |
| Ctrl+↩ | insert line after |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+C | copy current line (if no selection) |
| Ctrl+X | cut current line (if no selection) |
| Ctrl+⇧+K | delete line |
| Ctrl+↩ | insert line after |
| var eventUtility = { | |
| addEvent : (function() { | |
| if (typeof addEventListener !== "undefined") { | |
| return function(obj, evt, fn) { | |
| obj.addEventListener(evt, fn, false); | |
| }; | |
| } else { | |
| return function(obj, evt, fn) { | |
| obj.attachEvent("on" + evt, fn); | |
| }; |
| function addClass(el, cls) { | |
| var c = el.className.split(' '); | |
| for (var i=0; i<c.length; i++) { | |
| if (c[i] == cls) return; | |
| } | |
| c.push(cls); | |
| el.className = c.join(' '); | |
| } | |
| function removeClass(el, cls) { |
| function getIEComputedStyle(elem, prop) { | |
| var value = elem.currentStyle[prop] || 0 | |
| // we use 'left' property as a place holder so backup values | |
| var leftCopy = elem.style.left | |
| var runtimeLeftCopy = elem.runtimeStyle.left | |
| // assign to runtimeStyle and get pixel value | |
| elem.runtimeStyle.left = elem.currentStyle.left | |
| elem.style.left = (prop === "fontSize") ? "1em" : value |
| function outputAttributes (element) { | |
| var pairs = {}, | |
| attrName, | |
| attrValue, | |
| i, | |
| len; | |
| for ( i = 0, len = element.attributes.length; i < len; i++ ) { | |
| attrName = element.attributes[i].nodeName; | |
| attrValue = element.attributes[i].nodeValue; |
| * html body { | |
| /* IE6 behavior must be in HEAD */ | |
| /* http://www.xs4all.nl/~peterned/csshover.html */ | |
| behavior:url("csshover.htc"); | |
| } |
| function fixEvent(e) { | |
| e = e || window.event; | |
| if (!e.target) e.target = e.srcElement; | |
| if (e.pageX == null && e.clientX != null ) { // если нет pageX.. | |
| var html = document.documentElement; | |
| var body = document.body; | |
| e.pageX = e.clientX + (html.scrollLeft || body && body.scrollLeft || 0); |
| function getCoords(elem) { | |
| var box = elem.getBoundingClientRect(); | |
| var body = document.body; | |
| var docEl = document.documentElement; | |
| var scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop; | |
| var scrollLeft = window.pageXOffset || docEl.scrollLeft || body.scrollLeft; | |
| var clientTop = docEl.clientTop || body.clientTop || 0; |
| function fixEvent(e, _this) { | |
| e = e || window.event; | |
| if (!e.currentTarget) e.currentTarget = _this; | |
| if (!e.target) e.target = e.srcElement; | |
| if (!e.relatedTarget) { | |
| if (e.type == 'mouseover') e.relatedTarget = e.fromElement; | |
| if (e.type == 'mouseout') e.relatedTarget = e.toElement; | |
| } |