Sponsored Content
The Lounge What is on Your Mind? Number of Small Forum Code Changes (TODO List Items) Post 303027865 by Neo on Thursday 27th of December 2018 05:11:30 AM
Old 12-27-2018
Starting on a mini-toolbar for the mobile editor, I just added a code tag button to the showthread and newreply functions in mobile, using this JS code

Code:
<script>
String.prototype.insertAt = function(index, string) {
  return this.substr(0, index) + string + this.substr(index);
};

function makeBBCode(start, end) {
  var txtBox = document.getElementById("m-st");
  txtBox.value = txtBox.value
    .insertAt(txtBox.selectionEnd, end)
    .insertAt(txtBox.selectionStart, start);
}

</script>

HTML:

Code:
<div class="d-flex justify-content-between m-st-lt">
<span style="font-weight:bold;">Reply:</span>
<span>
<i onclick="makeBBCode('[CODE]','[/CODE]')"class="fas fa-code" style="margin-right:30px;padding-top:10px;">
</i>
</span>
</div>

Works fine. Just need to add more FA buttons and add NOPARSE wrappers for this.

Image
 

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

change list to comma seperated items

I have a list of servers in a file called serverlist like this server1 server2 server3 i need to have them (with no trailing comma, the program does not like that) server1,server2,server3 so far i have been using HOSTS=/tmp/serverlist HOSTS=${HOSTS:-$(grep -Ev "^#|^$"... (2 Replies)
Discussion started by: insania
2 Replies

2. UNIX for Dummies Questions & Answers

Number of items in a directory

This should be so simple.. I have folder with about 27 subfolders in it, each folder has a number of fonts in it.. how do I get the total number of fonts for all subfolders? (2 Replies)
Discussion started by: glev2005
2 Replies

3. Shell Programming and Scripting

Help needed regarding first 3 items in the list

Hi, I've a list in the following format: Empdept filedetails buildingNo Area AAA 444 2 juy AAA 544 2 kui AAA 567 4 poi AAA 734 5 oiu AAA 444 ... (2 Replies)
Discussion started by: skpvalvekar
2 Replies

4. Shell Programming and Scripting

Counting the number of readable, writable, and executable items in a directory

Hello, I'm writing a script in sh in which the first command line argument is a directory. from that, i'm suppose to count the number of readable, writable, and executable items in the directory. I know using $1 represents the directory, and ls would display all the items in the directory, and that... (4 Replies)
Discussion started by: kratos22
4 Replies

5. Shell Programming and Scripting

Parsing through a list of items

Hi there, Here is my checklist of items, 4.1.1 Alerter 4.1.2 Client Services for Netware 4.1.3 Clipbook 4.1.4 Fax Service 4.1.5 File Replication 4.1.6 File Services for Macintosh 4.1.7 FTP Publishing Service 4.1.8 Help and Support 4.1.9 HTTP SSL 4.1.10 IIS Admin Service ... (1 Reply)
Discussion started by: alvinoo
1 Replies
HSCOLOUR(1)							   User Commands						       HSCOLOUR(1)

NAME
HsColour - generate colourised output for Haskell code SYNOPSIS
HsColour options [file.hs] DESCRIPTION
HsColour is a program that colourises Haskell code. It currently has six output formats: ANSI terminal codes, HTML 3.2 with <font> tags, HTML 4.01 with CSS, XHTML 1.0 with inline CSS styling, LaTeX, and mIRC chat client codes. Flag reference: -version Print out version information. -help A rudimentary help message. -oOUTPUT Write the output to the specified file. -tty Write output with ANSI terminal code colours (this is the default). -html Write output in HTML 3.2 format with font tags. -css Write output in HTML 4.01 format with CSS styling. -icss Write output in XHTML 1.0 format with inline CSS styling. -latex Write output as LaTeX source code. -mirc Output for IRC. -lit When outputting HTML etc, inform HsColour that the input Haskell code is Literate Haskell. -lit-tex When outputting LaTeX, inform HsColour that the input Haskell code is Literate Haskell. -anchor In HTML mode add named anchors. -partial Create output fragments (ie omit the HTML DOCTYPE header, CSS stylesheet link, or LaTeX prologue) for embedding in a larger docu- ment. -print-css Print out the default CSS definitions, in case you lose the .css file. -nolit Turn off -lit mode. -noanchor Turn off -anchor mode. -nopartial Turn off -partial mode. The HsColour homepage is at http://www.cs.york.ac.uk/fp/darcs/hscolour/ . COPYRIGHT
Copyright (C) 2003-2009 Malcolm Wallace and Bjorn Bringert This program comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of this program under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING. AUTHOR
The text for this page was constructed from HsColour's main web page by Erik de Castro Lopo <erikd@mega-nerd.com>, for the Debian GNU/Linux system (but may be used by others). HsColour July 2009 HSCOLOUR(1)
All times are GMT -4. The time now is 02:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy