Permalink
Browse files

주소에 "/browse/" 포함되어 있으면 실행되도록 개선

  • Loading branch information...
1 parent 377a8e6 commit 992dc66f2f23b55de235e679b4393afc3afd8b5c @gaerae committed Jul 25, 2016
Showing with 44 additions and 28 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 README.md
  3. +10 −0 chrome/js/background.js
  4. +7 −4 chrome/js/content.js
  5. +25 −23 chrome/manifest.json
View
@@ -0,0 +1 @@
+.idea/
View
@@ -1,5 +1,5 @@
# JIRA Subtask Sortable
-[![Chrome Web Store](https://img.shields.io/badge/Chrome%20Web%20Store-v0.2-orange.svg)](https://chrome.google.com/webstore/detail/hcidkmckdnbkbjghgcgeikdoljdhlimb)
+[![Chrome Web Store](https://img.shields.io/badge/Chrome%20Web%20Store-v0.3-orange.svg)](https://chrome.google.com/webstore/detail/hcidkmckdnbkbjghgcgeikdoljdhlimb)
지라 서브 테스크를 드래그&드롭으로 정렬 순서를 변경할 수 있습니다.
@@ -0,0 +1,10 @@
+chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
+ //console.log('Tabid:'+tabId);
+ //console.log('changeInfo:'+JSON.stringify(changeInfo));
+ //console.log('tab:'+JSON.stringify(tab));
+ if (tab.url == undefined) {
+ return;
+ } else if(tab.url.search('/*\/browse\/*/') > 0) {
+ chrome.tabs.executeScript(tabId, {file: 'js/content.js'});
+ }
+});
View
@@ -1,5 +1,5 @@
(function () {
- "use strict";
+ 'use strict';
var app;
app = {
oldTableRows: {},
@@ -18,7 +18,7 @@
* @description Attach events
*/
delegate: function() {
- // Drang and drop
+ // Drag and drop
$('#issuetable>tbody>tr').css('cursor', '-webkit-grab');
$('#issuetable>tbody').sortable({
placeholder: 'ui-state-highlight',
@@ -58,8 +58,11 @@
* @description Initialize background page
*/
init: function() {
- app.delegate();
+ if (document.body.hasAttribute('id') && document.body.getAttribute('id') == 'jira') {
+ app.delegate();
+ }
}
- }
+ };
app.init();
}());
+
View
@@ -1,25 +1,27 @@
{
- "manifest_version": 2,
- "default_locale": "en",
- "name": "__MSG_appName__",
- "description": "__MSG_appDesc__",
- "version": "0.2",
- "browser_action": {
- "default_icon": "images/icon32.png"
- },
- "permissions": ["tabs", "http://*/browse/*", "https://*/browse/*"],
- "content_scripts": [ {
- "js": ["js/jquery-3.0.0.min.js", "js/jquery-ui.min.js", "js/content.js"],
- "matches": ["http://*/browse/*", "https://*/browse/*"]
- } ],
- "icons": {
- "16": "images/icon16.png",
- "32": "images/icon32.png",
- "48": "images/icon48.png",
- "64": "images/icon64.png",
- "128": "images/icon128.png"
- },
- "author": "gaerae.com",
- "homepage_url": "https://github.com/gaerae/jira-subtask-sortable",
- "update_url": "https://clients2.google.com/service/update2/crx"
+ "manifest_version": 2,
+ "default_locale": "en",
+ "name": "__MSG_appName__",
+ "description": "__MSG_appDesc__",
+ "version": "0.3",
+ "permissions": ["declarativeContent", "activeTab", "http://*/browse/*", "https://*/browse/*"],
+ "content_scripts": [{
+ "all_frames": false,
+ "js": ["js/jquery-3.0.0.min.js", "js/jquery-ui.min.js"],
+ "matches": ["http://*/browse/*", "https://*/browse/*"],
+ "run_at": "document_end"
+ }],
+ "background": {
+ "scripts": ["js/background.js"],
+ "persistent": false
+ },
+ "icons": {
+ "16": "images/icon16.png",
+ "32": "images/icon32.png",
+ "48": "images/icon48.png",
+ "64": "images/icon64.png",
+ "128": "images/icon128.png"
+ },
+ "author": "gaerae.com",
+ "homepage_url": "https://github.com/gaerae/jira-subtask-sortable"
}

0 comments on commit 992dc66

Please sign in to comment.