...
 
Commits (2)
# Short Description
The extension calculates how many days and hours are between two datetimes; or calculates the datetime in specified days and hours.
[Page of spanD](http://ivanova-irina.blogspot.com/p/spand.html "Page of spanD")
# Download and Install
* **[Install](https://chrome.google.com/webstore/detail/span-of-datetimes/eifmojfjlkacjfnaeagfnfjgpajanphn "Install")** last version from Google Store
or
* **[Download](https://github.com/iriiiina/spand "Download")** source code from GitHub and load extension manually
# Questions and Comments
Any questions or comments are welcome! You can write me an e-mail on [iriiiina@gmail.com](mailto:iriiiina@gmail.com "iriiiina@gmail.com") or leave a comment on this page.
# Source Code and Issues
Source code and issue reporting is available at GitHub: [https://github.com/iriiiina/spand](https://github.com/iriiiina/spand "https://github.com/iriiiina/spand")
Any questions or comments are welcome! You can write me an e-mail on [irina.ivanova@protonmail.com](irina.ivanova@protonmail.com "irina.ivanova@protonmail.com") or leave a comment on this page.
# Screenshot
![spanD](http://4.bp.blogspot.com/-NsLWG2NTP2w/U0htqmr2fQI/AAAAAAAAK98/UjlD-mPLqK4/s1600/Снимок+экрана+2014-04-12+в+1.22.48.png "spanD") ![spanD](http://2.bp.blogspot.com/-UthoZYXGYF4/U0htupYXKWI/AAAAAAAAK-E/rH9uPrrNPpI/s1600/Снимок+экрана+2014-04-12+в+1.22.02.png "spanD")
![spanD](screenshot/1.png)
# Description
Extension is build for software testers to calculate spans or differences between two datetimes.
......@@ -55,8 +46,7 @@ You can configure hot-keys for extension in the Google Chrome:
* open the extensions tab - `chrome://extensions`
* link "Configure commands" at the bottom
* choose an extension and type a shortcut
Now You can use it completely without a mouse!
* Now You can use it completely without a mouse!
# Posts About spanD
* *April 12, 2014* [spanD v1.1](http://ivanova-irina.blogspot.com/2014/04/spand-v11.html "spanD v1.1")
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<!DOCTYPE html>
<html>
<html lang="en-us">
<head>
<title>Span Of Datetimes</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<script src="src/CalculateAddition.js" type="text/JavaScript"></script>
<script src="src/CalculateSpan.js" type="text/JavaScript"></script>
<script src="src/KeyListener.js" type="text/JavaScript"></script>
<script src="src/ResultDisplaying.js" type="text/JavaScript"></script>
<script src="src/Variables.js" type="text/JavaScript"></script>
<script src="src/calculate-addition.js" type="text/JavaScript" charset="utf-8"></script>
<script src="src/calculate-span.js" type="text/JavaScript" charset="utf-8"></script>
<script src="src/key-listener.js" type="text/JavaScript" charset="utf-8"></script>
<script src="src/result-displaying.js" type="text/JavaScript" charset="utf-8"></script>
<script src="src/variables.js" type="text/JavaScript" charset="utf-8"></script>
</head>
<body>
<div class="info">
Formats of dates and times:<br />
DD[.,-/]?MM[.,-/]?YYYY HH[.,-:]?MM
</div>
<br />
<br />
<br />
<div id="error"></div>
<br />
<br />
<div id="spanContent">
<table>
<tr>
<td>start datetime</td>
<td><input type="text" name="startDate" id="startDate"
maxlength="16" size="16" tabindex="1" autofocus/></td>
</tr>
<tr>
<td>end datetime</td>
<td><input type="text" name="endDate" id="endDate"
maxlength="16" size="16" tabindex="2"/></td>
</tr>
</table>
<br />
<div id="spanResult">span: -d -h -m&nbsp;<br /></div>
<div id="span">
<p>start datetime <input type="text" id="start" maxlength="16" size="16" tabindex="1" autofocus/></p>
<p>end datetime <input type="text" id="end" maxlength="16" size="16" tabindex="2"/></p>
<div id="result">
>>> span: -d -h -m
</div>
</div>
<div id="separator"><br />&mdash; OR &mdash;<br /><br /></div>
<p>&mdash; OR &mdash;</p>
<div id="additionContent">
<table>
<tr>
<td>to datetime</td>
<td><input type="text" name="additionDate" id="additionDate"
maxlength="16" size="16" tabindex="3" /></td>
</tr>
<tr>
<td>add</td>
<td><input type="text" name="addDays" id="addDays"
maxlength="4" size="1" tabindex="4" />&nbsp;d
<input type="text" name="addHours" id="addHours"
maxlength="3" size="1" tabindex="5" />&nbsp;h
<input type="text" name="addMinutes" id="addMinutes"
maxlength="3" size="1" tabindex="6" />&nbsp;m</td>
</tr>
<tr>
<td>result</td>
<td><input type="text" id="calculatedAddition"
name="calculatedAddition" size="20" disabled /></td>
</tr>
</table>
<div id="addition">
<p>to datetime <input type="text" id="date" maxlength="16" size="16" tabindex="3"/></p>
<p>add <input type="text" id="days" maxlength="4" size="1" tabindex="4"/>&nbsp;d
<input type="text" id="hours" maxlength="3" size="1" tabindex="5" />&nbsp;h
<input type="text" id="minutes" maxlength="3" size="1" tabindex="6" />&nbsp;m</p>
<p>result <input type="text" id="add-result" size="20" disabled/></p>
</div>
</body>
......
......@@ -14,25 +14,25 @@ var oneDay = 24 * oneHour;
function setSpanVariables() {
var inputStartDate = document.getElementById('startDate').value;
var inputEndDate = document.getElementById('endDate').value;
var inputStartDate = document.getElementById("start").value;
var inputEndDate = document.getElementById("end").value;
checkMandatorySpanFields(inputStartDate, inputEndDate);
setTime('startDate', inputStartDate);
setTime('endDate', inputEndDate);
setDatetime('start', document.getElementById('startDate').value);
setDatetime('end', document.getElementById('endDate').value);
setTime("start", inputStartDate);
setTime("end", inputEndDate);
setDatetime("start", document.getElementById("start").value);
setDatetime("end", document.getElementById("end").value);
}
function checkMandatorySpanFields(inputStartDate, inputEndDate) {
if (inputStartDate == '' && inputEndDate == '')
returnError('Insert dates', 'startDate');
else if (inputStartDate == '')
returnError('Insert start date', 'startDate');
else if (inputEndDate == '')
returnError('Insert end date', 'endDate');
if (inputStartDate === "" && inputEndDate === "")
returnError("Insert dates", "startDate");
else if (inputStartDate === "")
returnError("Insert start date", "startDate");
else if (inputEndDate === "")
returnError("Insert end date", "endDate");
}
function setTime(id, date) {
......@@ -41,29 +41,29 @@ function setTime(id, date) {
}
function setNullTime(id, value) {
document.getElementById(id).value = value + ' ' + '00:00';
document.getElementById(id).value = value + " " + "00:00";
}
function setDatetime(globalVarName, date) {
var dateArray = dateRegexp.exec(date);
checkDateFormat(globalVarName, dateArray);
if (globalVarName == 'start')
if (globalVarName === "start")
start = new Date(
(+dateArray[3]),
(+dateArray[2])-1,
(+dateArray[1]),
(+dateArray[4]),
(+dateArray[5]));
else if (globalVarName == 'end')
else if (globalVarName === "end")
end = new Date(
(+dateArray[3]),
(+dateArray[2])-1,
(+dateArray[1]),
(+dateArray[4]),
(+dateArray[5]));
else if (globalVarName == 'additionDate')
else if (globalVarName === "date")
additionDate = new Date(
(+dateArray[3]),
(+dateArray[2])-1,
......@@ -73,77 +73,77 @@ function setDatetime(globalVarName, date) {
}
function checkDateFormat(type, date) {
if (type == 'start' && date == null)
returnError('Invalid start datetime format', 'startDate');
else if (type == 'end' && date == null)
returnError('Invalid end datetime format', 'endDate');
else if (type == 'additionDate' && date == null)
returnError('Invalid datetime format', 'additionDate');
if (type === "start" && date === null)
returnError("Invalid start datetime format", "start");
else if (type === "end" && date === null)
returnError("Invalid end datetime format", "end");
else if (type === "date" && date === null)
returnError("Invalid datetime format", "date");
}
function setAdditionVariables() {
var inputDate = document.getElementById('additionDate').value;
var inputDays = document.getElementById('addDays').value;
var inputHours = document.getElementById('addHours').value;
var inputMinutes = document.getElementById('addMinutes').value;
var inputDate = document.getElementById("date").value;
var inputDays = document.getElementById("days").value;
var inputHours = document.getElementById("hours").value;
var inputMinutes = document.getElementById("minutes").value;
checkMandatoryAdditionFileds(inputDate);
if (inputDate.length <= 10)
setNullTime('additionDate', inputDate);
setNullTime("date", inputDate);
setNullDays(inputDays);
setNullHours(inputHours);
setNullMinutes(inputMinutes);
checkDaysFormat(document.getElementById('addDays').value);
checkHoursFormat(document.getElementById('addHours').value);
checkMinutesFormat(document.getElementById('addMinutes').value);
setDatetime('additionDate', document.getElementById('additionDate').value);
checkDaysFormat(document.getElementById("days").value);
checkHoursFormat(document.getElementById("hours").value);
checkMinutesFormat(document.getElementById("minutes").value);
setDatetime("date", document.getElementById("date").value);
}
function checkMandatoryAdditionFileds(inputDate) {
if (inputDate == '')
returnError('Insert datetime', 'additionDate');
if (inputDate === "")
returnError("Insert datetime", "date");
}
function setNullDays(inputDays) {
if (inputDays == '') {
document.getElementById('addDays').value = '0';
addDays = '0';
if (inputDays === "") {
document.getElementById("days").value = "0";
addDays = "0";
} else
addDays = inputDays;
}
function checkDaysFormat(inputDays) {
if (daysAndHoursRegexp.exec(inputDays) == null || daysAndHoursRegexp.exec(inputDays)[0] != inputDays)
returnError('Invalid days format', 'addDays');
if (daysAndHoursRegexp.exec(inputDays) === null || daysAndHoursRegexp.exec(inputDays)[0] != inputDays)
returnError("Invalid days format", "days");
}
function setNullHours(inputHours) {
if (inputHours == '') {
document.getElementById('addHours').value = '0';
addHours = '0';
if (inputHours === "") {
document.getElementById("hours").value = "0";
addHours = "0";
} else
addHours = inputHours;
}
function checkHoursFormat(inputHours) {
if (daysAndHoursRegexp.exec(inputHours) == null || daysAndHoursRegexp.exec(inputHours)[0] != inputHours)
returnError('Invalid hours format', 'addHours');
if (daysAndHoursRegexp.exec(inputHours) === null || daysAndHoursRegexp.exec(inputHours)[0] != inputHours)
returnError("Invalid hours format", "hours");
}
function setNullMinutes(inputMinutes) {
if (inputMinutes == '') {
document.getElementById('addMinutes').value = '0';
addMinutes = '0';
if (inputMinutes === "") {
document.getElementById("minutes").value = "0";
addMinutes = "0";
} else
addMinutes = inputMinutes;
}
function checkMinutesFormat(inputMinutes) {
if (daysAndHoursRegexp.exec(inputMinutes) == null || daysAndHoursRegexp.exec(inputMinutes)[0] != inputMinutes)
returnError('Invalid minutes format', 'addMinutes');
}
\ No newline at end of file
if (daysAndHoursRegexp.exec(inputMinutes) === null || daysAndHoursRegexp.exec(inputMinutes)[0] != inputMinutes)
returnError("Invalid minutes format", "minutes");
}
......@@ -4,13 +4,13 @@ function calculateSpan() {
setSpanVariables();
var days = 0;
var hours = 0;
var minutes = 0;
var days=0;
var hours=0;
var minutes=0;
days = Math.floor((end.getTime() - start.getTime()) / oneDay);
hours = Math.floor((end.getTime() - start.getTime() - days*oneDay) / oneHour);
minutes = Math.floor((end.getTime() - start.getTime() - days*oneDay - hours*oneHour) / oneMinute);
returnSpanResult(days, hours, minutes);
}
\ No newline at end of file
}
if(window.addEventListener) {
window.addEventListener('load', listenKeys, false);
window.addEventListener('focus', listenFocus, false);
window.addEventListener("load", listenKeys, false);
window.addEventListener("focus", listenFocus, false);
} else if(window.attachEvent) {
window.attachEvent('onload', listenKeys);
window.addEventListener('focus', listenFocus);
window.attachEvent("onload", listenKeys);
window.addEventListener("focus", listenFocus);
} else {
document.addEventListener('load', listenKeys, false);
document.addEventListener('focus', listenFocus, false);
document.addEventListener("load", listenKeys, false);
document.addEventListener("focus", listenFocus, false);
}
function listenFocus(){
listenStartDateFocus(document.getElementById('startDate'));
listenEndDateFocus(document.getElementById('endDate'));
listenStartDateFocus(document.getElementById("start"));
listenEndDateFocus(document.getElementById("end"));
listenAdditionDateFocus(document.getElementById('additionDate'));
listenAddDaysFocus(document.getElementById('addDays'));
listenAddHoursFocus(document.getElementById('addHours'));
listenAddMinutesFocus(document.getElementById('addMInutes'));
listenAdditionDateFocus(document.getElementById("date"));
listenAddDaysFocus(document.getElementById("days"));
listenAddHoursFocus(document.getElementById("hours"));
listenAddMinutesFocus(document.getElementById("minutes"));
}
function listenStartDateFocus(inputString) {
if(inputString.addEventListener)
inputString.addEventListener('focus', setShadowOnCalculateAddition, false);
inputString.addEventListener("focus", setShadowOnCalculateAddition, false);
else if(inputString.attachEvent)
inputString.attachEvent('focus', setShadowOnCalculateAddition);
inputString.attachEvent("focus", setShadowOnCalculateAddition);
}
function listenEndDateFocus(inputString) {
if(inputString.addEventListener)
inputString.addEventListener('focus', setShadowOnCalculateAddition, false);
inputString.addEventListener("focus", setShadowOnCalculateAddition, false);
else if(inputString.attachEvent)
inputString.attachEvent('focus', setShadowOnCalculateAddition);
inputString.attachEvent("focus", setShadowOnCalculateAddition);
}
function listenAdditionDateFocus(inputString) {
if(inputString.addEventListener)
inputString.addEventListener('focus', setShadowOnCalculateSpan, false);
inputString.addEventListener("focus", setShadowOnCalculateSpan, false);
else if(inputString.attachEvent)
inputString.attachEvent('focus', setShadowOnCalculateSpan);
inputString.attachEvent("focus", setShadowOnCalculateSpan);
}
function listenAddDaysFocus(inputString) {
if(inputString.addEventListener)
inputString.addEventListener('focus', setShadowOnCalculateSpan, false);
inputString.addEventListener("focus", setShadowOnCalculateSpan, false);
else if(inputString.attachEvent)
inputString.attachEvent('focus', setShadowOnCalculateSpan);
inputString.attachEvent("focus", setShadowOnCalculateSpan);
}
function listenAddHoursFocus(inputString) {
if(inputString.addEventListener)
inputString.addEventListener('focus', setShadowOnCalculateSpan, false);
inputString.addEventListener("focus", setShadowOnCalculateSpan, false);
else if(inputString.attachEvent)
inputString.attachEvent('focus', setShadowOnCalculateSpan);
inputString.attachEvent("focus", setShadowOnCalculateSpan);
}
function listenAddMinutesFocus(inputString) {
if(inputString.addEventListener)
inputString.addEventListener('focus', setShadowOnCalculateSpan, false);
inputString.addEventListener("focus", setShadowOnCalculateSpan, false);
else if(inputString.attachEvent)
inputString.attachEvent('focus', setShadowOnCalculateSpan);
inputString.attachEvent("focus", setShadowOnCalculateSpan);
}
function setShadowOnCalculateSpan() {
enableShadow('spanContent');
disableShadow('additionContent');
enableShadow("span");
disableShadow("addition");
}
function setShadowOnCalculateAddition() {
enableShadow('additionContent');
disableShadow('spanContent');
enableShadow("addition");
disableShadow("span");
}
function listenKeys() {
listenStartDate(document.getElementById('startDate'));
listenEndDate(document.getElementById('endDate'));
listenStartDate(document.getElementById("start"));
listenEndDate(document.getElementById("end"));
listenDate(document.getElementById('additionDate'));
listenDays(document.getElementById('addDays'));
listenHours(document.getElementById('addHours'));
listenMinutes(document.getElementById('addMinutes'));
listenDate(document.getElementById("date"));
listenDays(document.getElementById("days"));
listenHours(document.getElementById("hours"));
listenMinutes(document.getElementById("minutes"));
}
var enter = 13;
var leftArrow = 37;
var upArrow = 38;
var rightArrow = 39;
var downArrow = 40;
var enter=13;
var leftArrow=37;
var upArrow=38;
var rightArrow=39;
var downArrow=40;
function listenStartDate(inputStartDate) {
if (inputStartDate.addEventListener)
inputStartDate.addEventListener('keydown', startDateListener, false);
inputStartDate.addEventListener("keydown", startDateListener, false);
else if (inputStartDate.attachEvent)
inputStartDate.attachEvent('keydown', startDateListener);
inputStartDate.attachEvent("keydown", startDateListener);
}
function startDateListener(e) {
if (e.keyCode == enter)
if (e.keyCode === enter)
calculateSpan();
if (e.keyCode == downArrow)
if (e.keyCode === downArrow)
setFocusOnAdditionDate();
if (e.keyCode == rightArrow)
if (e.keyCode === rightArrow)
setFocusOnStartTime();
}
function listenEndDate(inputEndDate) {
if (inputEndDate.addEventListener)
inputEndDate.addEventListener('keydown', endDateListener, false);
inputEndDate.addEventListener("keydown", endDateListener, false);
else if (inputEndDate.attachEvent)
inputEndDate.attachEvent('keydown', endDateListener);
inputEndDate.attachEvent("keydown", endDateListener);
}
function endDateListener(e) {
if (e.keyCode == enter)
if (e.keyCode === enter)
calculateSpan();
if (e.keyCode == downArrow)
if (e.keyCode === downArrow)
setFocusOnAdditionDate();
if (e.keyCode == upArrow)
if (e.keyCode === upArrow)
setFocusOnStartDate();
if (e.keyCode == rightArrow)
if (e.keyCode === rightArrow)
setFocusOnEndTime();
}
function listenDate(inputDate) {
if (inputDate.addEventListener)
inputDate.addEventListener('keydown', dateListener, false);
inputDate.addEventListener("keydown", dateListener, false);
else if (inputDate.attachEvent)
inputDate.attachEvent('keydown', dateListener);
inputDate.attachEvent("keydown", dateListener);
}
function dateListener(e) {
if (e.keyCode == enter)
if (e.keyCode === enter)
calculateAddition();
if (e.keyCode == upArrow)
if (e.keyCode === upArrow)
setFocusOnStartDate();
if (e.keyCode == rightArrow)
if (e.keyCode === rightArrow)
setFocusOnTime();
if (e.keyCode == downArrow)
if (e.keyCode === downArrow)
setFocusOnDays();
}
function listenDays(inputDays) {
if (inputDays.addEventListener)
inputDays.addEventListener('keydown', daysListener, false);
inputDays.addEventListener("keydown", daysListener, false);
else if (inputDays.attachEvent)
inputDays.attachEvent('keydown', daysListener);
inputDays.attachEvent("keydown", daysListener);
}
function daysListener(e) {
if (e.keyCode == enter)
if (e.keyCode === enter)
calculateAddition();
if (e.keyCode == upArrow)
if (e.keyCode === upArrow)
setFocusOnStartDate();
if (e.keyCode == rightArrow)
if (e.keyCode === rightArrow)
setFocusOnHours();
}
function listenHours(inputHours) {
if (inputHours.addEventListener)
inputHours.addEventListener('keydown', hoursListener, false);
inputHours.addEventListener("keydown", hoursListener, false);
else if (inputHours.attachEvent)
inputHours.attachEvent('keydown', hoursListener);
inputHours.attachEvent("keydown", hoursListener);
}
function hoursListener(e) {
if (e.keyCode == enter)
if (e.keyCode === enter)
calculateAddition();
if (e.keyCode == upArrow)
if (e.keyCode === upArrow)
setFocusOnStartDate();
if (e.keyCode == rightArrow)
if (e.keyCode === rightArrow)
setFocusOnMinutes();
if (e.keyCode == leftArrow)
if (e.keyCode === leftArrow)
setFocusOnDays();
}
function listenMinutes(inputMinutes) {
if (inputMinutes.addEventListener)
inputMinutes.addEventListener('keydown', minutesListener, false);
inputMinutes.addEventListener("keydown", minutesListener, false);
else if (inputMinutes.attachEvent)
inputMinutes.attachEvent('keydown', minutesListener);
inputMinutes.attachEvent("keydown", minutesListener);
}
function minutesListener(e) {
if (e.keyCode == enter)
if (e.keyCode === enter)
calculateAddition();
if (e.keyCode == upArrow)
if (e.keyCode === upArrow)
setFocusOnStartDate();
if (e.keyCode == leftArrow)
if (e.keyCode === leftArrow)
setFocusOnHours();
}
function returnError(errorText, element) {
setErrorText(errorText);
colorBorderToRed(element);
throw '';
throw "";
}
function setErrorText(errorText) {
var divError = document.getElementById('error');
divError.innerText = errorText + '\n';
}
function colorBorderToRed(element) {
var border = document.getElementById(element);
border.style.borderColor = '#FF0000';
border.focus();
border.select();
var divError = document.getElementById("error");
divError.innerText = errorText + "\n";
}
function returnSpanResult(days, hours, minutes) {
var divResult = document.getElementById('spanResult');
divResult.innerText = '>>> span:\u00A0' + days + 'd '
+ hours + 'h '
+ minutes + 'm \n';
var divResult = document.getElementById("result");
divResult.innerText = ">>> span:\u00A0" + days + "d "
+ hours + "h "
+ minutes + "m \n";
}
function returnAdditionResult(date) {
......@@ -34,13 +26,13 @@ function returnAdditionResult(date) {
function setMonth(month) {
if (isMonthShort(month))
return '0' + month.toString();
return "0" + month.toString();
else
return month;
}
function isMonthShort(month) {
if (month.toString().length == 1)
if (month.toString().length === 1)
return true;
else
return false;
......@@ -48,13 +40,13 @@ function isMonthShort(month) {
function setHour(hour) {
if (isHourShort(hour))
return '0' + hour.toString();
return "0" + hour.toString();
else
return hour;
}
function isHourShort(hour) {
if (hour.toString().length == 1)
if (hour.toString().length === 1)
return true;
else
return false;
......@@ -62,36 +54,36 @@ function isHourShort(hour) {
function setMinute(minute) {
if (isMinuteShort(minute))
return '0' + minute.toString();
return "0" + minute.toString();
else
return minute;
}
function isMinuteShort(minute) {
if (minute.toString().length == 1)
if (minute.toString().length === 1)
return true;
else
return false;
}
function setAdditionResultText(date, month, hour, minute) {
var calculatedAddition = document.getElementById('calculatedAddition');
calculatedAddition.value = date.getDate() + '.'
+ month + '.'
+ date.getFullYear() + ' '
+ hour + ':'
var calculatedAddition = document.getElementById("add-result");
calculatedAddition.value = date.getDate() + "."
+ month + "."
+ date.getFullYear() + " "
+ hour + ":"
+ minute;
}
function clearError() {
var clearError = document.getElementById('error');
clearError.innerText = '' + '\n';
var clearError = document.getElementById("error");
clearError.innerText = "" + "\n";
clearAllRedBorders();
}
function clearAllRedBorders() {
var allElements = document.getElementsByTagName('*');
var allElements = document.getElementsByTagName("*");
for (var i = 0; i < allElements.length; i++) {
clearRedBorder(allElements[i]);
......@@ -99,40 +91,40 @@ function clearAllRedBorders() {
}
function clearRedBorder(element) {
element.style.border = '';
element.style.border = "";
}
function clearSpanResult() {
var clearResult = document.getElementById('spanResult');
clearResult.innerText = '>>> span: -d -h -m' + '\u00A0\n';
var clearResult = document.getElementById("result");
clearResult.innerText = ">>> span: -d -h -m" + "\u00A0\n";
}
function setFocusOnStartDate() {
document.getElementById('startDate').focus();
document.getElementById("start").focus();
}
function setFocusOnEndDate() {
document.getElementById('endDate').focus();
document.getElementById("end").focus();
}
function setFocusOnAdditionDate() {
document.getElementById('additionDate').focus();
document.getElementById("date").focus();
}
function setFocusOnDays() {
document.getElementById('addDays').focus();
document.getElementById("days").focus();
}
function setFocusOnHours() {
document.getElementById('addHours').focus();
document.getElementById("hours").focus();
}
function setFocusOnMinutes() {
document.getElementById('addMinutes').focus();
document.getElementById("minutes").focus();
}
function selectCalculatedAddition() {
document.getElementById('calculatedAddition').select();
document.getElementById("add-result").select();
}
function enableShadow(divId) {
......
body {
min-width:260px;
min-width:240px;
overflow-x:hidden;
background-color: #333333;
font-family: "Lucida Console", Monaco, monospace;
font-size: 11px;
color: #CCCCCC;
}
button {
font-size: 11px;
color: #000000;
}
input {
font-size: 11px;
color: #000000;
}
#spanContent {
margin-right: 5px;
vertical-align: middle;
text-align: center;
background-color: #41A85F;
font-family: Lucida Sans Unicode;
font-size: 11px;
color: #EFEFEF;
}
#error {
font-size: 12px;
color: #993333;
font-weight: bold;
float: left;
color: #B8312F;
height: 11px;
}
#spanResult {
clear: both;
margin-right: 5px;
vertical-align: middle;
font-size: 16px;
text-align: center;
color: white;
}
#separator {
clear: both;
text-align: center;
}
#additionContent {
clear: both;
float: left;
margin-right: 5px;
vertical-align: middle;
#result {
height: 11px;
}
.info {
float: right;
color: gray;
font-size: 10px;
#result {
font-size: 16px;
}