r141 - in trunk/src/main/webapp: . extensions extensions/chromium
Author: kmorin Date: 2010-12-22 09:17:36 +0100 (Wed, 22 Dec 2010) New Revision: 141 Url: http://chorem.org/repositories/revision/bow/141 Log: - add chromium extension - readd the question mark Added: trunk/src/main/webapp/extensions/ trunk/src/main/webapp/extensions/chromium/ trunk/src/main/webapp/extensions/chromium/_locales/ trunk/src/main/webapp/extensions/chromium/background.html trunk/src/main/webapp/extensions/chromium/bow.crx trunk/src/main/webapp/extensions/chromium/favicon.png trunk/src/main/webapp/extensions/chromium/fdboutonV.jpg trunk/src/main/webapp/extensions/chromium/fondconnexion.jpg trunk/src/main/webapp/extensions/chromium/fondhead.jpg trunk/src/main/webapp/extensions/chromium/logobow.jpg trunk/src/main/webapp/extensions/chromium/manifest.json trunk/src/main/webapp/extensions/chromium/moyen-livre.jpg trunk/src/main/webapp/extensions/chromium/options.css trunk/src/main/webapp/extensions/chromium/options.html trunk/src/main/webapp/extensions/chromium/popup.html trunk/src/main/webapp/extensions/chromium/ptit-livre.jpg Modified: trunk/src/main/webapp/rightMenu.jsp Added: trunk/src/main/webapp/extensions/chromium/background.html =================================================================== --- trunk/src/main/webapp/extensions/chromium/background.html (rev 0) +++ trunk/src/main/webapp/extensions/chromium/background.html 2010-12-22 08:17:36 UTC (rev 141) @@ -0,0 +1,22 @@ +<html> + <head> + <script> + var tabTitle; + var tabUrl; + + // Called when the url of a tab changes. + function showAction(tabId, changeInfo, tab) { + // If the letter 'g' is found in the tab's URL... + // ... show the page action. + chrome.pageAction.show(tabId); + tabTitle = tab.title; + tabUrl = tab.url; + }; + + // Listen for any changes to the URL of any tab. + chrome.tabs.onUpdated.addListener(showAction); + + </script> + </head> +</html> + Added: trunk/src/main/webapp/extensions/chromium/bow.crx =================================================================== (Binary files differ) Property changes on: trunk/src/main/webapp/extensions/chromium/bow.crx ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/src/main/webapp/extensions/chromium/favicon.png =================================================================== (Binary files differ) Property changes on: trunk/src/main/webapp/extensions/chromium/favicon.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/src/main/webapp/extensions/chromium/fdboutonV.jpg =================================================================== (Binary files differ) Property changes on: trunk/src/main/webapp/extensions/chromium/fdboutonV.jpg ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/src/main/webapp/extensions/chromium/fondconnexion.jpg =================================================================== (Binary files differ) Property changes on: trunk/src/main/webapp/extensions/chromium/fondconnexion.jpg ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/src/main/webapp/extensions/chromium/fondhead.jpg =================================================================== (Binary files differ) Property changes on: trunk/src/main/webapp/extensions/chromium/fondhead.jpg ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/src/main/webapp/extensions/chromium/logobow.jpg =================================================================== (Binary files differ) Property changes on: trunk/src/main/webapp/extensions/chromium/logobow.jpg ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/src/main/webapp/extensions/chromium/manifest.json =================================================================== --- trunk/src/main/webapp/extensions/chromium/manifest.json (rev 0) +++ trunk/src/main/webapp/extensions/chromium/manifest.json 2010-12-22 08:17:36 UTC (rev 141) @@ -0,0 +1,23 @@ +{ + "name": "__MSG_extensionName__", + "version": "1.0", + "default_locale": "en", + + "description": "__MSG_extensionDescription__", + "icons": { "16": "ptit-livre.jpg", + "48": "moyen-livre.jpg", + "128": "moyen-livre.jpg" }, + + "page_action": { + "default_title": "__MSG_actionTitle__", + "default_icon": "favicon.png", + "default_popup": "popup.html" + }, + + "background_page": "background.html", + "options_page": "options.html", + "homepage_url": "http://www.codelutin.com", + "permissions": [ + "tabs", "http://*/*", "https://*/*" + ] +} Added: trunk/src/main/webapp/extensions/chromium/moyen-livre.jpg =================================================================== (Binary files differ) Property changes on: trunk/src/main/webapp/extensions/chromium/moyen-livre.jpg ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: trunk/src/main/webapp/extensions/chromium/options.css =================================================================== --- trunk/src/main/webapp/extensions/chromium/options.css (rev 0) +++ trunk/src/main/webapp/extensions/chromium/options.css 2010-12-22 08:17:36 UTC (rev 141) @@ -0,0 +1,188 @@ +/* + * #%L + * bow + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2010 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +@charset "utf-8"; +/* CSS Document */ +*{ + padding:0; + margin:0; +} + +body{ + font-size:10px; + font-family:Verdana, Arial, Helvetica, sans-serif; +} + +.clearfix{ + height:1%; +} + +.clearfix:after{ + content:"."; + height:0; + line-height:0; + display:block; + visibility:hidden; + clear:both; +} + +#wrap{ + clear:both; + float:left; + overflow-x:hidden; + overflow-y:visible; + position:relative; + width:100%; + background-color:#9EDCF8; +} + +#main div[class="menu clearfix"] h2{ + color:#9edcf8; + font-size:18px; + font-weight:normal; + float:left; +} + +#main .menu form{ + float:right; + color:#9edcf8; + font-size:12px; +} + +#footer{ + background-color:#804561; + padding-top:30px; +} + +#footer a{ + color:#bf8a9c; +} + +#footer p{ + font-size:14px; + text-align:center; + line-height:50px; +} + +#header{ + background:#FFFFFF url('fondhead.jpg') repeat-x; + width:100%; + float:left; + height:100px; + clear:both; + margin:0 auto; + position: relative; +} + +#header a.logo{ + background:url(logobow.jpg); + width:290px; + height:100px; + text-indent:-99999px; + display:block; +} + +#main{ + width:1004px; + margin:0 auto; + position:relative; + clear:both; +} + +#main .menu{ + margin-top: 25px; +} + +#page { + width:100%; + margin:0 auto; + clear:both; +} + +#content{ + width:1004px; + position:relative; + margin:0 auto; + padding-top:20px; +} + +#formFrame{ + width:225px; + height:315px; + background:url('fondconnexion.jpg') no-repeat; + position:relative; + margin:100px auto; + padding:10px 70px; +} + +#formFrame h1{ + color:#804561; + width:225px; + position:relative; + margin:15px auto; +} + +#formFrame div div{ + color:#804561; + font-size:16px; + font-weight:bold; + width:225px; +} + +.label { + margin-top:30px; +} + +.buttons { + margin-top:30px; +} + +#formFrame input[type="text"]{ + width:225px; +} + +#formFrame a{ + position: absolute; + color:#804561; + left:75px; + font-weight:bold; + font-size: 12px; +} + +#formFrame #register{ + bottom:50px; + font-size:14px; +} + +button { + float:right; + margin-top:20px; + background:url('fdboutonV.jpg') repeat-x; + height:31px; + color:#FFFFFF; + font-weight:bold; + border:none; + width:auto; + padding: 5px; + cursor:pointer; +} Added: trunk/src/main/webapp/extensions/chromium/options.html =================================================================== --- trunk/src/main/webapp/extensions/chromium/options.html (rev 0) +++ trunk/src/main/webapp/extensions/chromium/options.html 2010-12-22 08:17:36 UTC (rev 141) @@ -0,0 +1,131 @@ +<!-- + #%L + bow + + $Id$ + $HeadURL$ + %% + Copyright (C) 2010 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% + --> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> + <meta name="description" content="Bookmarks On the Web" /> + <title>BOW Extension Options</title> + <link rel="icon" type="image/png" href="favicon.png" /> + <link rel="stylesheet" type="text/css" href="options.css" /> + <script type="text/javascript"> + <!-- + // Saves options to localStorage. + function save_options() { + var permanentTokenIdInput = document.getElementById("permanentTokenIdInput"); + var permanentTokenId = permanentTokenIdInput.value; + localStorage["permanentTokenId"] = permanentTokenId; + + var sessionTokenIdInput = document.getElementById("sessionTokenIdInput"); + var sessionTokenId = sessionTokenIdInput.value; + localStorage["sessionTokenId"] = sessionTokenId; + + alert(chrome.i18n.getMessage("optionSavedMessage")); + } + + // Restores select box state to saved value from localStorage. + function restore_options() { + var permanentTokenId = localStorage["permanentTokenId"]; + var sessionTokenId = localStorage["sessionTokenId"]; + + var permanentTokenIdInputLabel = document.getElementById("permanentTokenIdInputLabel"); + permanentTokenIdInputLabel.innerHTML = chrome.i18n.getMessage("permanentTokenIdInputLabel"); + + if (permanentTokenId) { + var permanentTokenIdInput = document.getElementById("permanentTokenIdInput"); + permanentTokenIdInput.value = permanentTokenId; + } + + var sessionTokenIdInputLabel = document.getElementById("sessionTokenIdInputLabel"); + sessionTokenIdInputLabel.innerHTML = chrome.i18n.getMessage("sessionTokenIdInputLabel"); + + if (sessionTokenId) { + var sessionTokenIdInput = document.getElementById("sessionTokenIdInput"); + sessionTokenIdInput.value = sessionTokenId; + } + + var title = document.getElementById("title"); + title.innerHTML = chrome.i18n.getMessage("optionTitle"); + + var saveOptionButton = document.getElementById("saveOptionButton"); + saveOptionButton.innerHTML = chrome.i18n.getMessage("saveOptionButton"); + + var licenseLink = document.getElementById("licenseLink"); + licenseLink.innerHTML = chrome.i18n.getMessage("licenseLink"); + + var bugReport = document.getElementById("bugReport"); + bugReport.innerHTML = chrome.i18n.getMessage("bugReport"); + + var userSupport = document.getElementById("userSupport"); + userSupport.innerHTML = chrome.i18n.getMessage("userSupport"); + + } + //--> + </script> +</head> +<body onload="restore_options()"> + <div id="wrap"> + <div id="page"> + <div id="header"> + <a class="logo" href="http://bow.chorem.org">bow</a> + </div> + <div id="main"> + <div id="content"> + <div id="formFrame"> + <h1 id="title"></h1> + <div> + <div class="label"> + <label for="sessionTokenIdInput" id="sessionTokenIdInputLabel"></label> + </div> + <div class="inputs"> + <input type="text" name="sessionTokenIdInput" id="sessionTokenIdInput" /> + </div> + <div class="label"> + <label for="permanentTokenIdInput" id="permanentTokenIdInputLabel"></label> + </div> + <div class="inputs"> + <input type="text" name="permanentTokenIdInput" id="permanentTokenIdInput" /> + </div> + <div class="buttons"> + <button type="button" id="saveOptionButton" onclick="save_options()"></button> + </div> + </div> + </div> + </div> + </div> + </div> + <div id="footer"> + <p> + <a shape="rect" href="http://localhost:8080/bow/bow">bow</a> + <a shape="rect" href="http://www.chorem.org/projects/list_files/bow">0.3-SNAPSHOT</a> - + <a shape="rect" href="http://www.gnu.org/licenses/agpl.html" id="licenseLink"></a> - + <span title="Copyright">©2010</span> + <a shape="rect" href="http://www.codelutin.com">Code Lutin</a> - + <a shape="rect" href="http://www.chorem.org/projects/bow/issues" id="bugReport"></a> - + <a shape="rect" href="http://list.chorem.org/cgi-bin/mailman/listinfo/bow-users" id="userSupport"></a> + </p> + </div> + </div> +</body> +</html> Added: trunk/src/main/webapp/extensions/chromium/popup.html =================================================================== --- trunk/src/main/webapp/extensions/chromium/popup.html (rev 0) +++ trunk/src/main/webapp/extensions/chromium/popup.html 2010-12-22 08:17:36 UTC (rev 141) @@ -0,0 +1,157 @@ +<html> + <head> + <script> + + function bookmarkPermanent() { + var tokenId = localStorage["permanentTokenId"]; + if (tokenId != null) { + bookmark(tokenId); + } + } + + function bookmarkSession() { + var tokenId = localStorage["sessionTokenId"]; + if (tokenId != null) { + bookmark(tokenId); + } + } + + function bookmark(tokenId) { + var url = chrome.extension.getBackgroundPage().tabUrl; + + var nameInput = document.getElementById("nameInput"); + var nameValue = nameInput.value; + + var aliasInput = document.getElementById("aliasInput"); + var aliasValue = aliasInput.value; + + var tagsInput = document.getElementById("tagsInput"); + var tagsValue = tagsInput.value; + + var link = "http://bow.chorem.org/bow/bow?action=addUrl&token=" + tokenId + "&url=" + encodeURIComponent(url) + "&name=" + encodeURIComponent(nameValue) + "&alias=" + encodeURIComponent(aliasValue) + "&tags=" + encodeURIComponent(tagsValue); + + var script=document.createElement('script'); + script.src=link; + script.type='text/javascript'; + document.body.appendChild(script); + }; + + function init() { + var title = document.getElementById("title"); + title.innerHTML = chrome.i18n.getMessage("actionTitle"); + + var nameInputLabel = document.getElementById("nameInputLabel"); + nameInputLabel.innerHTML = chrome.i18n.getMessage("nameInputLabel"); + + var nameInput = document.getElementById("nameInput"); + nameInput.value = chrome.extension.getBackgroundPage().tabTitle; + + var aliasInputLabel = document.getElementById("aliasInputLabel"); + aliasInputLabel.innerHTML = chrome.i18n.getMessage("aliasInputLabel"); + + var tagsInputLabel = document.getElementById("tagsInputLabel"); + tagsInputLabel.innerHTML = chrome.i18n.getMessage("tagsInputLabel"); + + var sessionTokenId = localStorage["sessionTokenId"]; + var sessionTokenButton = document.getElementById("sessionTokenButton"); + if (!isEmpty(sessionTokenId)) { + sessionTokenButton.innerHTML = chrome.i18n.getMessage("sessionTokenButton"); + } else { + sessionTokenButton.style.visibility = "hidden"; + } + + var permanentTokenId = localStorage["permanentTokenId"]; + var permanentTokenButton = document.getElementById("permanentTokenButton"); + if (!isEmpty(permanentTokenId)) { + permanentTokenButton.innerHTML = chrome.i18n.getMessage("permanentTokenButton"); + } else { + permanentTokenButton.style.visibility = "hidden"; + } + + if (isEmpty(permanentTokenId) && isEmpty(sessionTokenId)) { + var buttons = document.getElementById("buttons"); + buttons.innerHTML = chrome.i18n.getMessage("noTokenMessage"); + } + }; + + function isEmpty(string) { + return (string == null || string == ""); + } + + </script> + <style> + body { + width: 300px; + font-size:14px; + font-family:Verdana, Arial, Helvetica, sans-serif; + font-weight:bold; + background-color:#9EDCF8; + color:#804561; + padding: 5px 10px 5px 10px; + } + + h1 { + font-size:18px; + width: 100%; + text-align: center; + } + + button { + float:right; + background:url('fdboutonV.jpg') repeat-x; + color:#FFFFFF; + font-weight:bold; + border:none; + width:auto; + padding: 5px; + cursor: pointer; + } + + .labels { + margin-top: 5px; + } + + .inputs { + width: 100%; + } + + input { + width: 100%; + } + + #buttons { + width: 100%; + margin-top: 10px; + height: 30px; + text-align: center; + text-color: red; + } + + </style> + </head> + <body onLoad="init()"> + <h1 id="title"></h1> + <div class="labels"> + <label for="nameInput" id="nameInputLabel"></label> + </div> + <div class="inputs"> + <input id="nameInput" name="nameInput" type="text" /> + </div> + <div class="labels"> + <label for="aliasInput" id="aliasInputLabel"></label> + </div> + <div class="inputs"> + <input id="aliasInput" name="aliasInput" type="text" /> + </div> + <div class="labels"> + <label for="tagsInput" id="tagsInputLabel"></label> + </div> + <div class="inputs"> + <input id="tagsInput" name="tagsInput" type="text" /> + </div> + <div id="buttons"> + <button id="permanentTokenButton" onclick="bookmarkPermanent()" type="button"></button> + <button id="sessionTokenButton" onclick="bookmarkSession()" type="button"></button> + </div> + </body> +</html> Added: trunk/src/main/webapp/extensions/chromium/ptit-livre.jpg =================================================================== (Binary files differ) Property changes on: trunk/src/main/webapp/extensions/chromium/ptit-livre.jpg ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Modified: trunk/src/main/webapp/rightMenu.jsp =================================================================== --- trunk/src/main/webapp/rightMenu.jsp 2010-12-20 22:31:55 UTC (rev 140) +++ trunk/src/main/webapp/rightMenu.jsp 2010-12-22 08:17:36 UTC (rev 141) @@ -79,7 +79,7 @@ <input type="submit" value="Logout" /> </div> </form> - <!--<a href="#" class="help">Aide</a>--> + <a href="http://maven-site.chorem.org/bow/" class="help">Aide</a> </div> <div id="side"> <div id="colonneD">
participants (1)
-
kmorin@users.chorem.org