├── githubExtends.js ├── images ├── icons │ ├── 128.png │ ├── 16.png │ ├── 32.png │ └── 48.png ├── insert-hover.svg └── insert.svg ├── manifest.json ├── readme.md ├── repo-assets ├── cover.png └── in-action.gif └── sa-styles.css /githubExtends.js: -------------------------------------------------------------------------------- 1 | // Constant URLS to SVGs. 2 | const DEF_SVG = chrome.extension.getURL('images/insert.svg'); 3 | const HOVER_SVG = chrome.extension.getURL('images/insert-hover.svg'); 4 | 5 | // Get all the input fields on the settings page. 6 | const allInputs = document.querySelectorAll('p > input'); 7 | 8 | // Trim extra input — all required ones has 2 classes. 9 | const filteredInputs = Array.from(allInputs).filter(e => e.classList.length === 2); 10 | 11 | // Grab the repo name. 12 | const inputValue = document.location.href.split('/').slice(3,5).join('/'); 13 | 14 | // Attach the button. 15 | const updatedInputs = filteredInputs.map(e => { 16 | const btn = createBtn(); 17 | e.parentElement.classList.add('sa-flex'); 18 | e.parentElement.appendChild(btn); 19 | }) 20 | 21 | function createBtn() { 22 | const btn = document.createElement('img'); 23 | btn.setAttribute('title', 'Auto fill') 24 | btn.classList.add('sa-icon'); 25 | // SVG by Kirill Kazachek: https://www.flaticon.com/authors/kirill-kazachek 26 | btn.src = DEF_SVG; 27 | btn.addEventListener('click', function(e) { 28 | e.target.parentElement.firstElementChild.value = inputValue; 29 | simulateChangeEvent(btn); 30 | }); 31 | btn.addEventListener('mouseenter', e => btn.src = HOVER_SVG); 32 | btn.addEventListener('mouseleave', e => btn.src = DEF_SVG); 33 | return btn; 34 | } 35 | 36 | function simulateChangeEvent(el) { 37 | el.dispatchEvent( 38 | new Event('change', { 39 | bubbles: true, 40 | })) 41 | } 42 | -------------------------------------------------------------------------------- /images/icons/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saqibameen/github-confirm-it/f7a443b231eb61ef56a3d14bd4dd746c0c56ce5a/images/icons/128.png -------------------------------------------------------------------------------- /images/icons/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saqibameen/github-confirm-it/f7a443b231eb61ef56a3d14bd4dd746c0c56ce5a/images/icons/16.png -------------------------------------------------------------------------------- /images/icons/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saqibameen/github-confirm-it/f7a443b231eb61ef56a3d14bd4dd746c0c56ce5a/images/icons/32.png -------------------------------------------------------------------------------- /images/icons/48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saqibameen/github-confirm-it/f7a443b231eb61ef56a3d14bd4dd746c0c56ce5a/images/icons/48.png -------------------------------------------------------------------------------- /images/insert-hover.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /images/insert.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "GitHub Confirm It", 3 | "version": "1.0", 4 | "description": "Quickly add repo name to confirm GitHub repo changes", 5 | "content_scripts": [ 6 | { 7 | "matches": ["https://github.com/*/*/settings"], 8 | "js": ["githubExtends.js"], 9 | "css": ["sa-styles.css"] 10 | } 11 | ], 12 | "web_accessible_resources": ["images/*.svg"], 13 | "page_action": { 14 | "default_icon": { 15 | "16": "images/icons/16.png", 16 | "32": "images/icons/32.png", 17 | "48": "images/icons/48.png", 18 | "128": "images/icons/128.png" 19 | } 20 | }, 21 | "icons": { 22 | "16": "images/icons/16.png", 23 | "32": "images/icons/32.png", 24 | "48": "images/icons/48.png", 25 | "128": "images/icons/128.png" 26 | }, 27 | "manifest_version": 2 28 | } 29 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 |
14 | 15 | # GitHub Confirm It 16 | 17 | Quickly add repository name to confirm actions on GitHub with just a single click. It helps you stay productive by saving your time and helping you focus on what matters. Secure and Open Source. 18 | 19 | ## 🧞♂️ Idea 20 | 21 | Whenever we have to perform any action in from the Danger Zone section of GitHub repository options, such as: 22 | 23 | - Change Visibility 24 | - Transfer Ownership 25 | - Archive Repository 26 | - Delete Repository 27 | 28 | It asks to write `username/repository-name`. It's tedious to write it every time you perform any of these actions or want to quickly get done with it. That's why I created this extension, which lets you quickly type that thing for you and perform the action. Just a single click away. 29 | 30 | ## 🔆 Getting Started 31 | 32 | Below are the quick steps to get up and running with this extension. 33 | 34 | ### 👨💻 Installation 35 | 36 | Download it from [Chrome Store](https://saqib.dev/gci-chrome). It will add a button inside your input box to quickly insert the text. 37 | 38 | ### 🎯 In Action 39 | 40 | Go to the Settings of your repository, under the Danger Zone heading, click on any action. You'll notice the small insert text icon in your input. Click on it to insert the text. A quick GIF for you: 41 | 42 | [](https://saqib.dev/gci-chrome) 43 | 44 | ## 📋 Permissions 45 | 46 | Only requires `content_script` permission which only run on the settings page of your repository. 47 | 48 | ## 👋 Say Hi 49 | 50 | Let's connect. Say Hi on Twitter [@saqibameen](https://twitter.com/saqibameen). 51 | -------------------------------------------------------------------------------- /repo-assets/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saqibameen/github-confirm-it/f7a443b231eb61ef56a3d14bd4dd746c0c56ce5a/repo-assets/cover.png -------------------------------------------------------------------------------- /repo-assets/in-action.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saqibameen/github-confirm-it/f7a443b231eb61ef56a3d14bd4dd746c0c56ce5a/repo-assets/in-action.gif -------------------------------------------------------------------------------- /sa-styles.css: -------------------------------------------------------------------------------- 1 | .sa-flex { 2 | display: flex; 3 | } 4 | 5 | .sa-icon { 6 | position: absolute; 7 | left: calc(100% - 44px); 8 | width: 22px; 9 | margin-top: 5px; 10 | } 11 | 12 | .sa-icon:hover { 13 | cursor: pointer; 14 | animation: entrance 0.4s ease-out; 15 | } 16 | 17 | @keyframes entrance { 18 | 0% { 19 | opacity: 40%; 20 | } 21 | 100% { 22 | opacity: 100%; 23 | } 24 | } 25 | --------------------------------------------------------------------------------