Commit 8a9227c8 authored by kalman's avatar kalman Committed by Commit bot

Replace the sample Calendar extension with a deprecation notice linking to a

working (also By Google) Calendar extension.

BUG=435290
R=aboxhall@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/890173003

Cr-Commit-Position: refs/heads/master@{#314075}
parent f5231cd4
......@@ -4,62 +4,14 @@
* LICENSE file.
*/
//Contains true if multiple calendar option is checked, false otherwise.
var isMultiCalendar;
var $ = document.getElementById.bind(document);
//adding listener when body is loaded to call init function.
window.addEventListener('load', init, false);
var url = 'https://chrome.google.com/webstore/detail/' +
'google-calendar-by-google/gmbgaklkmjakoegficnlkhebmhkjfich';
/**
* Sets the value of multiple calendar checkbox based on value from
* local storage.
*/
function init() {
isMultiCalendar = JSON.parse(localStorage.multiCalendar || false);
$('multiCalendar').checked = isMultiCalendar;
$('multiCalendarText').innerHTML =
chrome.i18n.getMessage('multiCalendarText');
$('multiCalendar').addEventListener('click', save);
$('optionsTitle').innerHTML = chrome.i18n.getMessage('optionsTitle');
$('imageTooltip').title = chrome.i18n.getMessage('imageTooltip');
$('imageTooltip').alt = chrome.i18n.getMessage('imageTooltip');
$('multiCalendarText').title = chrome.i18n.getMessage('multiCalendarToolTip');
$('multiCalendar').title = chrome.i18n.getMessage('multiCalendarToolTip');
$('extensionName').innerHTML = chrome.i18n.getMessage('extensionName');
if (chrome.i18n.getMessage('direction') == 'rtl') {
$('body').style.direction = 'rtl';
}
};
/**
* Saves the value of the checkbox into local storage.
*/
function save() {
var multiCalendarId = $('multiCalendar');
localStorage.multiCalendar = multiCalendarId.checked;
if (multiCalendarId) {
multiCalendar.disabled = true;
}
$('status').innerHTML = chrome.i18n.getMessage('status_saving');
$('status').style.display = 'block';
// Sends message to the background page notifying it that the settings
// have updated.
chrome.runtime.getBackgroundPage(function(bg) {
bg.onSettingsChange();
statusSaved();
});
};
function statusSaved() {
if ($('multiCalendar')) {
if ($('multiCalendar').disabled) {
$('status').innerHTML = chrome.i18n.getMessage('status_saved');
$('status').style.display = 'block';
setTimeout(
function() { $('status').style.display = 'none'; }
, 1500);
}
$('multiCalendar').disabled = false;
}
$('name').textContent = chrome.i18n.getMessage('name');
$('link').href = url;
$('remove').onclick = function() {
chrome.management.uninstallSelf({showConfirmDialog: true});
window.close();
};
/**
* Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this
* source code is governed by a BSD-style license that can be found in the
* LICENSE file.
*/
/**
* Alias for document.getElementById.
* @param {string} id The id of the element.
* @return {HTMLElement} The html element for the given element id.
*/
function $(id) {
return document.getElementById(id);
};
......@@ -4,19 +4,28 @@
"manifest_version": 2,
"default_locale":"en",
"options_page": "views/options.html",
"version": "1.5.0",
"options_ui": {
"page": "views/options.html",
"chrome_style": true
},
"version": "2.0.0",
"background": {
"page": "views/background.html",
"scripts": ["javascript/background.js"],
"persistent": false
},
},
"permissions": [
"alarms", "tabs", "webNavigation", "http://*.google.com/", "https://*.google.com/"
],
"notifications"
],
"browser_action": {
"default_icon": {
"19": "images/icon-19.png",
"38": "images/icon-38.png"
},
"default_title": "__MSG_title__"
},
"icons": {
"128": "images/icon-128.gif",
"16":"images/icon-16.gif"
"128": "images/icon-128.png",
"48": "images/icon-48.png",
"16":"images/icon-16.png"
}
}
<!DOCTYPE html>
<!--
* Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this
* source code is governed by a BSD-style license that can be found in the
* LICENSE file.
-->
<html>
<head>
</head>
<body>
<img id="logged_in" src="../images/icon-16.gif">
<canvas id="canvas" width="19" height="19"></canvas>
<script src="../javascript/util.js"></script>
<script src="../javascript/background.js"></script>
</body>
</html>
......@@ -5,83 +5,23 @@
* LICENSE file.
-->
<html>
<head>
<title id=optionsTitle></title>
<script src="../javascript/options.js"></script>
<script src="../javascript/util.js"></script>
<style>
#content {
background-color: white;
border: 4px solid #B5C7DE;
border-radius: 12px;
margin: 40px auto 20px;
padding: 8px;
width: 600px;
}
.option_row {
clear: left;
padding: 2.5em 1em 0;
text-align:center
}
#status {
background-color: rgb(255, 241, 168);
display: none;
margin-left: 3px;
padding: 1px 2px;
text-align: center;
font-size: 15px;
color: #000;
}
#multiCalendarText {
font-size: 15px;
color: #000;
}
body {
background-color: "#ebeff9";
}
#logo {
font-size: 20px;
text-align: center;
}
#extensionName {
color: #444;
}
</style>
</head>
<body>
<div id="content">
<div id = "logo">
<img src="../images/icon-128.gif" width="48">&nbsp;&nbsp;&nbsp;
<img src="../images/calendar_logo.gif" id="imageTooltip" title="" alt="">
<br>
<label id="extensionName" ></label>
</div>
<div class="option_row">
<div>
<table cellpadding=1 width=100%>
<tr>
<td width="15%">
&nbsp;
</td>
<td width="5%">
<input type="checkbox" id="multiCalendar" name="multiCalendar" title="">
</td>
<td width="40%" align="left">
<span id="multiCalendarText" title=""></span>
</td>
<td width="30%">
<label id="status"></label>
</td>
<td width="10%">
&nbsp;
</td>
</tr>
</table>
<br>
</div>
</div>
</div>
<p>
<strong><span id="name"></span> is now obsolete and must be removed, as it
relies on an API which will be turned off imminently</strong>.
<a href="https://developers.google.com/google-apps/calendar/v2/developers_guide_protocol">Learn more</a>.
</p>
<p>
Instead, we recommend the more powerful <a id="link">Google Calendar (by
Google)</a> Extension.
</p>
<p>
<button id="remove">Remove from Chrome...</button>
</p>
<script src="../javascript/options.js"></script>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment