Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
TeamSite
TeamSite, LiveSite and OpenDeploy
Custom VFE functionality
System
I have a table in a VFE and when a style is selected from the toolbar's drop-down list, I would like for the selected row to inherit the style and/or CSS attributes defined in the associated JS function.
Here is my JS code:
[HTML]
// ---------
eWebEditProExecCommandHandlers["cpb-table-subheading"] = function(sEditorName, strCmdName, strTextData, lData)
{
var vfe = eWebEditPro.instances[sEditorName].editor;
var toPaste = vfe.getSelectedHTML();
toPaste = toPaste.replace(/class=txt/gm,'style="font-size:15px;color:#ff0000;background:#ffffcc"');
vfe.pasteHTML
(
toPaste
);
}
[/HTML]
So, what I'm noticing is that it's pasting the HTML but my understanding from Ektron's documentation is that it's supposed to
replace
the selected text/HTML. It's not doing this. Further, when the new content is added, the styles -- which, in my dummy example refers only to CSS and not a particular class definition -- do not appear. When viewing the HTML source, however, I can see that the new HTML was incorporated as intended (but it didn't replace the old HTML, as described).
Has anyone seen this? Should I use a different VFE function instead?
Find more posts tagged with
Comments
There are no comments yet