<standard autoclean="true" publish="xhtml" publishviewassource="true" continueparagraph="false"><style publishstyles="false" href="[eWebEditProPath]/ektnormal.css" equivClass="strict" wrapstylewithdiv="false" preservewordstyles="false" preservewordclasses="false"></style>
So lame that TinyMCE doesn't have spell check functionality built in. That totally defeats the purpose of not having a local install required solution. Not only that, spell check is an add on that costs additional, thats the final straw I'm going back to VisualFormat.
(Enter Nipper stage left, to add his $0.02 regarding my use of a Mac :-)
function init(){//These are metadata fields that should only be in plain text, and cannot contain double quote characters. IWEventRegistry.addItemHandler("/Meta Data/Values/meta_description", "onItemChange", FilterToText); IWEventRegistry.addItemHandler("/Meta Data/Values/meta_title", "onItemChange", FilterToText); IWEventRegistry.addItemHandler("/Meta Data/Values/meta_primary_keyword", "onItemChange", FilterToText); IWEventRegistry.addItemHandler("/Meta Data/Values/meta_secondary_keyword", "onItemChange", FilterToText); IWEventRegistry.addItemHandler("/Meta Data/Values/meta_tertiary_keyword", "onItemChange", FilterToText); IWEventRegistry.addItemHandler("/Meta Data/Values/meta_additional_keywords", "onItemChange", FilterToText);//These are web content fields that should have 'risky' characters converted to HTML entities. IWEventRegistry.addItemHandler("/Header Information/Headline", "onItemChange", FilterToHTML); IWEventRegistry.addItemHandler("/Header Information/Sub-Headline", "onItemChange", FilterToHTML); IWEventRegistry.addItemHandler("/Header Information/Image Credit", "onItemChange", FilterToHTML); IWEventRegistry.addItemHandler("/Header Information/Image Caption", "onItemChange", FilterToHTML);}/* The following two functions are really heavy handed. I had some problems witting them in OO ways, something about the FormAPI seemed to interfere when I started using encapsulation. Perhaps because everything in here is already encapsulated in some other way, who knows. Doesn't matter this works just as well. Since, in general, these two functions perform identical tasks, just the replacement string varies, it might be better to use a single function with some sort of toggle mechanism to determine whether to use plain text or entity conversion. Also, an easier way to maintain a list of risky characters to convert (well, their Unicode notations anyway) and their entity/plain text conversions would be really appropriate. In the long run expanding this to include non-English characters is an absolute goal for this tool.*/function FilterToText(ThisItem){ InputString = ThisItem.getValue(); var objRegex = new RegExp('\u2019', "g"); //MS Word aposterphe InputString = InputString.replace(objRegex, "'"); objRegex = new RegExp('\u2014', "g"); //MS Word long dash InputString = InputString.replace(objRegex, "--"); objRegex = new RegExp('\u2013', "g"); //MS Word short dash InputString = InputString.replace(objRegex, "-"); objRegex = new RegExp('\u201C', "g");//MS Word left double quote InputString = InputString.replace(objRegex, "''"); objRegex = new RegExp('\u201D', "g");//MS Word right double quote InputString = InputString.replace(objRegex, "''"); objRegex = new RegExp('\u00A9', "g");//Copyright symbol InputString = InputString.replace(objRegex, "(c)"); objRegex = new RegExp('\u00AE', "g");//Registered trademark symbol InputString = InputString.replace(objRegex, "(r)"); ThisItem.setValue(InputString);}function FilterToHTML(ThisItem){ InputString = ThisItem.getValue(); var objRegex = new RegExp('\u00A9', "g"); InputString = InputString.replace(objRegex, "©"); objRegex = new RegExp('\u00AE', "g"); InputString = InputString.replace(objRegex, "®"); objRegex = new RegExp('\u2013', "g"); InputString = InputString.replace(objRegex, "–"); objRegex = new RegExp('\u2014', "g"); InputString = InputString.replace(objRegex, "—"); objRegex = new RegExp('\u2019', "g"); InputString = InputString.replace(objRegex, "’"); objRegex = new RegExp('\u201C', "g"); InputString = InputString.replace(objRegex, "“"); objRegex = new RegExp('\u201D', "g"); InputString = InputString.replace(objRegex, "”"); ThisItem.setValue(InputString);}IWEventRegistry.addFormHandler("onFormInit", init);
So, after reading and posting to this thread I took the comparison paper mentioned above, and with it in mind, implemented a side by side test of these two editors for our web content crew here to get their feedback.Universally, no one here used the spell check within TeamSite, everyone edited in MS Word and then pasted into TeamSite. So the spell check rationale for VF was mute right away. (Besides, we mandate FireFox for all web development staff as the default browser, and it has a build-in spell check for text areas anyway).I found that TinyMCE handles the MS Word character to HTML Entity conversion just fine when directly pasting in from Word (we use 2003 here), so those left and right quotes, the apostrophes, mdashes, all those are handled fine, and without all of the really bad additional mess.So, after doing side by side testing, the result was a unanimous approval to move from VF to TinyMCE, so that's what we've done! I heavily modified the toolbar line, since most of those tools weren't necessary for our users. I left only basic bold/underline/italic, along with lists, the html source button and just a couple others. When people are using Word, its doesn't matter anyway, and more advanced components are built by our web developer staff instead, and placed in page content boxes via widgets rather than placing raw HTML in the WYSIWYG editor boxes... so TinyMCE has actually emerged as the unlikely winner in CARE's little Battle of the WYSIWYG Editors.In addition, I did some work yesterday on fixing those conversions using the FormAPI and have found some success, I'll post it here... I would LOVE to hear people's suggestions for improvement, this is only a first crack, but it seems to be working fairly well (note, these are connected to fields that do NOT have TinyMCE attached to them, this actually broke when I tried to do that, and its not really necessary for fields using TinyMCE anyway): function init(){//These are metadata fields that should only be in plain text, and cannot contain double quote characters. IWEventRegistry.addItemHandler("/Meta Data/Values/meta_description", "onItemChange", FilterToText); IWEventRegistry.addItemHandler("/Meta Data/Values/meta_title", "onItemChange", FilterToText); IWEventRegistry.addItemHandler("/Meta Data/Values/meta_primary_keyword", "onItemChange", FilterToText); IWEventRegistry.addItemHandler("/Meta Data/Values/meta_secondary_keyword", "onItemChange", FilterToText); IWEventRegistry.addItemHandler("/Meta Data/Values/meta_tertiary_keyword", "onItemChange", FilterToText); IWEventRegistry.addItemHandler("/Meta Data/Values/meta_additional_keywords", "onItemChange", FilterToText);//These are web content fields that should have 'risky' characters converted to HTML entities. IWEventRegistry.addItemHandler("/Header Information/Headline", "onItemChange", FilterToHTML); IWEventRegistry.addItemHandler("/Header Information/Sub-Headline", "onItemChange", FilterToHTML); IWEventRegistry.addItemHandler("/Header Information/Image Credit", "onItemChange", FilterToHTML); IWEventRegistry.addItemHandler("/Header Information/Image Caption", "onItemChange", FilterToHTML);}/* The following two functions are really heavy handed. I had some problems witting them in OO ways, something about the FormAPI seemed to interfere when I started using encapsulation. Perhaps because everything in here is already encapsulated in some other way, who knows. Doesn't matter this works just as well. Since, in general, these two functions perform identical tasks, just the replacement string varies, it might be better to use a single function with some sort of toggle mechanism to determine whether to use plain text or entity conversion. Also, an easier way to maintain a list of risky characters to convert (well, their Unicode notations anyway) and their entity/plain text conversions would be really appropriate. In the long run expanding this to include non-English characters is an absolute goal for this tool.*/function FilterToText(ThisItem){ InputString = ThisItem.getValue(); var objRegex = new RegExp('\u2019', "g"); //MS Word aposterphe InputString = InputString.replace(objRegex, "'"); objRegex = new RegExp('\u2014', "g"); //MS Word long dash InputString = InputString.replace(objRegex, "--"); objRegex = new RegExp('\u2013', "g"); //MS Word short dash InputString = InputString.replace(objRegex, "-"); objRegex = new RegExp('\u201C', "g");//MS Word left double quote InputString = InputString.replace(objRegex, "''"); objRegex = new RegExp('\u201D', "g");//MS Word right double quote InputString = InputString.replace(objRegex, "''"); objRegex = new RegExp('\u00A9', "g");//Copyright symbol InputString = InputString.replace(objRegex, "(c)"); objRegex = new RegExp('\u00AE', "g");//Registered trademark symbol InputString = InputString.replace(objRegex, "(r)"); ThisItem.setValue(InputString);}function FilterToHTML(ThisItem){ InputString = ThisItem.getValue(); var objRegex = new RegExp('\u00A9', "g"); InputString = InputString.replace(objRegex, "©"); objRegex = new RegExp('\u00AE', "g"); InputString = InputString.replace(objRegex, "®"); objRegex = new RegExp('\u2013', "g"); InputString = InputString.replace(objRegex, "–"); objRegex = new RegExp('\u2014', "g"); InputString = InputString.replace(objRegex, "—"); objRegex = new RegExp('\u2019', "g"); InputString = InputString.replace(objRegex, "’"); objRegex = new RegExp('\u201C', "g"); InputString = InputString.replace(objRegex, "“"); objRegex = new RegExp('\u201D', "g"); InputString = InputString.replace(objRegex, "”"); ThisItem.setValue(InputString);}IWEventRegistry.addFormHandler("onFormInit", init);
function GetMap(){ var Map = new Array(); Map[0] = new Array('\u2019',"'","’"); //Word aposterphe Map[1] = new Array('\u2014',"--","—"); //Word long dash Map[2] = new Array('\u2013',"-","–"); //Word short dash Map[3] = new Array('\u201C',"''","“"); //Word left double quote Map[4] = new Array('\u201D',"''","”"); //Word right double quote Map[5] = new Array('\u00A9',"(c)","©"); //Copyright Map[6] = new Array('\u00AE',"(r)","®"); //Registered Trademark Map[7] = new Array('\u2026',"...","…"); //Word Ellipsis return Map;}function FilterToText(ThisItem){ var CharMap = GetMap(); InputString = ThisItem.getValue(); for (var i = 0; i < CharMap.length; i++){ var objRegex = new RegExp(CharMap[0], "g") InputString = InputString.replace(objRegex,CharMap[1]); } ThisItem.setValue(InputString);}function FilterToHTML(ThisItem){ var CharMap = GetMap(); InputString = ThisItem.getValue(); for (var i = 0; i < CharMap.length; i++){ var objRegex = new RegExp(CharMap[0], "g") InputString = InputString.replace(objRegex,CharMap[2]); } ThisItem.setValue(InputString);}
...Besides, we mandate FireFox for all web development staff as the default browser
function GetMap(){/* used http://www.digitalmediaminute.com/reference/entity/index.php as reference */ var Map = new Array(); Map[0] = new Array('\u2019',"'","’"); Map[1] = new Array('\u2014',"--","—"); Map[2] = new Array('\u2013',"-","–"); Map[3] = new Array('\u201C',"''","“"); Map[4] = new Array('\u201D',"''","”"); Map[5] = new Array('\u00A9',"(c)","©"); Map[6] = new Array('\u00AE',"(r)","®"); Map[7] = new Array('\u2026',"...","…"); Map[8] = new Array('\u00A1',"","¡"); Map[9] = new Array('\u00B0'," degrees","°"); Map[10] = new Array('\u00BF',"","¿") Map[11] = new Array('\u00A1',"","¡") Map[12] = new Array('\u00C0',"A","À"); Map[13] = new Array('\u00C1',"A","Á"); Map[14] = new Array('\u00C2',"A","Â"); Map[15] = new Array('\u00C3',"A","Ã"); Map[16] = new Array('\u00C4',"A","Ä"); Map[17] = new Array('\u00C5',"A","Å"); Map[18] = new Array('\u00C7',"C","Ç"); Map[19] = new Array('\u00C8',"E","È"); Map[20] = new Array('\u00CA',"E","Ê"); Map[21] = new Array('\u00CB',"E","Ë"); Map[22] = new Array('\u00CC',"I","Ì"); Map[23] = new Array('\u00CD',"I","Í"); Map[24] = new Array('\u00CE',"I","Î"); Map[25] = new Array('\u00CF',"I","Ï"); Map[26] = new Array('\u00D0',"D","Ð"); Map[27] = new Array('\u00D1',"N","Ñ"); Map[28] = new Array('\u00D2',"O","Ò"); Map[29] = new Array('\u00D3',"O","Ó"); Map[30] = new Array('\u00D4',"O","Ô"); Map[31] = new Array('\u00D5',"O","Õ"); Map[32] = new Array('\u00D6',"O","Ö"); Map[33] = new Array('\u00D8',"O","Ø"); Map[34] = new Array('\u00D9',"U","Ù"); Map[35] = new Array('\u00DA',"U","Ú"); Map[36] = new Array('\u00DB',"U","Û"); Map[37] = new Array('\u00DC',"U","Ü"); Map[38] = new Array('\u00DD',"Y","Ý"); Map[39] = new Array('\u00DF',"B","ß"); Map[40] = new Array('\u00E0',"a","à"); Map[41] = new Array('\u00E1',"a","á"); Map[42] = new Array('\u00E2',"a","â"); Map[43] = new Array('\u00E3',"a","ã"); Map[44] = new Array('\u00E4',"a","ä"); Map[45] = new Array('\u00E5',"a","å"); Map[46] = new Array('\u00E7',"c","ç"); Map[47] = new Array('\u00E8',"e","è"); Map[48] = new Array('\u00E9',"e","é"); Map[49] = new Array('\u00EA',"e","ê"); Map[50] = new Array('\u00EB',"e","ë"); Map[51] = new Array('\u00EC',"i","ì"); Map[52] = new Array('\u00ED',"i","í"); Map[53] = new Array('\u00EE',"i","î"); Map[54] = new Array('\u00EF',"i","ï"); Map[55] = new Array('\u00F0',"o","ð"); Map[56] = new Array('\u00F1',"n","ñ"); Map[57] = new Array('\u00F2',"o","ò"); Map[58] = new Array('\u00F3',"o","ó"); Map[59] = new Array('\u00F4',"o","ô"); Map[60] = new Array('\u00F5',"o","õ"); Map[61] = new Array('\u00F6',"o","ö"); Map[62] = new Array('\u00F8',"o","ø"); Map[63] = new Array('\u00F9',"u","ù"); Map[64] = new Array('\u00FA',"u","ú"); Map[65] = new Array('\u00FB',"u","û"); Map[66] = new Array('\u00FC',"u","ü"); Map[67] = new Array('\u00FD',"y","ý"); Map[68] = new Array('\u00FF',"y","ÿ"); return Map;}function FilterToText(ThisItem){ var CharMap = GetMap(); InputString = ThisItem.getValue(); for (var i = 0; i < CharMap.length; i++){ var objRegex = new RegExp(CharMap[0], "g"); InputString = InputString.replace(objRegex,CharMap[1]); } ThisItem.setValue(InputString);}function FilterToHTML(ThisItem){ var CharMap = GetMap(); InputString = ThisItem.getValue(); for (var i = 0; i < CharMap.length; i++){ var objRegex = new RegExp(CharMap[0], "g"); InputString = InputString.replace(objRegex,CharMap[2]); } ThisItem.setValue(InputString);}
I mandated FireFox for the Web Team. The standard for the organization is IE of course. Pffft. Anyway, ok, so I added a whole pile of new characters to the array, ran some functional tests and it didn't seem to drag much at all. Here it is. I'm thinking about posting this as a KB, but I've never done that before, so I'm not really sure of the protocols... Think that would be a good/useful idea?
Anyway, ok, so I added a whole pile of new characters to the array, ran some functional tests and it didn't seem to drag much at all. Here it is...
Okay, so I've done some research on the support site and read the manuals. What I've come up with is a pro/con list for VisualFormat and TinyMCE.Anything missing? Agree/disagree? I think this list will be useful for people in the future when it comes time to discuss why one should be chosen over another.Thanks,/FF