Requires

Provides

Desktop.js

Simple desktop emulation

License:
Public domain (http://unlicense.org).
  1. 49
  2. 50
  3. 51
  4. 52
  5. 53
  6. 54
  7. 55
  8. 56
  9. 57
  10. 58
  11. 59
  12. 60
  13. 61
  14. 62
  15. 63
  16. 64
  17. 65
  18. 66
  19. 67
  20. 68
  21. 69
  22. 70
  23. 71
  24. 72
  25. 73
  26. 74
  27. 75
  28. 76
  29. 77
  30. 78
  31. 79
  32. 80
  33. 81
  34. 82
  35. 83
  36. 84
  37. 85
  38. 86
  39. 87
  40. 88
  41. 89
  42. 90
  43. 91
  44. 92
  45. 93
  46. 94
  47. 95
  48. 96
  49. 97
  50. 98
  51. 99
  52. 100
  53. 101
  54. 102
  55. 103
  56. 104
  57. 105
  58. 106
  59. 107
  60. 108
  61. 109
  62. 110
  63. 111
  64. 112
  65. 113
  66. 114
  67. 115
  68. 116
  69. 117
  70. 118
  71. 119
  72. 120
  73. 121
  74. 122
  75. 123
  76. 124
  77. 125
  78. 126
  79. 127
  80. 128
  81. 129
  82. 130
  83. 131
  84. 132
  85. 133
  86. 134
  87. 135
  88. 136
  89. 137
  90. 138
  91. 139
  92. 140
  93. 141
  94. 142
  95. 143
  96. 144
  97. 145
  98. 146
  99. 147
  100. 148
  101. 149
  102. 150
  103. 151
  104. 152
  105. 153
  106. 154
  107. 155
  108. 156
LSD.Widget.Body.Desktop = new Class({ Extends: LSD.Widget.Body, options: { element: { userSelect: false } } }); LSD.Mixin.Autoselect = new Class({ behaviour: 'menu.autoselect', options: { events: { self: { blur: 'unselectItem' }, focused: { element: { 'mouseover:on(button)': function() { if (!this.selected) this.select(); } } } } } }) LSD.Widget.Menu.Toolbar.Commands = new Class({ Includes: [ LSD.Widget.Menu.Toolbar ], getItems: function() { return this.childNodes; } }); LSD.Widget.Menu.Toolbar.Commands.Menu = new Class({ Extends: LSD.Widget.Menu.Toolbar.Menu, options: { events: { self: { unselect: 'collapse', select: 'expand' } } } }); LSD.Widget.Menu.Toolbar.Commands.Menu.Command = LSD.Widget.Menu.Toolbar.Menu.Command; LSD.Widget.Menu.Toolbar.Notification = new Class({ Extends: LSD.Widget.Menu.Toolbar.Commands, options: { events: { self: { blur: function() { if (this.selectedItem) this.selectedItem.unselect(); } } } } }); LSD.Widget.Menu.Toolbar.Notification.Command = new Class({ Includes: [ LSD.Widget.Button, LSD.Trait.Item.Stateful ] }) LSD.Widget.Menu.Toolbar.Notification.Command.Time = new Class({ Extends: LSD.Widget.Menu.Toolbar.Notification.Command, attach: Macro.onion(function() { this.timer = (function() { this.refresh(); this.timer = this.refresh.periodical(60 * 1000, this); }).delay((60 - (new Date).getSeconds()) * 1000, this); }), detach: Macro.onion(function() { $clear(this.timer) }), render: Macro.onion(function() { var date = (new Date); var bits = [date.getHours(), date.getMinutes()].map(function(bit) { return (bit < 10) ? '0' + bit : bit; }) this.setContent(bits.join(":")); }), }); LSD.Widget.Menu.List.Icons = new Class({ Extends: LSD.Widget.Menu.List, options: { layout: { item: '>item[type=icon]' } }/*, items: [

{ content_type: ‘application/pdf’, name: ‘Presentation.pdf’, size: 1999133 }, { content_type: ‘image/png’, name: ‘valid_icon.png’, size: 12309 }

  1. 167
  2. 168
  3. 169
  4. 170
  5. 171
  6. 172
  7. 173
  8. 174
  9. 175
  10. 176
  11. 177
  12. 178
]*/ }); LSD.Widget.Menu.List.Option.Icon = new Class({ Extends: LSD.Widget.Menu.List.Option, setContent: function(item) { this.parent('<h2>' + item.name + '</h2>' + '<p>' + (item.online ? 'Connected' : 'Not connected') + '</p>'); } }); LSD.Widget.Menu.Toolbar.Dock = LSD.Widget.Menu.Toolbar