fume 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. data/VERSION.yml +1 -1
  2. data/fume.gemspec +12 -35
  3. data/generators/fume/simple_theme/templates/public/demo.html +42 -6
  4. data/generators/fume/simple_theme/templates/public/javascripts/jquery.corner-2.03.js +203 -0
  5. data/generators/fume/simple_theme/templates/public/javascripts/jquery.timepicker-0.2.1.js +413 -0
  6. data/generators/fume/simple_theme/templates/public/javascripts/simple-theme-ie-patch.js +19 -0
  7. data/generators/fume/simple_theme/templates/public/stylesheets/simple-theme.css +122 -175
  8. data/generators/fume/simple_theme/templates/public/stylesheets/simple-theme.less +21 -3
  9. data/generators/fume/simple_theme/templates/public/stylesheets/src/base.less +9 -0
  10. data/generators/fume/simple_theme/templates/public/stylesheets/src/function.less +17 -0
  11. data/generators/fume/simple_theme/templates/public/stylesheets/{layout.less → src/layout.less} +30 -11
  12. data/generators/fume/simple_theme/templates/public/stylesheets/src/reset.less +18 -0
  13. data/generators/fume/simple_theme/templates/public/stylesheets/src/vendor/yui-3.0/base.css +80 -0
  14. data/generators/fume/simple_theme/templates/public/stylesheets/src/vendor/yui-3.0/fonts.css +47 -0
  15. data/generators/fume/simple_theme/templates/public/stylesheets/src/vendor/yui-3.0/reset.css +126 -0
  16. metadata +12 -35
  17. data/generators/fume/simple_theme/templates/public/stylesheets/base.less +0 -49
  18. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/ie.css +0 -27
  19. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/plugins/buttons/icons/cross.png +0 -0
  20. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/plugins/buttons/icons/key.png +0 -0
  21. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/plugins/buttons/icons/tick.png +0 -0
  22. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/plugins/buttons/readme.txt +0 -32
  23. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/plugins/buttons/screen.css +0 -97
  24. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/plugins/fancy-type/readme.txt +0 -14
  25. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/plugins/fancy-type/screen.css +0 -71
  26. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/plugins/link-icons/icons/doc.png +0 -0
  27. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/plugins/link-icons/icons/email.png +0 -0
  28. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/plugins/link-icons/icons/external.png +0 -0
  29. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/plugins/link-icons/icons/feed.png +0 -0
  30. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/plugins/link-icons/icons/im.png +0 -0
  31. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/plugins/link-icons/icons/pdf.png +0 -0
  32. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/plugins/link-icons/icons/visited.png +0 -0
  33. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/plugins/link-icons/icons/xls.png +0 -0
  34. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/plugins/link-icons/readme.txt +0 -18
  35. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/plugins/link-icons/screen.css +0 -40
  36. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/plugins/rtl/readme.txt +0 -10
  37. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/plugins/rtl/screen.css +0 -109
  38. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/print.css +0 -30
  39. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/screen.css +0 -251
  40. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/src/forms.css +0 -49
  41. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/src/grid.css +0 -269
  42. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/src/grid.png +0 -0
  43. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/src/ie.css +0 -61
  44. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/src/print.css +0 -85
  45. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/src/reset.css +0 -38
  46. data/generators/fume/simple_theme/templates/public/stylesheets/blueprint-0.9.1/src/typography.css +0 -105
  47. data/generators/fume/simple_theme/templates/public/stylesheets/drastic-dark.less +0 -0
  48. data/generators/fume/simple_theme/templates/public/stylesheets/ie_patch.less +0 -4
