Commit a43dd0e0 authored by Irina's avatar Irina

v1.0

parent f5a9be2b
This diff is collapsed.
body {
background-color: white;
font-family: Arial, sans-serif;
font-size: 14px;
color: black
}
img {
float: left
}
h1 {
color: #205081;
padding-left: 100px
}
p {
color: gray;
padding-left: 50px
}
p.info {
color: #205081;
font-size: 12px;
padding-left: 5px
}
table {
border-left: 10px;
border-left-color: #205081;
border-left-style: solid
}
td {
vertical-align: top
}
td.left {
width: 240px
}
td.right {
width: 500px
}
#button {
position: relative;
float: left;
width: 220px
}
#status {
position: relative;
color: #205081;
width: 200px;
float: left
}
#save {
background-color: #205081;
color: white;
border: 0px;
font-size: 20px;
width: 200px
}
#save:hover {
background-color: #183656
}
a {
color: #205081
}
#contacts {
font-size: 10px
}
\ No newline at end of file
body {
min-width: 200px;
overflow-x: hidden;
background-color: #205081;
font-family: Arial, sans-serif;
font-size: 14px;
color: white
}
input {
font-size: 14px;
color: #000000
}
#error {
font-size: 14px;
color: #FF6666;
text-align: center
}
#info {
float: right;
color: white;
font-size: 10px
}
.description {
text-align: right;
font-size: 11px;
color: #CCCCCC
}
\ No newline at end of file
<!DOCTYPE html>
<!-- Extension opens JIRA issue in new tab
Author: Irina Ivanova, iriiiina@gmail.com
11.09.2014
Tartu, Estonia -->
<html>
<head>
<title>JIRA Issue Opener</title>
<script src='js/openIssue.js' type='text/javascript' charset='utf-8'></script>
<link rel='stylesheet' type='text/css' href='css/style.css' />
</head>
<body>
<div id='error'>
<br/>
</div>
<div id='keyInput'>
<label for='key'>Key:&nbsp;</label>
<input type='text' name='key' id='key' maxlength='100' size='17' autofocus />
<p class='description'>Insert issue key</p>
<p class='description'>JIRA issue will be opened in new tab</p>
</div>
<div id='info'>
<p>iriiiina@gmail.com v1.0</p>
</div>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
function setErrorText(errorText) {
'use strict';
var divError = document.getElementById('error');
divError.innerText = errorText + '\n';
}
function colorBorderToRed(element) {
'use strict';
var border = document.getElementById(element);
border.style.borderColor = '#FF6666';
border.focus();
border.select();
}
function returnError(errorText, element) {
'use strict';
setErrorText(errorText);
colorBorderToRed(element);
throw '';
}
var key,
url,
isError = 0;
function setUrl(urlOption) {
'use strict';
if (urlOption.charAt(urlOption.length - 1) === '/') {
url = urlOption + 'browse/';
} else {
url = urlOption + '/browse/';
}
}
function removeSpaces(string) {
'use strict';
if (string.charAt(0) === ' ') {
string = string.slice(1, string.length);
}
if (string.charAt(string.length - 1) === ' ') {
string = string.slice(0, string.length - 1);
}
return string;
}
function openWindow() {
'use strict';
window.open(url + key);
}
function openIssue() {
'use strict';
chrome.storage.sync.get(function (item) {
var urlOption = item.savedUrl;
key = document.getElementById('key').value;
setUrl(urlOption);
key = removeSpaces(key);
if (key === '') {
isError = 1;
returnError('Please insert key', 'key');
} else {
openWindow();
}
});
setTimeout(function () {
if (isError === 0) {
returnError('Please define URL in Options', 'key');
}
}, 500);
}
var enter = 13;
function inputKeyListener(e) {
'use strict';
if (e.keyCode === enter) {
openIssue();
}
}
function listenInputKey(inputKey) {
'use strict';
if (inputKey.addEventListener) {
inputKey.addEventListener('keydown', inputKeyListener, false);
} else if (inputKey.attachEvent) {
inputKey.attachEvent('keydown', inputKeyListener);
}
}
function listenKeys() {
'use strict';
listenInputKey(document.getElementById('key'));
}
if (window.addEventListener) {
window.addEventListener('load', listenKeys, false);
} else if (window.attachEvent) {
window.attachEvent('onload', listenKeys);
} else {
document.addEventListener('load', listenKeys, false);
}
\ No newline at end of file
function save_options() {
var url = document.getElementById('urlOption').value;
chrome.storage.sync.set({
savedUrl: url
}, function () {
var status = document.getElementById('status');
status.textContent = 'Options saved';
setTimeout(function () {
status.textContent = '';
}, 2000);
});
}
function restore_options() {
chrome.storage.sync.get({
savedUrl: 'http://jira.atlassian.com'
}, function (items) {
document.getElementById('urlOption').value = items.savedUrl;
});
}
document.addEventListener('DOMContentLoaded', restore_options);
document.getElementById('save').addEventListener('click',
save_options);
\ No newline at end of file
{
"name": "JIRA Issue Opener",
"short_name": "JIRA Issue Opener",
"version": "1.0",
"manifest_version": 2,
"description": "Extension opens JIRA issue in new tab",
"homepage_url": "http://ivanova-irina.blogspot.com/p",
"icons": {
"16": "icons/icon-16.png",
"48": "icons/icon-48.png",
"128": "icons/icon-128.png"
},
"browser_action": {
"default_icon": "icons/icon-48.png",
"default_popup": "index.html"
},
"permissions": [
"storage"
],
"options_page": "options.html",
"content_security_policy": "default-src 'self'",
"author": {
"name": "Irina Ivanova",
"email": "iriiiina@gmail.com"
}
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Options of JIRA Issue Opener</title>
<link rel='stylesheet' type='text/css' href='css/options.css' />
</head>
<body>
<img src='icons/big.jpg' width='130' alt='Fisheye icon' />
<h1>Options of JIRA Issue Opener</h1>
<p>Extension opens JIRA issue in new tab</p>
<p id='contacts'>Read more on <a href='http://ivanova-irina.blogspot.com/p' target='_blank'>JIRA Issue Opener page</a>
<br />
<a href='mailto:iriiiina@gmail.com'>iriiiina@gmail.com</a>
</p>
<br />
<br />
<br />
<table>
<tr>
<td class='left'>
<label for='urlOption'><b>URL of JIRA:</b>
</label>
</td>
<td class='right'>
<input type='text' name='urlOption' id='urlOption' maxlength='255' size='30' autofocus />&nbsp;<code>/browse/KEY</code>
</td>
</tr>
<tr>
<td class='left'></td>
<td class='right'>
<div id='button'>
<button id='save'>Save</button>
</div>
<div id='status'></div>
</td>
</tr>
</table>
<script src='js/options.js'></script>
</body>
</html>
\ No newline at end of file
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