This commit is contained in:
Clément CHABANNE (Perso) 2020-07-15 12:01:27 +02:00
parent d900dc247a
commit b7eeb63eb1
9 changed files with 101 additions and 0 deletions

BIN
Go2ticket.zip Normal file

Binary file not shown.

View File

@ -0,0 +1,13 @@
browserAction.onClicked.addListener(function(tab) {
if (localStorage.getItem("url") == null) {
var url = false;
}else{
var url = localStorage.getItem("url");
}
tabs.executeScript({
code: ''
});
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

View File

@ -0,0 +1,42 @@
{
"manifest_version": 2,
"name": "Go2Ticket Firefox",
"version": "1.0",
"author": "Clément CHABANNE",
"description": "Allez directement à un numéro de ticket GLPI depuis son numéro.",
"homepage_url": "https://git.chabanne.ch/clement/Go2ticket",
"icons": {
"48": "icons/go2ticket.png"
},
"permissions": ["storage", "tabs"],
"background": {
"scripts": ["background.js"]
},
"browser_action": {
"default_icon": "icons/go2ticket.png",
"default_title": "Go2Ticket",
"default_popup": "popup/go2ticket.html"
},
"options_ui": {
"page": "options/options.html",
"browser_style": false
},
"commands": {
"_execute_browser_action": {
"suggested_key": {
"default": "Ctrl+Shift+U",
"linux": "Ctrl+Shift+L"
},
"description": "Send a 'toggle-feature' event"
},
"_execute_sidebar_action": {
"suggested_key": {
"default": "Alt+Shift+U",
"linux": "Alt+Shift+L"
},
"description": "Send a 'toggle-feature' event"
}
}
}

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="options.css"/>
</head>
<body>
</br></br>
<label for="url">URL des ticket de votre GLPI : </label>
<input type="text" id="url">
<button id="save">Sauvegarder</button>
<script src="options.js"></script>
</body>
</html>

View File

@ -0,0 +1,12 @@
function save_options() {
var url = document.getElementById('url').value;
localStorage.setItem("url", url);
alert(url);
}
function url()
{
document.getElementById("url").value=localStorage.getItem("url");
}
document.getElementById('save').addEventListener('click', save_options);
url();

View File

@ -0,0 +1,4 @@
html, body {
width: 300px;
background-color: black;
}

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="go2ticket.css"/>
</head>
<body>
<form action="" target="_blank" id="form">
<input type="text" name="id" autofocus>
<input type="submit" id="valid" value="OK">
</form>
<script src="go2ticket.js"></script>
</body>
</html>

View File

@ -0,0 +1,2 @@
document.getElementById("form").action=localStorage.getItem("url");
//browserAction.closePopup();