Solved

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

Posted on 2006-11-14
11
245 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
  • 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 200 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
 

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 300 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now