rsence 2.1.11 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/INSTALL.rdoc +5 -3
- data/README.rdoc +23 -22
- data/VERSION +1 -1
- data/conf/default_conf.yaml +65 -29
- data/conf/rsence_command_strings.yaml +101 -71
- data/js/comm/autosync/autosync.js +3 -3
- data/js/comm/jsloader/jsloader.js +16 -3
- data/js/comm/queue/queue.js +1 -1
- data/js/comm/transporter/transporter.js +106 -83
- data/js/comm/values/values.js +8 -2
- data/js/controls/button/button.js +9 -4
- data/js/controls/button/themes/default/button.css +1 -1
- data/js/controls/checkbox/themes/default/checkbox.css +1 -1
- data/js/controls/dialogs/sheet/sheet.js +27 -18
- data/js/controls/radiobutton/themes/default/radiobutton.css +1 -1
- data/js/controls/searchfield/searchfield.coffee +2 -0
- data/js/controls/searchfield/themes/default/searchfield.css +96 -0
- data/js/controls/searchfield/themes/default/searchfield.html +12 -0
- data/js/controls/searchfield/themes/default/searchfield_parts1-ie6.gif +0 -0
- data/js/controls/searchfield/themes/default/searchfield_parts1.png +0 -0
- data/js/controls/sliders/slider/slider.js +7 -1
- data/js/controls/stepper/stepper.js +6 -1
- data/js/controls/stringview/stringview.js +50 -39
- data/js/controls/tab/tab.js +103 -7
- data/js/controls/tab/themes/default/tab.css +2 -0
- data/js/controls/textarea/themes/default/textarea.css +4 -0
- data/js/controls/textcontrol/textcontrol.js +32 -2
- data/js/controls/textcontrol/themes/default/textcontrol.css +17 -2
- data/js/controls/uploader/themes/default/uploader.css +3 -3
- data/js/controls/uploader/themes/default/uploader.html +1 -1
- data/js/controls/uploader/uploader.coffee +110 -0
- data/js/controls/window/themes/default/window.css +28 -5
- data/js/controls/window/themes/default/window.html +2 -0
- data/js/controls/window/window.js +5 -1
- data/js/core/class/class.js +22 -4
- data/js/core/elem/elem.coffee +816 -0
- data/js/core/event/event.js +2 -2
- data/js/core/rsence_ns/rsence_ns.coffee +31 -0
- data/js/core/rsence_ns/rsence_ns.js +6 -6
- data/js/datetime/calendar/calendar.coffee +307 -0
- data/js/datetime/calendar/themes/default/calendar.css +90 -9
- data/js/datetime/calendar/themes/default/calendar.html +11 -0
- data/js/datetime/calendar/themes/default/calendar_bg-ie6.gif +0 -0
- data/js/datetime/calendar/themes/default/calendar_bg.png +0 -0
- data/js/datetime/calendar/themes/default/calendar_parts1-ie6.gif +0 -0
- data/js/datetime/calendar/themes/default/calendar_parts1.png +0 -0
- data/js/datetime/calendar/themes/default/calendar_parts2-ie6.gif +0 -0
- data/js/datetime/calendar/themes/default/calendar_parts2.png +0 -0
- data/js/datetime/datetimepicker/datetimepicker.js +217 -0
- data/js/datetime/datetimevalue/datetimevalue.js +22 -5
- data/js/datetime/timesheet/themes/default/timesheet.css +51 -22
- data/js/datetime/timesheet/themes/default/timesheet.html +4 -2
- data/js/datetime/timesheet/timesheet.js +782 -192
- data/js/datetime/timesheet_item/themes/default/timesheet_item.css +42 -11
- data/js/datetime/timesheet_item/themes/default/timesheet_item.html +4 -2
- data/js/datetime/timesheet_item/themes/default/timesheet_item_icons.png +0 -0
- data/js/datetime/timesheet_item/timesheet_item.js +158 -254
- data/js/datetime/timesheet_item_edit/timesheet_item_edit.js +0 -274
- data/js/foundation/application/application.js +52 -9
- data/js/foundation/control/eventresponder/eventresponder.js +7 -4
- data/js/foundation/control/valueaction/valueaction.js +71 -0
- data/js/foundation/eventmanager/eventmanager.js +71 -33
- data/js/foundation/geom/rect/rect.js +39 -7
- data/js/foundation/json_renderer/json_renderer.js +278 -62
- data/js/foundation/locale_settings/locale_settings.js +131 -0
- data/js/foundation/system/system.js +40 -13
- data/js/foundation/thememanager/thememanager.js +21 -0
- data/js/foundation/view/markupview/markupview.js +12 -12
- data/js/foundation/view/view.js +221 -27
- data/js/graphics/svgcontrol/svgcontrol.js +400 -0
- data/js/lists/checkboxlist/checkboxlist.js +18 -7
- data/js/lists/listitems/listitems.js +52 -38
- data/js/lists/radiobuttonlist/radiobuttonlist.js +23 -7
- data/js/menus/menuitem/menuitem.js +5 -0
- data/js/menus/menuitem/themes/default/menuitem.css +45 -0
- data/js/menus/menuitem/themes/default/menuitem.html +4 -0
- data/js/menus/minimenu/minimenu.js +47 -16
- data/js/menus/minimenuitem/minimenuitem.js +62 -0
- data/js/menus/{minimenu/minimenuitem → minimenuitem}/themes/default/minimenuitem.css +2 -2
- data/js/menus/{minimenu/minimenuitem → minimenuitem}/themes/default/minimenuitem.html +0 -0
- data/js/menus/{minimenu/minimenuitem → minimenuitem}/themes/default/minimenuitem_checkmark.png +0 -0
- data/js/menus/popupmenu/popupmenu.js +14 -0
- data/js/menus/popupmenu/themes/default/popupmenu.css +65 -0
- data/js/menus/popupmenu/themes/default/popupmenu.html +7 -0
- data/js/menus/popupmenu/themes/default/popupmenu.png +0 -0
- data/js/no_pkg/no_pkg.js +2 -0
- data/js/util/reloadapp/reloadapp.js +1 -1
- data/js/views/scrollview/scrollview.js +6 -0
- data/lib/rsence.rb +136 -3
- data/lib/rsence/argv.rb +218 -0
- data/lib/rsence/argv/argv_util.rb +58 -0
- data/lib/rsence/argv/env_check.rb +58 -0
- data/lib/rsence/argv/help_argv.rb +15 -0
- data/lib/rsence/argv/initenv_argv.rb +218 -0
- data/lib/rsence/argv/save_argv.rb +92 -0
- data/lib/rsence/argv/startup_argv.rb +118 -0
- data/lib/rsence/argv/status_argv.rb +132 -0
- data/lib/rsence/argv/test_port.rb +32 -0
- data/lib/{daemon → rsence}/daemon.rb +67 -23
- data/lib/{conf/default.rb → rsence/default_config.rb} +18 -10
- data/lib/{plugins → rsence}/dependencies.rb +0 -0
- data/lib/{util → rsence}/gzstring.rb +0 -0
- data/lib/rsence/http.rb +3 -0
- data/lib/{http → rsence/http}/broker.rb +106 -19
- data/lib/{http → rsence/http}/rackup.rb +0 -0
- data/lib/{http → rsence/http}/request.rb +0 -4
- data/lib/{http → rsence/http}/response.rb +0 -1
- data/lib/{session → rsence}/msg.rb +17 -1
- data/lib/{plugins → rsence}/pluginmanager.rb +29 -12
- data/lib/{plugins → rsence}/plugins.rb +7 -7
- data/lib/{plugins → rsence/plugins}/gui_plugin.rb +8 -3
- data/lib/{plugins → rsence/plugins}/guiparser.rb +9 -6
- data/lib/{plugins → rsence/plugins}/plugin.rb +23 -4
- data/lib/{plugins → rsence/plugins}/plugin_base.rb +11 -1
- data/lib/{plugins → rsence/plugins}/plugin_plugins.rb +2 -2
- data/lib/{plugins → rsence/plugins}/plugin_sqlite_db.rb +0 -0
- data/lib/{plugins → rsence/plugins}/servlet.rb +0 -0
- data/lib/{session → rsence}/sessionmanager.rb +101 -39
- data/lib/{session → rsence}/sessionstorage.rb +30 -16
- data/lib/{daemon → rsence}/sigcomm.rb +0 -0
- data/lib/{transporter → rsence}/transporter.rb +13 -11
- data/lib/{values/hvalue.rb → rsence/value.rb} +6 -1
- data/lib/{values → rsence}/valuemanager.rb +1 -1
- data/plugins/client_pkg/client_pkg.rb +14 -4
- data/plugins/client_pkg/info.yaml +2 -2
- data/plugins/client_pkg/lib/client_pkg_build.rb +145 -45
- data/plugins/client_pkg/lib/client_pkg_cache.rb +1 -1
- data/plugins/client_pkg/lib/client_pkg_serve.rb +1 -1
- data/plugins/main/main.rb +43 -3
- data/plugins/main/tmpl/index.html +2 -10
- data/plugins/main/values.yaml +3 -1
- data/plugins/ticket/lib/common.rb +6 -3
- data/plugins/ticket/ticket.rb +11 -3
- metadata +144 -174
- data/js/comm/autosync/js.inc +0 -0
- data/js/comm/js.inc +0 -0
- data/js/comm/jsloader/js.inc +0 -0
- data/js/comm/queue/js.inc +0 -0
- data/js/comm/session/js.inc +0 -0
- data/js/comm/sessionwatcher/js.inc +0 -0
- data/js/comm/transporter/js.inc +0 -0
- data/js/comm/urlresponder/js.inc +0 -0
- data/js/comm/values/js.inc +0 -0
- data/js/controls/button/js.inc +0 -0
- data/js/controls/checkbox/js.inc +0 -0
- data/js/controls/dialogs/alert_sheet/js.inc +0 -0
- data/js/controls/dialogs/confirm_sheet/js.inc +0 -0
- data/js/controls/dialogs/sheet/js.inc +0 -0
- data/js/controls/imageview/js.inc +0 -0
- data/js/controls/passwordcontrol/js.inc +0 -0
- data/js/controls/progress/progressbar/js.inc +0 -0
- data/js/controls/progress/progressindicator/js.inc +0 -0
- data/js/controls/radiobutton/js.inc +0 -0
- data/js/controls/sliders/slider/js.inc +0 -0
- data/js/controls/sliders/vslider/js.inc +0 -0
- data/js/controls/stepper/js.inc +0 -0
- data/js/controls/stringview/js.inc +0 -0
- data/js/controls/tab/js.inc +0 -0
- data/js/controls/textarea/js.inc +0 -0
- data/js/controls/textcontrol/js.inc +0 -0
- data/js/controls/uploader/js.inc +0 -0
- data/js/controls/uploader/uploader.js +0 -154
- data/js/controls/validatorview/js.inc +0 -0
- data/js/controls/window/js.inc +0 -0
- data/js/core/class/js.inc +0 -0
- data/js/core/elem/elem.js +0 -1325
- data/js/core/elem/js.inc +0 -0
- data/js/core/event/js.inc +0 -0
- data/js/core/iefix/js.inc +0 -0
- data/js/core/rsence_ns/js.inc +0 -0
- data/js/datetime/calendar/calendar.js +0 -198
- data/js/datetime/calendar/js.inc +0 -0
- data/js/datetime/datetimevalue/js.inc +0 -0
- data/js/datetime/timesheet/js.inc +0 -0
- data/js/datetime/timesheet/old_timesheet.js +0 -292
- data/js/datetime/timesheet/themes/default/old_timesheet.css +0 -30
- data/js/datetime/timesheet/themes/default/old_timesheet.html +0 -2
- data/js/datetime/timesheet_item/js.inc +0 -0
- data/js/datetime/timesheet_item/old_timesheet_item.js +0 -308
- data/js/datetime/timesheet_item/themes/default/old_timesheet_item.css +0 -42
- data/js/datetime/timesheet_item/themes/default/old_timesheet_item.html +0 -8
- data/js/datetime/timesheet_item_edit/js.inc +0 -0
- data/js/datetime/timesheet_item_edit/old_timesheet_item_edit.js +0 -274
- data/js/foundation/application/js.inc +0 -0
- data/js/foundation/control/controldefaults/js.inc +0 -0
- data/js/foundation/control/dummyvalue/js.inc +0 -0
- data/js/foundation/control/dyncontrol/js.inc +0 -0
- data/js/foundation/control/eventresponder/js.inc +0 -0
- data/js/foundation/control/js.inc +0 -0
- data/js/foundation/control/valuematrix/js.inc +0 -0
- data/js/foundation/control/valueresponder/js.inc +0 -0
- data/js/foundation/eventmanager/js.inc +0 -0
- data/js/foundation/geom/point/js.inc +0 -0
- data/js/foundation/geom/rect/js.inc +0 -0
- data/js/foundation/json_renderer/js.inc +0 -0
- data/js/foundation/system/js.inc +0 -0
- data/js/foundation/thememanager/js.inc +0 -0
- data/js/foundation/value/js.inc +0 -0
- data/js/foundation/view/js.inc +0 -0
- data/js/foundation/view/markupview/js.inc +0 -0
- data/js/foundation/view/morphanimation/js.inc +0 -0
- data/js/foundation/view/viewdefaults/js.inc +0 -0
- data/js/lists/checkboxlist/js.inc +0 -0
- data/js/lists/listitems/js.inc +0 -0
- data/js/lists/propertylist/js.inc +0 -0
- data/js/lists/propertylist/propertylisteditor/js.inc +0 -0
- data/js/lists/radiobuttonlist/js.inc +0 -0
- data/js/menus/minimenu/js.inc +0 -0
- data/js/menus/minimenu/minimenuitem/js.inc +0 -0
- data/js/menus/minimenu/minimenuitem/minimenuitem.js +0 -33
- data/js/util/reloadapp/js.inc +0 -0
- data/js/util/sha/js.inc +0 -0
- data/js/views/centerview/js.inc +0 -0
- data/js/views/inlineview/js.inc +0 -0
- data/js/views/scrollview/js.inc +0 -0
- data/lib/conf/argv.rb +0 -880
data/js/core/event/event.js
CHANGED
@@ -92,7 +92,7 @@ Event = {
|
|
92
92
|
Event.observers = false;
|
93
93
|
},
|
94
94
|
|
95
|
-
/** Starts observing the named event of the element and
|
95
|
+
/** Starts observing the named event of the element and
|
96
96
|
* specifies a callback function.
|
97
97
|
**/
|
98
98
|
observe: function(_elem, _name, _function, _useCapture) {
|
@@ -145,7 +145,7 @@ Event = {
|
|
145
145
|
|
146
146
|
};
|
147
147
|
|
148
|
-
// Activates the garbage collector of Internet Explorer
|
148
|
+
// Activates the garbage collector of Internet Explorer
|
149
149
|
// when the document is unloaded:
|
150
150
|
if (BROWSER_TYPE.ie && !BROWSER_TYPE.ie9) {
|
151
151
|
Event.observe(window, "unload", Event.unloadCache, false);
|
@@ -0,0 +1,31 @@
|
|
1
|
+
|
2
|
+
# The RSence namespace
|
3
|
+
RSence =
|
4
|
+
|
5
|
+
# Call this method from the index page for
|
6
|
+
# client-only features
|
7
|
+
clientConf: (_clientPrefix)->
|
8
|
+
HThemeManager.themePath = _clientPrefix+'/themes'
|
9
|
+
HThemeManager._start()
|
10
|
+
|
11
|
+
# Call this method from the index page to
|
12
|
+
# setup the environment variables and to
|
13
|
+
# start synchronizing immediately afterwards.
|
14
|
+
serverConf: (_clientPrefix, _helloUrl) ->
|
15
|
+
COMM.ClientPrefix = _clientPrefix
|
16
|
+
COMM.Transporter.HelloUrl = _helloUrl
|
17
|
+
RSence.clientConf( _clientPrefix )
|
18
|
+
COMM.AutoSyncStarter.start()
|
19
|
+
null
|
20
|
+
|
21
|
+
# Storage for guiTrees, cantains
|
22
|
+
# JSONRenderer instances by plugin name.
|
23
|
+
guiTrees: {}
|
24
|
+
|
25
|
+
killGuiTree: (_guiName)->
|
26
|
+
_guiTrees = RSence.guiTrees
|
27
|
+
_guiTree = _guiTrees[_guiName]
|
28
|
+
if _guiTree?
|
29
|
+
_guiTree.die()
|
30
|
+
_guiTrees[_guiName] = null
|
31
|
+
delete _guiTrees[_guiName]
|
@@ -6,18 +6,18 @@
|
|
6
6
|
* with this software package. If not, contact licensing@riassence.com
|
7
7
|
*/
|
8
8
|
|
9
|
-
// RSence namespace
|
10
|
-
//
|
11
|
-
|
12
|
-
|
13
|
-
// Additional logic for handling the namespaces will however be required.
|
14
|
-
var RSence = {
|
9
|
+
// RSence client-side namespace initialization.
|
10
|
+
// Current contents are a store for guiTrees and the serverConf method for setting up variables before starting.
|
11
|
+
var
|
12
|
+
RSence = {
|
15
13
|
|
16
14
|
// Configuration method for the html document of the server
|
17
15
|
serverConf: function(_clientPrefix,_helloUrl){
|
18
16
|
COMM.ClientPrefix=_clientPrefix;
|
19
17
|
COMM.Transporter.HelloUrl=_helloUrl;
|
20
18
|
HThemeManager.themePath=_clientPrefix+'/themes';
|
19
|
+
HThemeManager._start();
|
20
|
+
COMM.AutoSyncStarter.start();
|
21
21
|
},
|
22
22
|
|
23
23
|
// Structure reserved for JSONRenderer instances remotely populated by the server
|
@@ -0,0 +1,307 @@
|
|
1
|
+
## RSence
|
2
|
+
# Copyright 2009-2011 Riassence Inc.
|
3
|
+
# http://riassence.com/
|
4
|
+
#
|
5
|
+
# You should have received a copy of the GNU General Public License along
|
6
|
+
# with this software package. If not, contact licensing@riassence.com
|
7
|
+
##
|
8
|
+
|
9
|
+
#### = Description
|
10
|
+
## Use HCalendar to display a month calendar that displays days as columns
|
11
|
+
## and weeks as rows. Its value is a date/time number specified in seconds
|
12
|
+
## since or before epoch (1970-01-01 00:00:00 UTC).
|
13
|
+
####
|
14
|
+
HCalendar = HControl.extend(
|
15
|
+
|
16
|
+
componentName: 'calendar'
|
17
|
+
|
18
|
+
## Disable the mouseWheel event to prevent prev/next -month switching with
|
19
|
+
## the mouse wheel or equivalent content-scrolling user interface gesture
|
20
|
+
defaultEvents:
|
21
|
+
mouseWheel: true
|
22
|
+
click: true
|
23
|
+
|
24
|
+
## Calls HCalendar#nextMonth or HCalendar#prevMonth based on delta change
|
25
|
+
## of the mouseWheel event
|
26
|
+
mouseWheel: (_delta)->
|
27
|
+
if _delta < 0
|
28
|
+
@nextMonth()
|
29
|
+
else
|
30
|
+
@prevMonth()
|
31
|
+
|
32
|
+
## Simple click-through for the themed hyperlinks
|
33
|
+
click: ->
|
34
|
+
false
|
35
|
+
|
36
|
+
## Returns an array of week day names starting with the short name of the word "week".
|
37
|
+
## The default locale returns: ['Wk','Mon','Tue','Wed','Thu','Fri','Sat','Sun']
|
38
|
+
## See HLocale for more details
|
39
|
+
localizedDays: ->
|
40
|
+
_str = HLocale.dateTime.strings
|
41
|
+
_arr = HVM.clone( _str.weekDaysShort )
|
42
|
+
_arr.push( _arr.shift() )
|
43
|
+
_arr.unshift( _str.weekShort )
|
44
|
+
_arr
|
45
|
+
|
46
|
+
_destroyWeekDayElems: ->
|
47
|
+
if @_weekDayElems?
|
48
|
+
for _elemId in @_weekDayElems
|
49
|
+
ELEM.del( _elemId )
|
50
|
+
@_weekDayElems = null
|
51
|
+
|
52
|
+
## Refreshes the week days header
|
53
|
+
refreshWeekDays: ->
|
54
|
+
@_destroyWeekDayElems()
|
55
|
+
_dayNames = @localizedDays()
|
56
|
+
_availWidth = @rect.width-2
|
57
|
+
_dayWidth = Math.floor( _availWidth/8 )
|
58
|
+
_leftOffset = ( _availWidth % 8 ) - 1
|
59
|
+
_parentElem = @markupElemIds.label
|
60
|
+
_dayElems = []
|
61
|
+
for _dayName, i in _dayNames
|
62
|
+
_dayElem = ELEM.make( _parentElem )
|
63
|
+
ELEM.setHTML( _dayElem, _dayName )
|
64
|
+
ELEM.setStyle( _dayElem, 'width', _dayWidth+'px' )
|
65
|
+
_left = i * _dayWidth + _leftOffset
|
66
|
+
ELEM.setStyle( _dayElem, 'left', _left+'px' )
|
67
|
+
@_weekDayElems = _dayElems
|
68
|
+
|
69
|
+
## Calls #refreshWeekDays when theme is applied
|
70
|
+
refreshLabel: ->
|
71
|
+
@refreshWeekDays() if @markupElemIds? and not @_weekDayElems?
|
72
|
+
|
73
|
+
## Calculates the first and last week of the month of the _date
|
74
|
+
##
|
75
|
+
## Params:
|
76
|
+
## - _date: A Date instance to check date range from
|
77
|
+
##
|
78
|
+
## Returns:
|
79
|
+
## [Object]: {
|
80
|
+
## week: {
|
81
|
+
## firstDate: [Date]
|
82
|
+
## lastDate: [Date]
|
83
|
+
## firstNum: [Number]
|
84
|
+
## lastNum: [Number]
|
85
|
+
## count: [Number]
|
86
|
+
## }
|
87
|
+
## month: {
|
88
|
+
## firstDate: [Date]
|
89
|
+
## lastDate: [Date]
|
90
|
+
## }
|
91
|
+
## }
|
92
|
+
calendarDateRange: (_date)->
|
93
|
+
_monthFirst = @firstDateOfMonth( _date )
|
94
|
+
_monthLast = @lastDateOfMonth( _date )
|
95
|
+
_weekFirst = @firstDateOfWeek( _monthFirst )
|
96
|
+
_weekLast = @lastDateOfWeek( _monthLast )
|
97
|
+
_firstWeekNum = @week( _weekFirst )
|
98
|
+
_lastWeekNum = @week( _weekLast )
|
99
|
+
_weeks = _firstWeekNum - _lastWeekNum
|
100
|
+
if _weeks == 5
|
101
|
+
if _weekFirst.getDate() == 1
|
102
|
+
_weekFirst = new Date( _weekFirst.getTime() - @msWeek )
|
103
|
+
else
|
104
|
+
_weekLast = new Date( _weekLast.getTime() + @msWeek )
|
105
|
+
else if _weeks == 4
|
106
|
+
_weekFirst = new Date( _weekFirst.getTime() - @msWeek )
|
107
|
+
return {
|
108
|
+
week: {
|
109
|
+
firstDate: _weekFirst
|
110
|
+
lastDate: _weekLast
|
111
|
+
firstNum: _firstWeekNum
|
112
|
+
lastNum: _lastWeekNum
|
113
|
+
count: _weeks
|
114
|
+
}
|
115
|
+
month: {
|
116
|
+
firstDate: _monthFirst
|
117
|
+
lastDate: _monthLast
|
118
|
+
}
|
119
|
+
}
|
120
|
+
|
121
|
+
## Calls #drawCalendar when the value is changed
|
122
|
+
refreshValue: ->
|
123
|
+
@drawCalendar( @date() )
|
124
|
+
|
125
|
+
## Draws the next month
|
126
|
+
nextMonth: ->
|
127
|
+
_dateNext = new Date( @viewMonth[0], @viewMonth[1]+1, 1 )
|
128
|
+
_dateMs = _dateNext.getTime() - @tzMs(_dateNext)
|
129
|
+
@drawCalendar( new Date(_dateMs) )
|
130
|
+
|
131
|
+
## Drows the prev month
|
132
|
+
prevMonth: ->
|
133
|
+
_datePrev = new Date( @viewMonth[0], @viewMonth[1]-1, 1 )
|
134
|
+
_dateMs = _datePrev.getTime() - @tzMs(_datePrev)
|
135
|
+
@drawCalendar( new Date(_dateMs) )
|
136
|
+
|
137
|
+
## Stores the currently viewed year and month
|
138
|
+
viewMonth: [ 1970, 0 ]
|
139
|
+
|
140
|
+
## Shows a pulldown menu for month selection
|
141
|
+
monthMenu: ->
|
142
|
+
return unless HMiniMenu?
|
143
|
+
_calendar = this
|
144
|
+
_monthValues = []
|
145
|
+
for _monthName, i in HLocale.dateTime.strings.monthsLong
|
146
|
+
_monthValues.push( [ i, _monthName ] )
|
147
|
+
_rect = ELEM.getBoxCoords( @_monthMenu )
|
148
|
+
_rect[0] += 20
|
149
|
+
_rect[2] = 80 if _rect[2] < 80
|
150
|
+
HMiniMenu.extend(
|
151
|
+
_killAfterRefresh: false
|
152
|
+
menuHide: ->
|
153
|
+
@base()
|
154
|
+
_menu = @
|
155
|
+
_menu._killAfterRefresh = true
|
156
|
+
COMM.Queue.push( ->
|
157
|
+
if _menu._killAfterRefresh
|
158
|
+
_menu.refreshValue()
|
159
|
+
)
|
160
|
+
return true;
|
161
|
+
refreshValue: ->
|
162
|
+
@base()
|
163
|
+
if @_killAfterRefresh
|
164
|
+
@_killAfterRefresh = false
|
165
|
+
_calendar.setValue( _calendar.setMonth( @value ) )
|
166
|
+
if _calendar.month() != @value
|
167
|
+
_calendar.setValue( _calendar.setMday( 30 ) )
|
168
|
+
_calendar.setValue( _calendar.setMonth( this.value ) )
|
169
|
+
if _calendar.month() != @value
|
170
|
+
_calendar.setValue( _calendar.setMday( 29 ) )
|
171
|
+
_calendar.setValue( _calendar.setMonth( @value ) )
|
172
|
+
if _calendar.month() != this.value
|
173
|
+
_calendar.setValue( _calendar.setMday( 28 ) )
|
174
|
+
_calendar.setValue( _calendar.setMonth( @value ) )
|
175
|
+
_menu = this
|
176
|
+
COMM.Queue.push( ->
|
177
|
+
_menu.die()
|
178
|
+
)
|
179
|
+
).new( _rect, @,
|
180
|
+
value: @month()
|
181
|
+
initialVisibility: true
|
182
|
+
).setListItems( _monthValues )
|
183
|
+
|
184
|
+
## Shows a text field for year selection
|
185
|
+
yearMenu: ->
|
186
|
+
_calendar = @
|
187
|
+
_rect = ELEM.getBoxCoords( @_yearMenu )
|
188
|
+
_rect[0] += 20
|
189
|
+
_rect[2] = 40 if _rect[2] < 40
|
190
|
+
_rect[3] = 20
|
191
|
+
HNumericTextControl.extend(
|
192
|
+
refreshValue: ->
|
193
|
+
@base()
|
194
|
+
_calendar.setValue( _calendar.setYear( @value ) )
|
195
|
+
textBlur: ->
|
196
|
+
@base()
|
197
|
+
_year = this
|
198
|
+
COMM.Queue.push( ->
|
199
|
+
_year.die() if _year.markupElemIds?
|
200
|
+
)
|
201
|
+
textEnter: ->
|
202
|
+
@base()
|
203
|
+
_returnKeyPressed = EVENT.status[ EVENT.keysDown ].indexOf( 13 ) != -1
|
204
|
+
_noKeysPressed = EVENT.status[ EVENT.keysDown ].length == 0
|
205
|
+
if _returnKeyPressed or _noKeysPressed
|
206
|
+
ELEM.get( @markupElemIds.value ).blur()
|
207
|
+
).new( _rect, @,
|
208
|
+
value: @year()
|
209
|
+
minValue: -38399
|
210
|
+
maxValue: 38400
|
211
|
+
focusOnCreate: true
|
212
|
+
refreshOnInput: false
|
213
|
+
)
|
214
|
+
|
215
|
+
_destroyCalendarElems: ->
|
216
|
+
if @_drawCalendarElems?
|
217
|
+
for _elemId in @_drawCalendarElems
|
218
|
+
ELEM.del( _elemId )
|
219
|
+
@_drawCalendarElems = null
|
220
|
+
|
221
|
+
die: ->
|
222
|
+
@_destroyWeekDayElems()
|
223
|
+
@_destroyCalendarElems()
|
224
|
+
@base()
|
225
|
+
|
226
|
+
## Draws the calendar with the date open given as input.
|
227
|
+
##
|
228
|
+
## Params:
|
229
|
+
## - _date: The date on which calendar UI is opened at.
|
230
|
+
drawCalendar: (_date)->
|
231
|
+
@_destroyCalendarElems()
|
232
|
+
_date = @date() unless ( _date instanceof Date )
|
233
|
+
_calendarDateRange = @calendarDateRange( _date )
|
234
|
+
_monthFirst = _calendarDateRange.month.firstDate
|
235
|
+
_monthLast = _calendarDateRange.month.lastDate
|
236
|
+
_firstDate = _calendarDateRange.week.firstDate
|
237
|
+
_lastDate = _calendarDateRange.week.lastDate
|
238
|
+
_availWidth = @rect.width - 2
|
239
|
+
_availHeight = @rect.height - 36
|
240
|
+
_leftPlus = ( _availWidth % 8 ) - 2
|
241
|
+
_topPlus = ( _availHeight % 6 )
|
242
|
+
_colWidth = Math.floor( _availWidth / 8 )
|
243
|
+
_rowHeight = Math.floor( _availHeight / 6 )
|
244
|
+
_parentElem = @markupElemIds.value
|
245
|
+
ELEM.setStyle( _parentElem, 'visibility', 'hidden', true )
|
246
|
+
_elems = []
|
247
|
+
for _row in [0..5]
|
248
|
+
_weekElem = ELEM.make( _parentElem )
|
249
|
+
_elems.push( _weekElem )
|
250
|
+
ELEM.addClassName( _weekElem, 'calendar_weeks_week_row' )
|
251
|
+
ELEM.setStyle( _weekElem, 'width', _availWidth+'px' )
|
252
|
+
ELEM.setStyle( _weekElem, 'height', _availHeight+'px' )
|
253
|
+
_top = (_row*_rowHeight)+_topPlus
|
254
|
+
ELEM.setStyle( _weekElem, 'top', _top+'px' )
|
255
|
+
for _col in [0..7]
|
256
|
+
if _col == 0
|
257
|
+
_colDate = new Date( _firstDate.getTime() + (_row*@msWeek) + (_col*@msDay) )
|
258
|
+
_colMs = _colDate.getTime()
|
259
|
+
_colElem = ELEM.make( _weekElem )
|
260
|
+
_elems.push( _colElem )
|
261
|
+
ELEM.addClassName( _colElem, 'calendar_weeks_week_col_wk' )
|
262
|
+
ELEM.setStyle( _colElem, 'left', '0px' )
|
263
|
+
ELEM.setStyle( _colElem, 'width', _colWidth+'px' )
|
264
|
+
ELEM.setStyle( _colElem, 'height', _rowHeight+'px' )
|
265
|
+
ELEM.setStyle( _colElem, 'line-height', _rowHeight+'px' )
|
266
|
+
ELEM.setHTML( _colElem, @week( _colDate ) )
|
267
|
+
else
|
268
|
+
_colDate = new Date( _firstDate.getTime() + (_row*@msWeek) + ((_col-1)*@msDay) )
|
269
|
+
_colMs = _colDate.getTime()
|
270
|
+
_colSecs = Math.round( _colMs/1000 )
|
271
|
+
_colElem = ELEM.make( _weekElem, 'a' )
|
272
|
+
_elems.push( _colElem )
|
273
|
+
if @value >= _colSecs and @value < _colSecs+86400
|
274
|
+
ELEM.addClassName( _colElem, 'calendar_weeks_week_col_sel' )
|
275
|
+
else if _colDate < _monthFirst or _colDate > _monthLast
|
276
|
+
ELEM.addClassName( _colElem, 'calendar_weeks_week_col_no' )
|
277
|
+
else
|
278
|
+
ELEM.addClassName( _colElem, 'calendar_weeks_week_col_yes' )
|
279
|
+
ELEM.setAttr( _colElem, 'href', "javascript:HSystem.views[#{@viewId}].setValue(#{_colSecs})" )
|
280
|
+
_left = (_col*_colWidth+_leftPlus)
|
281
|
+
ELEM.setStyle( _colElem, 'left', _left+'px' )
|
282
|
+
ELEM.setStyle( _colElem, 'width', (_colWidth-1)+'px' )
|
283
|
+
ELEM.setStyle( _colElem, 'height', (_rowHeight-1)+'px' )
|
284
|
+
ELEM.setStyle( _colElem, 'line-height', _rowHeight+'px' )
|
285
|
+
ELEM.setHTML( _colElem, @mday( _colDate ) )
|
286
|
+
ELEM.setStyle( _parentElem, 'visibility', 'inherit' )
|
287
|
+
_stateElem = @markupElemIds.state
|
288
|
+
|
289
|
+
@_monthMenu = ELEM.make( _stateElem, 'a' )
|
290
|
+
_elems.push( @_monthMenu )
|
291
|
+
ELEM.setAttr( @_monthMenu, 'href', "javascript:HSystem.views[#{@viewId}].monthMenu()" )
|
292
|
+
ELEM.setHTML( @_monthMenu, @monthName( _date ) )
|
293
|
+
|
294
|
+
_spacer = ELEM.make( _stateElem, 'span' )
|
295
|
+
_elems.push( _spacer )
|
296
|
+
ELEM.setHTML( _spacer, ' ' )
|
297
|
+
|
298
|
+
@_yearMenu = ELEM.make( _stateElem, 'a' )
|
299
|
+
_elems.push( @_yearMenu )
|
300
|
+
ELEM.setAttr( @_yearMenu, 'href', "javascript:HSystem.views[#{@viewId}].yearMenu()" )
|
301
|
+
ELEM.setHTML( @_yearMenu, @year( _date ) )
|
302
|
+
|
303
|
+
@viewMonth = [ _monthFirst.getUTCFullYear(), _monthFirst.getUTCMonth() ]
|
304
|
+
@_drawCalendarElems = _elems
|
305
|
+
)
|
306
|
+
|
307
|
+
HCalendar.implement( HDateTime )
|
@@ -1,7 +1,6 @@
|
|
1
1
|
.calendar_control {
|
2
2
|
position: absolute;
|
3
|
-
left: 0px; top: 0px; right:
|
4
|
-
border: 1px solid #999;
|
3
|
+
left: 0px; top: 0px; right: 0px; bottom: 0px;
|
5
4
|
}
|
6
5
|
.calendar_head {
|
7
6
|
position: absolute;
|
@@ -12,7 +11,6 @@
|
|
12
11
|
position: absolute;
|
13
12
|
top: 2px; width: 16px; height: 16px;
|
14
13
|
font-size: 0; line-height: 0;
|
15
|
-
line-height: 20px;
|
16
14
|
cursor: pointer;
|
17
15
|
background-image: #{this.getCssFilePath('calendar_arrows.png')};
|
18
16
|
}
|
@@ -55,7 +53,7 @@
|
|
55
53
|
color: #000;
|
56
54
|
font-family: Arial, sans-serif;
|
57
55
|
font-size: 11px;
|
58
|
-
line-height:
|
56
|
+
line-height: 16px;
|
59
57
|
vertical-align: middle;
|
60
58
|
text-align: center;
|
61
59
|
}
|
@@ -86,11 +84,8 @@
|
|
86
84
|
}
|
87
85
|
.calendar_weeks_week_col_no {
|
88
86
|
color: #666;
|
89
|
-
border-left: 1px solid #999;
|
90
|
-
border-top: 1px solid #999;
|
91
87
|
}
|
92
88
|
.calendar_weeks_week_col_no:hover {
|
93
|
-
background-color: #fff;
|
94
89
|
color: #000;
|
95
90
|
}
|
96
91
|
.calendar_weeks_week_col_yes,
|
@@ -98,11 +93,97 @@
|
|
98
93
|
color: #000;
|
99
94
|
background-color: #ddd;
|
100
95
|
font-weight: bold;
|
101
|
-
border
|
102
|
-
border-top: 1px solid #666;
|
96
|
+
border: 1px solid #666;
|
103
97
|
}
|
104
98
|
.calendar_weeks_week_col_sel,
|
105
99
|
.calendar_weeks_week_col_yes:hover {
|
106
100
|
background-color: #fff;
|
107
101
|
}
|
102
|
+
.calendar_bg {
|
103
|
+
position: absolute;
|
104
|
+
left: -1px; right: -1px;
|
105
|
+
top: -1px; bottom: -2px;
|
106
|
+
}
|
107
|
+
.calendar_bg * {
|
108
|
+
position: absolute;
|
109
|
+
font-size: 0; line-height: 0; /* ie bug work-arounds */
|
110
|
+
}
|
111
|
+
.disabled > .calendar_bg {
|
112
|
+
opacity: 0.9;
|
113
|
+
}
|
114
|
+
.calendar_bg .calendar_nw,
|
115
|
+
.calendar_bg .calendar_n,
|
116
|
+
.calendar_bg .calendar_ne,
|
117
|
+
.calendar_bg .calendar_sw,
|
118
|
+
.calendar_bg .calendar_s,
|
119
|
+
.calendar_bg .calendar_se {
|
120
|
+
height: 12px;
|
121
|
+
background-image: #{this.getCssFilePath('calendar_parts1.png')};
|
122
|
+
}
|
123
|
+
.calendar_bg .calendar_c {
|
124
|
+
left: 12px; right: 12px; top: 12px; bottom: 12px;
|
125
|
+
background-color: #fbfafb;
|
126
|
+
/* background-image: #{this.getCssFilePath('calendar_bg.png')};*/
|
127
|
+
}
|
128
|
+
.calendar_bg .calendar_w,
|
129
|
+
.calendar_bg .calendar_e {
|
130
|
+
top: 12px; bottom: 12px;
|
131
|
+
width: 12px;
|
132
|
+
background-image: #{this.getCssFilePath('calendar_parts2.png')};
|
133
|
+
}
|
134
|
+
.calendar_bg .calendar_n,
|
135
|
+
.calendar_bg .calendar_s {
|
136
|
+
left: 12px; right: 12px;
|
137
|
+
}
|
138
|
+
.calendar_bg .calendar_nw,
|
139
|
+
.calendar_bg .calendar_ne,
|
140
|
+
.calendar_bg .calendar_sw,
|
141
|
+
.calendar_bg .calendar_se {
|
142
|
+
width: 12px;
|
143
|
+
}
|
144
|
+
.calendar_bg .calendar_nw,
|
145
|
+
.calendar_bg .calendar_n,
|
146
|
+
.calendar_bg .calendar_ne {
|
147
|
+
top: 0px;
|
148
|
+
}
|
149
|
+
.calendar_bg .calendar_sw,
|
150
|
+
.calendar_bg .calendar_s,
|
151
|
+
.calendar_bg .calendar_se {
|
152
|
+
bottom: 0px;
|
153
|
+
}
|
154
|
+
.calendar_bg .calendar_nw,
|
155
|
+
.calendar_bg .calendar_w,
|
156
|
+
.calendar_bg .calendar_sw {
|
157
|
+
left: 0px;
|
158
|
+
}
|
159
|
+
.calendar_bg .calendar_ne,
|
160
|
+
.calendar_bg .calendar_e,
|
161
|
+
.calendar_bg .calendar_se {
|
162
|
+
right: 0px;
|
163
|
+
}
|
164
|
+
.calendar_bg .calendar_nw {
|
165
|
+
background-position: 0px 0px;
|
166
|
+
}
|
167
|
+
.calendar_bg .calendar_n {
|
168
|
+
background-position: 0px -24px;
|
169
|
+
}
|
170
|
+
.calendar_bg .calendar_ne {
|
171
|
+
background-position: -12px 0px;
|
172
|
+
}
|
173
|
+
.calendar_bg .calendar_sw {
|
174
|
+
background-position: 0px -12px;
|
175
|
+
}
|
176
|
+
.calendar_bg .calendar_s {
|
177
|
+
background-position: 0px -36px;
|
178
|
+
}
|
179
|
+
.calendar_bg .calendar_se {
|
180
|
+
background-position: -12px -12px;
|
181
|
+
}
|
182
|
+
.calendar_bg .calendar_w {
|
183
|
+
background-position: 0px 0px;
|
184
|
+
}
|
185
|
+
.calendar_bg .calendar_e {
|
186
|
+
background-position: -12px 0px;
|
187
|
+
}
|
188
|
+
|
108
189
|
|