Requires

Provides

LSD.js

LSD namespace definition

License:
Public domain (http://unlicense.org).
Authors:
Yaroslaff Fedin
  1. 30
  2. 31
  3. 32
  4. 33
  5. 34
  6. 35
  7. 36
  8. 37
  9. 38
  10. 39
  11. 40
  12. 41
  13. 42
  14. 43
  15. 44
  16. 45
  17. 46
  18. 47
  19. 48
  20. 49
  21. 50
  22. 51
  23. 52
  24. 53
  25. 54
  26. 55
  27. 56
  28. 57
  29. 58
  30. 59
  31. 60
  32. 61
  33. 62
  34. 63
  35. 64
  36. 65
  37. 66
  38. 67
  39. 68
  40. 69
  41. 70
  42. 71
  43. 72
  44. 73
  45. 74
  46. 75
  47. 76
  48. 77
  49. 78
  50. 79
  51. 80
  52. 81
  53. 82
  54. 83
  55. 84
  56. 85
  57. 86
  58. 87
  59. 88
  60. 89
  61. 90
  62. 91
  63. 92
  64. 93
  65. 94
  66. 95
  67. 96
  68. 97
  69. 98
  70. 99
  71. 100
  72. 101
  73. 102
  74. 103
  75. 104
  76. 105
  77. 106
  78. 107
  79. 108
  80. 109
  81. 110
  82. 111
  83. 112
  84. 113
  85. 114
  86. 115
  87. 116
  88. 117
  89. 118
  90. 119
  91. 120
  92. 121
  93. 122
  94. 123
  95. 124
  96. 125
if (!window.console) window.console = {}; if (!window.console.log) window.console.log = function() {}; var LSD = Object.append(new Events, { Events: {}, Attributes: { Ignore: new FastArray, Numeric: new FastArray('tabindex', 'width', 'height') }, Styles: {}, States: { Known: { built: {enabler: 'build', disabler: 'destroy', reflect: false}, attached: {enabler: 'attach', disabler: 'detach', reflect: false}, dirty: {enabler: 'update', disabler: 'render', reflect: false}, hidden: {enabler: 'hide', disabler: 'show'}, disabled: {enabler: 'disable', disabler: 'enable'}, focused: {enabler: 'focus', disabler: 'blur'}, selected: {enabler: 'select', disabler: 'unselect'}, checked: {enabler: 'check', disabler: 'uncheck', toggler: 'toggle'}, expanded: {enabler: 'expand', disabler: 'collapse', toggler: 'toggle'}, working: {enabler: 'busy', disabler: 'idle'}, chosen: {enabler: 'choose', disabler: 'forget'} }, Positive: { disabled: 'disabled', focused: 'focused' }, Negative: { enabled: 'disabled', blured: 'focused' }, Attributes: new FastArray, Classes: { disabled: 'disabled', selected: 'selected' } }, Layers: { shadow: ['size', 'radius', 'shape', 'shadow'], stroke: [ 'radius', 'stroke', 'shape', 'fill'], background: ['size', 'radius', 'stroke', 'offset', 'shape', 'color'], foreground: ['size', 'radius', 'stroke', 'offset', 'shape', 'color'], reflection: ['size', 'radius', 'stroke', 'offset', 'shape', 'color'], icon: ['size', 'scale', 'color', 'stroke', 'offset', 'shape', 'position','shadow'], glyph: ['size', 'scale', 'color', 'stroke', 'offset', 'shape', 'position', 'shadow'] }, useNative: true }); Object.append(LSD, { position: function(box, size, x, y) { var position = {x: 0, y: 0}; switch (x) { case "left": position.x = 0; case "right": position.x = box.width - size.width; case "center": position.x = (box.width - size.width) / 2; } switch (y) { case "top": position.y = 0; case "bottom": position.y = box.height - size.height; case "center": position.y = (box.height- size.height) / 2; } return position; }, toLowerCase: function(lowercased) { return function(string) { return (lowercased[string]) || (lowercased[string] = string.toLowerCase()) } }(LSD.lowercased = {}), capitalize: function(capitalized) { return function(string) { return (capitalized[string]) || (capitalized[string] = string.capitalize()) } }(LSD.capitalized = {}), toClassName: function(classnamed) { return function(string) { return (classnamed[string]) || (classnamed[string] = string.replace(/(^|-)([a-z])/g, function(a, b, c) { return (b ? '.' : '') + c.toUpperCase()})) } }(LSD.classnamed = {}) }); States.get = function(name) { return LSD.States.Known[name]; }