Solved

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

Posted on 2006-11-14
11
249 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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
 

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need a tweak in Column code (in Notes view) 5 59
Switching from Lotus Notes to Outlook 4 48
Lotus Notes Calendar Issue 5 110
Lotus Notes shared mailbox 'Sent by' in header 3 68
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…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

786 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