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
Jifty::Manual::jQueryMigrationGuide(3pm)		User Contributed Perl Documentation		  Jifty::Manual::jQueryMigrationGuide(3pm)

NAME
jQueryMigrationGuide - How to migrate your code to use jQuery. Migrate your jifty app to jquery Application developers may start the migration by modifying config.yml, setting the "ConfigFileVersion" to 4. If you did not write any custom javascript code for your app, then you're done. Everything should just work. If you did write some javascript code, but you did not use any of the functions defined in jifty*.js, prototype.js or scriptaculous.js, then you're still good to go. Otherwise, your code might need to be modified a little bit. Since both prototype.js and scriptaculous.js are removed by default, one trivial choice is to simply bring them back. That is as easy as adding the Prototypism plugin to your Jifty application. If you dislike Prototypism like we do, you can choose to re-write your code with jQuery. In the section "From Prototype to jQuery" below, we provide some common patterns that can be applied to rewrite Prototypism code with jQuery, or with just normal javascript. If you hack on Jifty's internals, please make sure you've read the following "Jifty API" section and Jifty::Manual::JavaScript to catch the Javascript API updates since the removal of "prototype.js". Although we've removed "prototype.js", we still prefer to use the non-conflict mode of jQuery. That is, "$" function is now undefined instead of an alias to jQuery. This is to ensure that it's not conflicting with Prototypism anywhere. If you'd like to use "$" function, create that alias in your "app.js" like this: $ = jQuery; However, instead of making a global alias, it's always recommended to localize this alias within a closure: (function($) { // $ is an alias to jQuery only inside this closure $(".message").show(); })(jQuery); Jifty API We re-architected Jifty's javascript libraries to use jQuery. Especially the internal functions to process form elements. The old, Prototype-based way is to extend Form object and the Form.Element object. Since the removal of the Prototype library, it is dangerous to name those functions under Form because loading the Prototype library can destroy those Jifty functions. The new jQuery-based way is to always extend internal functions under the Jifty object. "Form" becomes "Jifty.Form", "Form.Element" becomes "Jifty.Form.Element", and so on. The detailed list of these functions are given in Jifty::Manual::Javascript. Most of those functions are internal functions that you probably should not use directly. From Prototype to jQuery If you've ever written javascript code for your Jifty applications, and you'd like to remove the PrototypeJS library, here are some mechanical rules to re-write prototype.js-based javascript code with jQuery. Array iteration From: A.each( function( $_ ) { ... } ) To: jQuery.each(A, function(index, value ) { // "this" is an alias to current value. }) Hash key iteration From: H = new Hash({...}); H.each(function( pair ) { // pair.key is the key // pair.value is the value }); jQuery.each is designed to work on both "Array" and "Object" in the same way. So there's not much difference. To: // H can be any kind of "Object" jQuery.each(H, function(key, value) { // "this" is an alias to current value. }) Object extend From: obj.extend({ ... }} To: jQuery.extend( obj, { ... } ) JSON jQuery does not ship with the JSON stringify function, but since it neither altered the native Array, nor defined its own Hash, it's acceptable and preferred to just use "JSON.stringify" from "json.js". From: // obj need to be one of those objects defined in C<prototype.js> obj.toJSON(); To: JSON.stringify( obj ) Effects jQuery has a small set of default effects built into its core. They have different names then those defined in "scriptaculous.js". The internal way to specify effects is using the "Jifty.Effect" method. Please see the detailed usage documentation in Jifty::Manual::JavaScript. perl v5.14.2 2010-12-08 Jifty::Manual::jQueryMigrationGuide(3pm)