@@ -0,0 +1,413 @@
1
+ /*!
2
+ * jQuery UI Timepicker 0.2.1
3
+ *
4
+ * Copyright (c) 2009 Martin Milesich (http://milesich.com/)
5
+ *
6
+ * Some parts are
7
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
8
+ *
9
+ * $Id: timepicker.js 28 2009-08-11 20:31:23Z majlo $
10
+ *
11
+ * Depends:
12
+ * ui.core.js
13
+ * ui.datepicker.js
14
+ * ui.slider.js
15
+ */
16
+ (function($) {
17
+
18
+ /**
19
+ * Extending default values
20
+ */
21
+ $.extend($.datepicker._defaults, {
22
+ 'stepMinutes': 1, // Number of minutes to step up/down
23
+ 'stepHours': 1, // Number of hours to step up/down
24
+ 'time24h': false, // True if 24h time
25
+ 'showTime': false, // Show timepicker with datepicker
26
+ 'altTimeField': '' // Selector for an alternate field to store time into
27
+ });
28
+
29
+ /**
30
+ * _hideDatepicker must be called with null
31
+ */
32
+ $.datepicker._connectDatepickerOverride = $.datepicker._connectDatepicker;
33
+ $.datepicker._connectDatepicker = function(target, inst) {
34
+ $.datepicker._connectDatepickerOverride(target, inst);
35
+
36
+ // showButtonPanel is required with timepicker
37
+ if (this._get(inst, 'showTime')) {
38
+ inst.settings['showButtonPanel'] = true;
39
+ }
40
+
41
+ var showOn = this._get(inst, 'showOn');
42
+
43
+ if (showOn == 'button' || showOn == 'both') {
44
+ // Unbind all click events
45
+ inst.trigger.unbind('click');
46
+
47
+ // Bind new click event
48
+ inst.trigger.click(function() {
49
+ if ($.datepicker._datepickerShowing && $.datepicker._lastInput == target)
50
+ $.datepicker._hideDatepicker(null); // This override is all about the "null"
51
+ else
52
+ $.datepicker._showDatepicker(target);
53
+ return false;
54
+ });
55
+ }
56
+ };
57
+
58
+ /**
59
+ * Datepicker does not have an onShow event so I need to create it.
60
+ * What I actually doing here is copying original _showDatepicker
61
+ * method to _showDatepickerOverload method.
62
+ */
63
+ $.datepicker._showDatepickerOverride = $.datepicker._showDatepicker;
64
+ $.datepicker._showDatepicker = function (input) {
65
+ // Call the original method which will show the datepicker
66
+ $.datepicker._showDatepickerOverride(input);
67
+
68
+ input = input.target || input;
69
+
70
+ // find from button/image trigger
71
+ if (input.nodeName.toLowerCase() != 'input') input = $('input', input.parentNode)[0];
72
+
73
+ // Do not show timepicker if datepicker is disabled
74
+ if ($.datepicker._isDisabledDatepicker(input)) return;
75
+
76
+ // Get instance to datepicker
77
+ var inst = $.datepicker._getInst(input);
78
+
79
+ var showTime = $.datepicker._get(inst, 'showTime');
80
+
81
+ // If showTime = True show the timepicker
82
+ if (showTime) $.timepicker.show(input);
83
+ };
84
+
85
+ /**
86
+ * Same as above. Here I need to extend the _checkExternalClick method
87
+ * because I don't want to close the datepicker when the sliders get focus.
88
+ */
89
+ $.datepicker._checkExternalClickOverride = $.datepicker._checkExternalClick;
90
+ $.datepicker._checkExternalClick = function (event) {
91
+ if (!$.datepicker._curInst) return;
92
+ var $target = $(event.target);
93
+
94
+ if (($target.parents('#' + $.timepicker._mainDivId).length == 0)) {
95
+ $.datepicker._checkExternalClickOverride(event);
96
+ }
97
+ };
98
+
99
+ /**
100
+ * Datepicker has onHide event but I just want to make it simple for you
101
+ * so I hide the timepicker when datepicker hides.
102
+ */
103
+ $.datepicker._hideDatepickerOverride = $.datepicker._hideDatepicker;
104
+ $.datepicker._hideDatepicker = function(input, duration) {
105
+ // Some lines from the original method
106
+ var inst = this._curInst;
107
+
108
+ if (!inst || (input && inst != $.data(input, PROP_NAME))) return;
109
+
110
+ // Get the value of showTime property
111
+ var showTime = this._get(inst, 'showTime');
112
+
113
+ if (input === undefined && showTime) {
114
+ if (inst.input) {
115
+ inst.input.val(this._formatDate(inst));
116
+ inst.input.trigger('change'); // fire the change event
117
+ }
118
+
119
+ this._updateAlternate(inst);
120
+
121
+ if (showTime) $.timepicker.update(this._formatDate(inst));
122
+ }
123
+
124
+ // Hide datepicker
125
+ $.datepicker._hideDatepickerOverride(input, duration);
126
+
127
+ // Hide the timepicker if enabled
128
+ if (showTime) {
129
+ $.timepicker.hide();
130
+ }
131
+ };
132
+
133
+ /**
134
+ * This is a complete replacement of the _selectDate method.
135
+ * If showed with timepicker do not close when date is selected.
136
+ */
137
+ $.datepicker._selectDate = function(id, dateStr) {
138
+ var target = $(id);
139
+ var inst = this._getInst(target[0]);
140
+ var showTime = this._get(inst, 'showTime');
141
+ dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
142
+ if (!showTime) {
143
+ if (inst.input)
144
+ inst.input.val(dateStr);
145
+ this._updateAlternate(inst);
146
+ }
147
+ var onSelect = this._get(inst, 'onSelect');
148
+ if (onSelect)
149
+ onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback
150
+ else if (inst.input && !showTime)
151
+ inst.input.trigger('change'); // fire the change event
152
+ if (inst.inline)
153
+ this._updateDatepicker(inst);
154
+ else if (!inst.stayOpen) {
155
+ if (showTime) {
156
+ this._updateDatepicker(inst);
157
+ } else {
158
+ this._hideDatepicker(null, this._get(inst, 'duration'));
159
+ this._lastInput = inst.input[0];
160
+ if (typeof(inst.input[0]) != 'object')
161
+ inst.input[0].focus(); // restore focus
162
+ this._lastInput = null;
163
+ }
164
+ }
165
+ };
166
+
167
+ /**
168
+ * We need to resize the timepicker when the datepicker has been changed.
169
+ */
170
+ $.datepicker._updateDatepickerOverride = $.datepicker._updateDatepicker;
171
+ $.datepicker._updateDatepicker = function(inst) {
172
+ $.datepicker._updateDatepickerOverride(inst);
173
+ $.timepicker.resize();
174
+ };
175
+
176
+ function Timepicker() {}
177
+
178
+ Timepicker.prototype = {
179
+ init: function()
180
+ {
181
+ this._mainDivId = 'ui-timepicker-div';
182
+ this._inputId = null;
183
+ this._orgValue = null;
184
+ this._orgHour = null;
185
+ this._orgMinute = null;
186
+ this._colonPos = -1;
187
+ this._visible = false;
188
+ this.tpDiv = $('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible" style="width: 100px; display: none; position: absolute;"></div>');
189
+ this._generateHtml();
190
+ },
191
+
192
+ show: function (input)
193
+ {
194
+ // Get instance to datepicker
195
+ var inst = $.datepicker._getInst(input);
196
+
197
+ this._time24h = $.datepicker._get(inst, 'time24h');
198
+ this._altTimeField = $.datepicker._get(inst, 'altTimeField');
199
+
200
+ var stepMinutes = parseInt($.datepicker._get(inst, 'stepMinutes'), 10) || 1;
201
+ var stepHours = parseInt($.datepicker._get(inst, 'stepHours'), 10) || 1;
202
+
203
+ if (60 % stepMinutes != 0) { stepMinutes = 1; }
204
+ if (24 % stepHours != 0) { stepHours = 1; }
205
+
206
+ $('#hourSlider').slider('option', 'max', 24 - stepHours);
207
+ $('#hourSlider').slider('option', 'step', stepHours);
208
+
209
+ $('#minuteSlider').slider('option', 'max', 60 - stepMinutes);
210
+ $('#minuteSlider').slider('option', 'step', stepMinutes);
211
+
212
+ this._inputId = input.id;
213
+
214
+ if (!this._visible) {
215
+ this._parseTime();
216
+ this._orgValue = $('#' + this._inputId).val();
217
+ }
218
+
219
+ this.resize();
220
+
221
+ $('#' + this._mainDivId).show();
222
+
223
+ this._visible = true;
224
+
225
+ var dpDiv = $('#' + $.datepicker._mainDivId);
226
+ var dpDivPos = dpDiv.position();
227
+
228
+ var viewWidth = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) + $(document).scrollLeft();
229
+ var tpRight = this.tpDiv.offset().left + this.tpDiv.outerWidth();
230
+
231
+ if (tpRight > viewWidth) {
232
+ dpDiv.css('left', dpDivPos.left - (tpRight - viewWidth) - 5);
233
+ this.tpDiv.css('left', dpDiv.offset().left + dpDiv.outerWidth() + 'px');
234
+ }
235
+ },
236
+
237
+ update: function (fd)
238
+ {
239
+ var curTime = $('#' + this._mainDivId + ' span.fragHours').text()
240
+ + ':'
241
+ + $('#' + this._mainDivId + ' span.fragMinutes').text();
242
+
243
+ if (!this._time24h) {
244
+ curTime += ' ' + $('#' + this._mainDivId + ' span.fragAmpm').text();
245
+ }
246
+
247
+ var curDate = $('#' + this._inputId).val();
248
+
249
+ $('#' + this._inputId).val(fd + ' ' + curTime);
250
+
251
+ if (this._altTimeField) {
252
+ $(this._altTimeField).each(function() { $(this).val(curTime); });
253
+ }
254
+ },
255
+
256
+ hide: function ()
257
+ {
258
+ this._visible = false;
259
+ $('#' + this._mainDivId).hide();
260
+ },
261
+
262
+ resize: function ()
263
+ {
264
+ var dpDiv = $('#' + $.datepicker._mainDivId);
265
+ var dpDivPos = dpDiv.position();
266
+
267
+ var hdrHeight = $('#' + $.datepicker._mainDivId + ' > div.ui-datepicker-header:first-child').height();
268
+
269
+ $('#' + this._mainDivId + ' > div.ui-datepicker-header:first-child').css('height', hdrHeight);
270
+
271
+ this.tpDiv.css({
272
+ 'height': dpDiv.height(),
273
+ 'top' : dpDivPos.top,
274
+ 'left' : dpDivPos.left + dpDiv.outerWidth() + 'px'
275
+ });
276
+
277
+ $('#hourSlider').css('height', this.tpDiv.height() - (3.5 * hdrHeight));
278
+ $('#minuteSlider').css('height', this.tpDiv.height() - (3.5 * hdrHeight));
279
+ },
280
+
281
+ _generateHtml: function ()
282
+ {
283
+ var html = '';
284
+
285
+ html += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all">';
286
+ html += '<div class="ui-datepicker-title" style="margin:0">';
287
+ html += '<span class="fragHours">08</span><span class="delim">:</span><span class="fragMinutes">45</span> <span class="fragAmpm"></span></div></div><table>';
288
+ html += '<tr><th>Hour</th><th>Minute</th></tr>';
289
+ html += '<tr><td align="center"><div id="hourSlider" class="slider"></div></td><td align="center"><div id="minuteSlider" class="slider"></div></td></tr>';
290
+ html += '</table>';
291
+
292
+ this.tpDiv.empty().append(html);
293
+ $('body').append(this.tpDiv);
294
+
295
+ var self = this;
296
+
297
+ $('#hourSlider').slider({
298
+ orientation: "vertical",
299
+ range: 'min',
300
+ min: 0,
301
+ max: 23,
302
+ step: 1,
303
+ slide: function(event, ui) {
304
+ self._writeTime('hour', ui.value);
305
+ },
306
+ stop: function(event, ui) {
307
+ $('#' + self._inputId).focus();
308
+ }
309
+ });
310
+
311
+ $('#minuteSlider').slider({
312
+ orientation: "vertical",
313
+ range: 'min',
314
+ min: 0,
315
+ max: 59,
316
+ step: 1,
317
+ slide: function(event, ui) {
318
+ self._writeTime('minute', ui.value);
319
+ },
320
+ stop: function(event, ui) {
321
+ $('#' + self._inputId).focus();
322
+ }
323
+ });
324
+
325
+ $('#hourSlider > a').css('padding', 0);
326
+ $('#minuteSlider > a').css('padding', 0);
327
+ },
328
+
329
+ _writeTime: function (type, value)
330
+ {
331
+ if (type == 'hour') {
332
+ if (!this._time24h) {
333
+ if (value < 12) {
334
+ $('#' + this._mainDivId + ' span.fragAmpm').text('am');
335
+ } else {
336
+ $('#' + this._mainDivId + ' span.fragAmpm').text('pm');
337
+ value -= 12;
338
+ }
339
+
340
+ if (value == 0) value = 12;
341
+ } else {
342
+ $('#' + this._mainDivId + ' span.fragAmpm').text('');
343
+ }
344
+
345
+ if (value < 10) value = '0' + value;
346
+ $('#' + this._mainDivId + ' span.fragHours').text(value);
347
+ }
348
+
349
+ if (type == 'minute') {
350
+ if (value < 10) value = '0' + value;
351
+ $('#' + this._mainDivId + ' span.fragMinutes').text(value);
352
+ }
353
+ },
354
+
355
+ _parseTime: function ()
356
+ {
357
+ var dt = $('#' + this._inputId).val();
358
+
359
+ this._colonPos = dt.search(':');
360
+
361
+ var m = 0, h = 0, a = '';
362
+
363
+ if (this._colonPos != -1) {
364
+ h = parseInt(dt.substr(this._colonPos - 2, 2), 10);
365
+ m = parseInt(dt.substr(this._colonPos + 1, 2), 10);
366
+ a = jQuery.trim(dt.substr(this._colonPos + 3, 3));
367
+ }
368
+
369
+ a = a.toLowerCase();
370
+
371
+ if (a != 'am' && a != 'pm') {
372
+ a = '';
373
+ }
374
+
375
+ if (h < 0) h = 0;
376
+ if (m < 0) m = 0;
377
+
378
+ if (h > 23) h = 23;
379
+ if (m > 59) m = 59;
380
+
381
+ if (a == 'pm' && h < 12) h += 12;
382
+ if (a == 'am' && h == 12) h = 0;
383
+
384
+ this._setTime('hour', h);
385
+ this._setTime('minute', m);
386
+
387
+ this._orgHour = h;
388
+ this._orgMinute = m;
389
+ },
390
+
391
+ _setTime: function (type, value)
392
+ {
393
+ if (isNaN(value)) value = 0;
394
+ if (value < 0) value = 0;
395
+ if (value > 23 && type == 'hour') value = 23;
396
+ if (value > 59 && type == 'minute') value = 59;
397
+
398
+ if (type == 'hour') {
399
+ $('#hourSlider').slider('value', value);
400
+ }
401
+
402
+ if (type == 'minute') {
403
+ $('#minuteSlider').slider('value', value);
404
+ }
405
+
406
+ this._writeTime(type, value);
407
+ }
408
+ };
409
+
410
+ $.timepicker = new Timepicker();
411
+ $('document').ready(function () {$.timepicker.init();});
412
+
413
+ })(jQuery);
@@ -0,0 +1,19 @@
1
+ $(function() {
2
+ if ($.browser.msie) {
3
+ $(".block").corner("top 6px");
4
+ $("#main-navigation, #main-navigation .active").corner("top 6px");
5
+ $("#footer .block").corner("round 6px");
6
+ $(".table th.first").corner("tl 6px");
7
+ $(".table th.last").corner("tr 6px");
8
+
9
+ $(".jquery-corner").css("z-index", "5");
10
+ $("#user-navigation").css("z-index", "10");
11
+
12
+ if ($.browser.version == "6.0") {
13
+ $("#header, #page").css({
14
+ width: $("#container").css("min-width"),
15
+ margin: "0 auto"
16
+ });
17
+ }
18
+ }
19
+ });