Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

L Script to add html code before and after text in a RTF field

Posted on 2006-11-14
11
Medium Priority
?
256 Views
Last Modified: 2013-12-18
I have a body field that users write articles in.

I would like to be allow them to highlight some text and run a script, the script would add [<div class="special">] at the start and [</div>] at the end.

So something like this

some textsome textsome text some text some textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome text
some textsome
[<div class="special">] textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome[</div>]

 textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome text


I do not want to use styles and I want to retain global control over these articles that finally make their way to a website.

Any ideas anyone?

Ta


0
Comment
Question by:tashsmith
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
11 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17942663
That's going to be a very tough one, I think... So it's in a browser? The rich-text field, is it a standard <textarea>, a Java applet or some other solution? What do you see when you look at the page source, in HTML??

No styles?? Then what does class="special" mean???
0
 
LVL 19

Assisted Solution

by:madheeswar
madheeswar earned 800 total points
ID: 17944936
I think we can do it through Lotus Script. It can append the Div and also append the path for the CSS file.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17945378
Browser... :-|
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:tashsmith
ID: 17945472
ok i need to give you guys mor info...

the notes database is a content management system, people are attached through notes clients not a browser..

the rtf field is translasted into html as it goes through domino for publishing.

i would like to be able to in notes allow users to wrap some html around certain paragraphs hence the [], so domino knows it is html.
that way when it reaches the website i can control it look and feel in the global .css file.

0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 1200 total points
ID: 17945573
Maddy, you were right once again.

Still, I think what you want is not possible in LotusScript, on the back-end document: the content of a rich-text field must be saved prior to LotusScript handling.

It might be possible though in Formula language or in the front-end document (NotesUIDocument). Try this:

Sub Click(Source As Button)
  Dim workspace As New NotesUIWorkspace
  Dim uidoc As NotesUIDocument
  Set uidoc = workspace.CurrentDocument
  ' assume the current field has some selected text
  Call uidoc.Cut
  Call uidoc.Inserttext({[<div class="special">]})
  Call uidoc.Paste
  Call uidoc.Inserttext({[</div]})
End Sub
0
 

Author Comment

by:tashsmith
ID: 17945631
hahaha superb!!!!!

It worked first off, legend sjef!

Enjoy the points..
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 17945655
>>Maddy, you were right once again.

Sjef, you got all the points once again.

:(
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17945953
Okay, you have a point there, Madheeswar... I maybe shouldn't have given the code, so Tash would have had to look it up for her(?)self. I'll butt out for a while, and you should check your mail more often.
0
 

Author Comment

by:tashsmith
ID: 17945993

Im not understanding the politics of this at all, but gave the points to Sjef as he (?) provided me with the solution.
Madheeswar, I apologise if you feel you have been unjustifiably denied points and since Sjef feels you have a point, I will request to re-allocate points accordingly.

Thanks for your help chaps!

and yes sjef I am a girl!
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17946210
As opposed to you, I do have an EE-profile... ;-))
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question