JQuery to Add Code Tags to Selected Text


 
Thread Tools Search this Thread
The Lounge What is on Your Mind? JQuery to Add Code Tags to Selected Text
# 1  
Old 09-10-2018
JQuery to Add Code Tags to Selected Text

Hey.

Someone find or write some jQuery code where we can select text with our mouse and then click or double click the highlighted / selected text and then it will wrap code tags around the highlighted text (in our editors).

Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Web Development

Turning jQuery Code into Vue.js

The following is some code I am working on the replace our navbar (someday) with a Vue component. Vue.component("unix-navbar", { template: `<div class="neo-table-border vuenavbar"><div class="flex-item" style="margin-bottom:10px;padding-top:13px;"><a class="vuenavbarhome"... (19 Replies)
Discussion started by: Neo
19 Replies

2. What is on Your Mind?

JQuery and CSS Flex Code for Responsive Forum Home Page

So far, I have completed making the home page more responsive (except for the forum stats at the top and the WOL box at the bottom, they still use scroll bars). xevV3_iZ8-s For full screen use the link below and set your YT resolution to 1080p60 HD https://youtu.be/xevV3_iZ8-s Here is... (1 Reply)
Discussion started by: Neo
1 Replies

3. What is on Your Mind?

JQuery and CSS Flex Code for Responsive WOL Page

I have just wrote this jQuery to the WOL page, so the table of users on line will not need scrollbars and will instead transform into a responsive table: <script> jQuery(document).ready(function (){ jQuery("#neo-who-flex-tcat"). css({"display":"flex","flex-flow":"row wrap", ... (0 Replies)
Discussion started by: Neo
0 Replies

4. Shell Programming and Scripting

Using Linux Commands on selected text

Hi I have a XML file as shown below: <Text Text_ID="10155645315850165_10155645333075165" From="460350337463650" Created="2014-10-16T17:05:37+0000" use_count="536">This is the first text</Text> <Text Text_ID="10155645315850165_10155645317025165" From="1626711840908498"... (10 Replies)
Discussion started by: my_Perl
10 Replies

5. Shell Programming and Scripting

To display the selected part in text file of unix

0400903071220312 20120322 20:21 1TRANTELSTRAFLEXCAB22032012CMP201323930000812201108875802100A003485363 12122011AUS 182644 000C2 8122011 0000 000 1TRANTELSTRAFLEXCAB22032012CMP201323930000812201108875802100A003485363 12122011AUS ... (6 Replies)
Discussion started by: rammm
6 Replies

6. Shell Programming and Scripting

Awk to add selected row column data

Looks at the most efficient way to add up the column of data based off of the rows. Random data Name-Number-ID Sarah-2.0-15 Bob-6.3-15 Sally-1.0-10 James-1.0-10 Scotty-10.7-15 So I would select all those who have ID = 15 and then add up total number read - p "Enter ID number" Num ... (3 Replies)
Discussion started by: Ironguru
3 Replies

7. Shell Programming and Scripting

trying to print selected fields of selected lines by AWK

I am trying to print 1st, 2nd, 13th and 14th fields of a file of line numbers from 29 to 10029. I dont know how to put this in one code. Currently I am removing the selected lines by awk 'NR==29,NR==10029' File1 > File2 and then doing awk '{print $1, $2, $13, $14}' File2 > File3 Can... (3 Replies)
Discussion started by: ananyob
3 Replies

8. Shell Programming and Scripting

want to add the size of the selected list of file

i have a files in the dir as below. ls -lR ./.snapshot 5649600512 ./.snapshot/backup/data20080707 6006923264 ./.snapshot/backup/data20080708 5321129984 ./.snapshot/backup/data20080709 6686597120 ./.snapshot/backup/data20080710 7312855040 ... (4 Replies)
Discussion started by: mail2sant
4 Replies
Login or Register to Ask a Question
ntextBindings(3tk)				     Alternative Bindings for the Text Widget					ntextBindings(3tk)

__________________________________________________________________________________________________________________________________________________

NAME
ntextBindings - Alternative Bindings for the Text Widget SYNOPSIS
package require Tcl 8.5 package require Tk 8.5 package require ntext ?0.81? _________________________________________________________________ DESCRIPTION
The ntext package provides a binding tag named Ntext for use by text widgets in place of the default Text binding tag. The Text binding tag provides around one hundred bindings to the text widget (the exact number is platform-dependent). A few of these behave in a way that is different from most contemporary text-editing applications. Ntext aims to provide more familiar behaviour. Features of the Ntext bindings that differ from the default Text bindings: o Clicking near the end of a (logical) line moves the cursor to the end of that line (not the start of the next line). If the widget is in -wrap word mode, the same rule applies to display lines. o Double-clicking or dragging near the end of a (logical) line will highlight/select characters from the end of that line (not the next line, or the region at the end of the line where there are no characters). If the widget is in -wrap word mode, the same rule applies to display lines. o The End key implements "Smart End" (successive keypresses move the cursor to the end of the display line, then to the end of the logical line); the Home key implements "Smart Home" (which is similar to "Smart End", but also toggles between the beginning and end of leading whitespace). o When a selection exists, a <<Paste>> operation (e.g. <Control-v>) overwrites the selection (as most editors do), and does so on all platforms. o The <Insert> key toggles between "Insert" and "Overwrite" modes for keyboard input. (In contrast, the Text binding tag uses <Insert> as a method to paste the "primary selection", a task that can be accomplished instead by mouse middle-click.) o The <Escape> key clears the selection. o Selecting with <Shift-Button1> selects from the previous position of the insertion cursor. (In the Text binding tag, the selection anchor may be the position of the previous mouse click.) o <Shift-Button1> operations do not alter the selection anchor. (In the Text binding tag, they do.) o By default, the Ntext binding tag does not provide several of the Control-key bindings supplied by the Text binding tag. Modern keyboards offer alternatives, such as cursor keys for navigation; modern applications often use the Control-key bindings for other purposes (e.g. <Control-p> for "print"). The last three cases, the behavior of Text is often useful, so Ntext gives you the option of retaining it, by setting variables defined in the ::ntext namespace to 1 (instead of their default 0). Explaining these features in more detail: o If the mouse is clicked at position A, then the keyboard is used to move the cursor to B, then shift is held down, and the mouse is clicked at C: the Text binding tag gives a selection from A to C; the Ntext gives a selection from B to C. If you want Ntext to behave like Text in this respect, set ::ntext::classicMouseSelect to 1. o The Text binding tag allows successive <Shift-Button-1> events to change both ends of the selection, by moving the selection anchor to the end of the selection furthest from the mouse click. Instead, the Ntext binding tag fixes the anchor, and multiple Shift-But- ton-1 events can only move the non-anchored end of the selection. If you want Ntext to behave like Text in this respect, set ::ntext::classicAnchor to 1. In both Text and Ntext, keyboard navigation with the Shift key held down alters the selection and keeps the selection anchor fixed. o The following "extra" Text bindings are switched off by default, but can be activated in Ntext by setting ::ntext::classicExtras to 1: <Control-a>, <Control-b>, <Control-d>, <Control-e>, <Control-f>, <Control-h>, <Control-i>, <Control-k>, <Control-n>, <Control-o>, <Control-p>, <Control-t>, <Control-space>, <Control-Shift-space>. CONFIGURATION OPTIONS
Ntext provides alternatives to a number of behaviours of the classic Text binding tag. Where there is an option, the Ntext behaviour is switched on by default, except for display-line indentation which is discussed on a separate page at ntextIndent. The behaviour of Ntext may be configured application-wide by setting the values of a number of namespace variables: ::ntext::classicAnchor o 0 - (default value) selects Ntext behaviour, i.e. the anchor point is fixed o 1 - selects classic Text behaviour, i.e. the anchor point is variable ::ntext::classicExtras o 0 - (default value) selects Ntext behaviour, i.e. several "extra" Text bindings are de-activated o 1 - selects classic Text behaviour, i.e. the "extra" Text bindings are activated ::ntext::classicMouseSelect o 0 - (default value) selects Ntext behaviour, i.e. the anchor point for mouse selection operations is moved by keyboard navigation o 1 - selects classic Text behaviour ::ntext::overwrite o 0 - (initial value) text typed at the keyboard is inserted into the widget o 1 - text typed at the keyboard overwrites text already in the widget o The value is toggled by the Insert key. EXAMPLE
To use Ntext but keep classic Text 's variable-anchor feature: package require ntext text .t set ::ntext::classicAnchor 1 bindtags .t {.t Ntext . all} SEE ALSO
bindtags, ntext, ntextIndent, text KEYWORDS
bindtags, text ntext 0.81 ntextBindings(3tk)