Store and insert commonly used text snippets.
TextNugs is a Chrome extension that allows you to store and insert commonly used scripts or text snippets into web pages. It provides a convenient way to manage your scripts and quickly insert them into browser pages, targeted to different web sites or text edit fields on the page if needed.
## Features
- **Add New Scripts**: Save scripts with a title, optional site, optional selector, and choose the insertion method.
- **Edit and Manage Scripts**: View, edit, clone, or delete all your saved scripts in one place.
- **Clone Scripts**: Easily duplicate existing scripts to create variations without starting from scratch.
- **Dynamic Clipboard Insertion**: Use `{{clipboard}}` in your scripts to insert the current clipboard content dynamically in context.
- **Quick Access**: Access your scripts directly from the extension popup and insert them into web pages.
- **Enhanced Main Popup**:
- Site Filter toggle to enable/disable site-specific filtering (enabled by default)
- Search box for quick script finding with highlighted matches
- Visual dividers (`---`) and section headers (`#` titles) for better organization
- **Add New Scripts**: Save scripts with a title, optional site, optional selector, and choose the insertion method
- **Edit and Manage Scripts**:
- View, edit, clone, or delete all your saved scripts in one place
- Drag-and-drop reordering in the Edit popup
- Each script can be updated individually or saved in bulk with the "Update All" option. Scripts with unsaved changes are visually indicated with a red border.
- **Clone Scripts**: Easily duplicate existing scripts to create variations without starting from scratch
- **Dynamic Clipboard Insertion**: Use `{{clipboard}}` in your scripts to insert the current clipboard content dynamically in context
- **Quick Access**: Access your scripts directly from the extension popup and insert them into web pages
- **Insertion Methods**:
- **Direct Insertion**: Attempts to insert the script directly at the cursor position in the active element or the element specified when setting up the script
- **Copy to Clipboard**: Copies the script to the clipboard for manual pasting
- **Backup, Restore, and Import**:
- **Backup**: Save all your scripts and settings to a JSON file for safekeeping
- **Restore**: Replace all current scripts with a previous backup
- **Import**: Merge scripts from a backup into your current set
- **Clear All Scripts**: Remove all stored scripts (useful for GDPR compliance)
- **Restore / Import from File or URL**: Import from local files or specify a URL for remote collections
- **Sample Collections**: Choose from preset sample collections in the dropdown menu
- **Settings Interface**:
- Organized in three tabs: Import/Export, Statistics, and About
- About section includes version info, description, and support links
- Automatic display of GitHub release page on plugin updates
- Clickable popover for menu items so you can use snippets for quick references, or quickly copy bits of the snippet
## Installation
### User
1. Search for 'TextNugs' on the [chrome web store](https://chromewebstore.google.com/)
1. Download from the chrome web store
### Developer
1. **Download or Clone the Repository**: Obtain the extension files on your local machine.
2. **Load the Extension into Chrome**:
- Open `chrome://extensions/` in your Chrome browser.
- Enable **Developer mode** by toggling the switch in the top right corner.
- Click **Load unpacked** and select the folder containing the extension files.
3. **Permissions**: The extension requires permissions to access all websites (`<all_urls>`), read and write to the clipboard, and access active tabs.
## Usage
### Adding a New Script
1. **Open the Extension**: Click on the TextNugs icon in the Chrome toolbar.
2. **Add a Script**: Click the **Add...** button to open the **Add New Script** dialog.
3. **Fill in the Details**:
- **Title** (required): A descriptive name for your script.
- **Site** (optional): Specify a site or use wildcards (e.g., `*.example.com`).
- If you want the script to be usable from any site, click the star button to the right of the text field to fill the field with a star to represent 'all sites'. This will be defaulted to the host name of the site you were on when you clicked this **Add...*** button.
- **Selector** (optional): A CSS selector to target a specific element on the page.
- If you want the script to be usable from anywhere on the page, click the star button to the right of the text field to fill the field with a star to represent 'anywhere on the page'. If you were clicked on an edit box on the page this will be used by default if possible
- **Insertion Method**:
- **Direct Insertion**: Inserts the script directly into the page.
- **Copy to Clipboard**: Copies the script to the clipboard.
- **Script Text**: Enter the script or text snippet you want to save.
4. **Save the Script**: Click **Add** to save the script.
### Main Popup Features
- **Site Filter**: Toggle the "Site Filter" checkbox to enable/disable site-specific filtering (enabled by default)
- **Search**: Use the search box to quickly find scripts by title, with matching text highlighted
- **Organization**: Scripts can be separated using visual dividers (`---`) and section headers (titles starting with `#`)
## Editing and Managing Scripts
1. **Open the Extension**: Click on the TextNugs icon.
2. **Edit All Scripts**: Click the **Edit All** button to open the **Edit All Scripts** dialog.
3. **Modify Scripts**:
- Click on a script title to expand and edit its details.
- Make changes to the title, site, selector, insertion method, or script text.
- Reset the site or selector to a * for 'any' with the star button, or set to the currently selected page/selected text editor field's selector with the refresh button.
4. **Update Individual Scripts**:
- Each script has an **Update** button to save changes to that specific script.
- When a script is modified, it shows a red border to indicate unsaved changes. After clicking **Update**, the border is removed, confirming that the changes have been saved.
5. **Update All Scripts**:
- Use the **Update All** button to save changes for all scripts at once. This clears the red border on all modified scripts, indicating that all changes are saved.
6. **Reorder Scripts**:
- Use drag-and-drop to reposition scripts in your preferred order.
7. **Clone Scripts**:
- Click the **Clone** button next to a script to create a duplicate.
- A cloned script will appear with the same details, which you can then modify as needed.
8. **Delete Scripts**: Click the **Delete** button within a script to remove it.
### Inserting Scripts into Web Pages
1. **Navigate to a Web Page**: Go to the website where you want to insert the script.
2. **Focus on the Target Element**:
- If you've specified a selector, the extension will target that element.
- If no selector is specified, click inside the input field or editable area where you want to insert the script.
3. **Open the Extension**: Click on the TextNugs icon.
4. **Select a Script**: Click on the script you want to insert.
5. **Insertion Method**:
- **Direct Insertion**:
- The script will be inserted at the cursor position.
- If text is highlighted, it will be replaced.
- **Copy to Clipboard**:
- The script is copied to your clipboard.
- Manually paste (`Ctrl+V` or `Cmd+V` on a Mac or right-click and select "Paste") into the target field.