Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2006-11-14
11
Medium Priority
?
257 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 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
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…
Loops Section Overview
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

971 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