Strict Standards: Only variables should be passed by reference in /home/abeall/public_html/fireworks/download.php on line 28

Warning: Cannot modify header information - headers already sent by (output started at /home/abeall/public_html/fireworks/download.php:28) in /home/abeall/public_html/fireworks/download.php on line 44
// Fireworks JavaScript Command // Copy to Fireworks/Configuration/Commands/ // 2007 Aaron Beall - http://fireworks.abeall.com // Version 1.0 // Requires CS3+ var dom = fw.getDocumentDOM(); var sel = [].concat(fw.selection); function UpperCaseSentence(){ if(!dom) return; var texts = []; for(var s in sel){ if(sel[s] == "[object Text]") texts.push(sel[s]); } if(!texts.length) return alert("Please select at least one text box or some text."); if(texts.length > 1){ for(var t in texts) setTextChars(texts[t],toSentenceCase(texts[t].textChars)); }else{ var selIndex = fw.textInsertionIndex; var selLength = fw.textInsertionLength; if(selIndex == -1){ setTextChars(texts[0],toSentenceCase(texts[0].textChars)); }else{ if(selLength == 0) return alert("Select some text, or select the entire text box."); var chars = texts[0].textChars; setTextChars( texts[0],chars.substring(0,selIndex) + toSentenceCase(chars.substring(selIndex,selIndex+selLength)) + chars.substring(selIndex+selLength,chars.length) ); } } // convert text to "Sentence case" function toSentenceCase(txt){ txt = txt.substr(0,1).toUpperCase() + txt.substr(1).toLowerCase(); // capitalize first char, and lower case the rest txt = txt.replace(/([^\w]i([^\w]|'))/g,function($0){return $0.toUpperCase()}); // capitalize I words (I, I'd, I'll, etc.) return txt.replace(/([\.\?!\n\r]+[\s]*)([a-z]{1,1})/g,function($0){return $0.toUpperCase()}); // capitalize all chars immediately following '.' '?' '!' or line breaks } // replace the characters in a text box while preserving textRuns function setTextChars(text,txt){ //text.textChars = txt; // almost so easy! but it breaks undo //dom.changeCurrentPage(dom.currentPageNum); // hack to force refresh the screen, because changing textChars doesn't refresh the screen var runs = text.textRuns, run, charCount = 0; for(var i=0; i