*/
- background-color: white;
- border-collapse: separate;
- border-spacing: 0px;
- font: -webkit-small-control;
- /* table-layout:fixed and width:100% are added in the JS code. */
-}
-
-.day-label { /* | */
- -webkit-box-sizing: border-box;
- background-color: #e3e9ff;
- border-left-color: #f0f4ff;
- border-top-color: #f0f4ff;
- border: solid 1px #d0d4f0;
- color: #20c;
- font-weight: normal;
- text-align: center;
-}
-
-.day { /* | */
- padding: 1px;
- text-align: center;
- background-color: white;
- border: 1px solid white;
- -webkit-box-sizing: border-box;
-}
-
-.available {
- cursor: default;
- font-weight: 700;
- background-color: white;
- border: 1px solid white;
- border-radius: 5px;
- -webkit-transition: all 0.2s ease;
-}
-
-.not-this-month {
- color: graytext;
- font-weight: 400;
- text-shadow: none;
-}
-
-.available.day-selected {
- background-color: highlight;
- color: highlighttext;
- text-shadow: none;
-}
-
-.unavailable {
- cursor: default;
- color: graytext;
- background-color: #eee;
- border: 1px solid #eee;
- -webkit-transition: border-color 0.2s ease;
-}
-
-.unavailable.day-selected {
- border: 1px solid highlight;
-}
-
-.cancel-button {
- float: right;
-}
diff --git a/cef/resources/calendarPicker.js b/cef/resources/calendarPicker.js
deleted file mode 100644
index 4a7ef06ac..000000000
--- a/cef/resources/calendarPicker.js
+++ /dev/null
@@ -1,1128 +0,0 @@
-"use strict";
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-// FIXME:
-// - Touch event
-
-/**
- * CSS class names.
- *
- * @enum {string}
- */
-var ClassNames = {
- Available: "available",
- CancelButton: "cancel-button",
- ClearButton: "clear-button",
- Day: "day",
- DayLabel: "day-label",
- DayLabelContainer: "day-label-container",
- DaysArea: "days-area",
- DaysAreaContainer: "days-area-container",
- MonthSelector: "month-selector",
- MonthSelectorBox: "month-selector-box",
- MonthSelectorPopup: "month-selector-popup",
- MonthSelectorWall: "month-selector-wall",
- NoFocusRing: "no-focus-ring",
- NotThisMonth: "not-this-month",
- Selected: "day-selected",
- TodayButton: "today-button",
- TodayClearArea: "today-clear-area",
- Unavailable: "unavailable",
- WeekContainer: "week-container",
- YearMonthArea: "year-month-area",
- YearMonthButton: "year-month-button",
- YearMonthButtonLeft: "year-month-button-left",
- YearMonthButtonRight: "year-month-button-right",
- YearMonthUpper: "year-month-upper"
-};
-
-/**
- * @type {Object}
- */
-var global = {
- argumentsReceived: false,
- hadKeyEvent: false,
- params: null
-};
-
-// ----------------------------------------------------------------
-// Utility functions
-
-/**
- * @param {!string} id
- */
-function $(id) {
- return document.getElementById(id);
-}
-
-function bind(func, context) {
- return function() {
- return func.apply(context, arguments);
- };
-}
-
-/**
- * @param {!string} tagName
- * @param {string=} opt_class
- * @param {string=} opt_text
- * @return {!Element}
- */
-function createElement(tagName, opt_class, opt_text) {
- var element = document.createElement(tagName);
- if (opt_class)
- element.setAttribute("class", opt_class);
- if (opt_text)
- element.appendChild(document.createTextNode(opt_text));
- return element;
-}
-
-/**
- * @return {!string} lowercase locale name. e.g. "en-us"
- */
-function getLocale() {
- return (global.params.locale || "en-us").toLowerCase();
-}
-
-/**
- * @return {!string} lowercase language code. e.g. "en"
- */
-function getLanguage() {
- var locale = getLocale();
- var result = locale.match(/^([a-z]+)/);
- if (!result)
- return "en";
- return result[1];
-}
-
-/*
- * @const
- * @type {number}
- */
-var ImperialEraLimit = 2087;
-
-/**
- * @param {!number} year
- * @param {!number} month
- * @return {!string}
- */
-function formatJapaneseImperialEra(year, month) {
- // We don't show an imperial era if it is greater than 99 becase of space
- // limitation.
- if (year > ImperialEraLimit)
- return "";
- if (year > 1989)
- return "(平成" + (year - 1988) + "年)";
- if (year == 1989)
- return "(平成元年)";
- if (year >= 1927)
- return "(昭和" + (year - 1925) + "年)";
- if (year > 1912)
- return "(大正" + (year - 1911) + "年)";
- if (year == 1912 && month >= 7)
- return "(大正元年)";
- if (year > 1868)
- return "(明治" + (year - 1867) + "年)";
- if (year == 1868)
- return "(明治元年)";
- return "";
-}
-
-/**
- * @param {!number} year
- * @param {!number} month
- * @return {!string}
- */
-function formatYearMonth(year, month) {
- // FIXME: Need localized number?
- var yearString = String(year);
- var monthString = global.params.monthLabels[month];
- switch (getLanguage()) {
- case "eu":
- case "fil":
- case "lt":
- case "ml":
- case "mt":
- case "tl":
- case "ur":
- return yearString + " " + monthString;
- case "hu":
- return yearString + ". " + monthString;
- case "ja":
- return yearString + "年" + formatJapaneseImperialEra(year, month) + " " + monthString;
- case "zh":
- return yearString + "年" + monthString;
- case "ko":
- return yearString + "년 " + monthString;
- case "lv":
- return yearString + ". g. " + monthString;
- case "pt":
- return monthString + " de " + yearString;
- case "sr":
- return monthString + ". " + yearString;
- default:
- return monthString + " " + yearString;
- }
-}
-
-/**
- * @param {string=} opt_current
- * @return {!Date}
- */
-function parseDateString(opt_current) {
- if (opt_current) {
- var result = opt_current.match(/(\d+)-(\d+)-(\d+)/);
- if (result)
- return new Date(Date.UTC(Number(result[1]), Number(result[2]) - 1, Number(result[3])));
- }
- var now = new Date();
- // Create UTC date with same numbers as local date.
- return new Date(Date.UTC(now.getFullYear(), now.getMonth(), now.getDate()));
-}
-
-/**
- * @param {!number} year
- * @param {!number} month
- * @param {!number} day
- * @return {!string}
- */
-function serializeDate(year, month, day) {
- var yearString = String(year);
- if (yearString.length < 4)
- yearString = ("000" + yearString).substr(-4, 4);
- return yearString + "-" + ("0" + (month + 1)).substr(-2, 2) + "-" + ("0" + day).substr(-2, 2);
-}
-
-// ----------------------------------------------------------------
-// Initialization
-
-/**
- * @param {Event} event
- */
-function handleMessage(event) {
- if (global.argumentsReceived)
- return;
- global.argumentsReceived = true;
- initialize(JSON.parse(event.data));
-}
-
-function handleArgumentsTimeout() {
- if (global.argumentsReceived)
- return;
- var args = {
- monthLabels : ["m1", "m2", "m3", "m4", "m5", "m6",
- "m7", "m8", "m9", "m10", "m11", "m12"],
- dayLabels : ["d1", "d2", "d3", "d4", "d5", "d6", "d7"],
- todayLabel : "Today",
- clearLabel : "Clear",
- cancelLabel : "Cancel",
- currentValue : "",
- weekStartDay : 0,
- step : 1
- };
- initialize(args);
-}
-
-/**
- * @param {!Object} args
- * @return {?string} An error message, or null if the argument has no errors.
- */
-function validateArguments(args) {
- if (!args.monthLabels)
- return "No monthLabels.";
- if (args.monthLabels.length != 12)
- return "monthLabels is not an array with 12 elements.";
- if (!args.dayLabels)
- return "No dayLabels.";
- if (args.dayLabels.length != 7)
- return "dayLabels is not an array with 7 elements.";
- if (!args.clearLabel)
- return "No clearLabel.";
- if (!args.todayLabel)
- return "No todayLabel.";
- if (args.weekStartDay) {
- if (args.weekStartDay < 0 || args.weekStartDay > 6)
- return "Invalid weekStartDay: " + args.weekStartDay;
- }
- return null;
-}
-
-/**
- * @param {!Object} args
- */
-function initialize(args) {
- var main = $("main");
- main.classList.add(ClassNames.NoFocusRing);
-
- var errorString = validateArguments(args);
- if (errorString)
- main.textContent = "Internal error: " + errorString;
- else {
- global.params = args;
- checkLimits();
- layout();
-
- var initialDate = parseDateString(args.currentValue);
- if (initialDate < global.minimumDate)
- initialDate = global.minimumDate;
- else if (initialDate > global.maximumDate)
- initialDate = global.maximumDate;
- global.daysTable.selectDate(initialDate);
-
- setTimeout(fixWindowSize, 0);
- }
-}
-
-function fixWindowSize() {
- var yearMonthRightElement = document.getElementsByClassName(ClassNames.YearMonthButtonRight)[0];
- var daysAreaElement = document.getElementsByClassName(ClassNames.DaysArea)[0];
- var headers = daysAreaElement.getElementsByClassName(ClassNames.DayLabel);
- var maxCellWidth = 0;
- for (var i = 0; i < headers.length; ++i) {
- if (maxCellWidth < headers[i].offsetWidth)
- maxCellWidth = headers[i].offsetWidth;
- }
- var DaysAreaContainerBorder = 1;
- var maxRight = Math.max(yearMonthRightElement.offsetLeft + yearMonthRightElement.offsetWidth,
- daysAreaElement.offsetLeft + maxCellWidth * 7 + DaysAreaContainerBorder);
- var MainPadding = 6;
- var MainBorder = 1;
- var desiredBodyWidth = maxRight + MainPadding + MainBorder;
-
- var main = $("main");
- var mainHeight = main.offsetHeight;
- main.style.width = "auto";
- daysAreaElement.style.width = "100%";
- daysAreaElement.style.tableLayout = "fixed";
- document.getElementsByClassName(ClassNames.YearMonthUpper)[0].style.display = "-webkit-box";
- document.getElementsByClassName(ClassNames.MonthSelectorBox)[0].style.display = "block";
- main.style.webkitTransition = "opacity 0.1s ease";
- main.style.opacity = "1";
- if (window.frameElement) {
- window.frameElement.style.width = desiredBodyWidth + "px";
- window.frameElement.style.height = mainHeight + "px";
- } else {
- window.resizeTo(desiredBodyWidth, mainHeight);
- }
-}
-
-function checkLimits() {
- // Hard limits of type=date. See WebCore/platform/DateComponents.h.
- global.minimumDate = new Date(-62135596800000.0);
- global.maximumDate = new Date(8640000000000000.0);
- // See WebCore/html/DateInputType.cpp.
- global.step = 86400000;
-
- if (global.params.min) {
- // We assume params.min is a valid date.
- global.minimumDate = parseDateString(global.params.min);
- }
- if (global.params.max) {
- // We assume params.max is a valid date.
- global.maximumDate = parseDateString(global.params.max);
- }
- if (global.params.step)
- global.step *= global.params.step;
-}
-
-function layout() {
- if (global.params.isRTL)
- document.body.dir = "rtl";
- var main = $("main");
- var params = global.params;
- main.removeChild(main.firstChild);
- document.body.addEventListener("keydown", handleGlobalKey, false);
-
- global.yearMonthController = new YearMonthController();
- global.yearMonthController.attachTo(main);
- global.daysTable = new DaysTable();
- global.daysTable.attachTo(main);
- layoutButtons(main);
-}
-
-/**
- * @param {Element} main
- */
-function layoutButtons(main) {
- var container = createElement("div", ClassNames.TodayClearArea);
- global.today = createElement("input", ClassNames.TodayButton);
- global.today.type = "button";
- global.today.value = global.params.todayLabel;
- global.today.addEventListener("click", handleToday, false);
- container.appendChild(global.today);
- global.clear = null;
- if (!global.params.required) {
- global.clear = createElement("input", ClassNames.ClearButton);
- global.clear.type = "button";
- global.clear.value = global.params.clearLabel;
- global.clear.addEventListener("click", handleClear, false);
- container.appendChild(global.clear);
- }
- main.appendChild(container);
-
- global.lastFocusableControl = global.clear || global.today;
-}
-
-// ----------------------------------------------------------------
-
-/**
- * @constructor
- */
-function YearMonthController() {
- /**
- * @type {!number}
- */
- this._currentYear = -1;
- /**
- * @type {!number}
- */
- this._currentMonth = -1;
-}
-
-/**
- * @param {!Element} main
- */
-YearMonthController.prototype.attachTo = function(main) {
- var outerContainer = createElement("div", ClassNames.YearMonthArea);
-
- var innerContainer = createElement("div", ClassNames.YearMonthUpper);
- outerContainer.appendChild(innerContainer);
-
- this._attachLeftButtonsTo(innerContainer);
-
- var box = createElement("div", ClassNames.MonthSelectorBox);
- innerContainer.appendChild(box);
- // We can't use |