SpeedStreet
03-11-2004, 10:22 PM
I posted less code then this yesterday...but now I am VERY close to being able to release a hack for integrating ieSpell into vB3.
The problem we are having, is that the new WYSIWYG editor is actually a div, so that programs like ieSpell can't read from it (it needs a textarea).
The code below is supposed to use javascript to replicate the data entered into the wysiwyg editor and place it in a hidden textarea for ieSpell to grab from.
Here is how much I have as of now. I've had some great help from folks like ShAm4n over at DevShed, and I think we are really close to licking this!
Like I said previously, the object here is to replicate the data in a div tag of a WYSIWYG editor so that ieSpell will be able to read from the data and spell check it.
Anyone who cracks this will have a major part in bringing free client side spellchecking to vB3!
PS: If my dream is not possible, please let me know.
Here is the code for the form:
================================================== ====
<script language="javascript">
browsername=navigator.appName;
if (browsername.indexOf("Netscape")!=-1) {
browsername="NS";
} else {
if (browsername.indexOf("Microsoft")!=-1) {
browsername="MSIE";
} else {
browsername="N/A";
}
}
function checkspell() {
try {
var tmpis = new ActiveXObject("ieSpell.ieSpellExtension");
tmpis.CheckAllLinkedDocuments(document);
} catch(exception) {
// nothing
}
}
function spellButton() {
if (browsername=="MSIE") {
try {
var tmpis = new ActiveXObject("ieSpell.ieSpellExtension");
document.write('<input type="button" value="Check Spelling" onclick="checkspell()" class="normal_text">');
tmpis = null;
} catch(exception) {
// nothing
}
}
}
</script>
<script language="JavaScript">spellButton()</script>
================================================== ==============
Here is the code for the form:
================================================== ==============
<!-- This is the existing WYSIWYG code from vB3 -->
<!-- I added the id="message" because I was told to -->
<!-- BEGIN vBCODE -->
<div class="controlbar" id="qrdiv">
<textarea name="message" id="qr_message" class="bginput" style="width:600px; height:100px;" rows="5" cols="60" tabindex="1"></textarea>
<!-- End vBCode -->
<!-- Here is the snippet provided to me -->
<!-- BEGIN SNIPPET -->
<textarea style="display: none" id="message"></textarea>
<script type="javascript">
document.getElementById('message').value = document.getElementById('qr_message').InnerHTML;
</script>
<!-- END SNIPPET -->
<!-- BEGIN vBCODE -->
</div>
<!-- END vBCODE -->
================================================== ================
By all accounts and purposes, I am sure this should work...but it's still giving me the same issues. Can SOMEBODY please help me figure this one out!?
Thanks!
The problem we are having, is that the new WYSIWYG editor is actually a div, so that programs like ieSpell can't read from it (it needs a textarea).
The code below is supposed to use javascript to replicate the data entered into the wysiwyg editor and place it in a hidden textarea for ieSpell to grab from.
Here is how much I have as of now. I've had some great help from folks like ShAm4n over at DevShed, and I think we are really close to licking this!
Like I said previously, the object here is to replicate the data in a div tag of a WYSIWYG editor so that ieSpell will be able to read from the data and spell check it.
Anyone who cracks this will have a major part in bringing free client side spellchecking to vB3!
PS: If my dream is not possible, please let me know.
Here is the code for the form:
================================================== ====
<script language="javascript">
browsername=navigator.appName;
if (browsername.indexOf("Netscape")!=-1) {
browsername="NS";
} else {
if (browsername.indexOf("Microsoft")!=-1) {
browsername="MSIE";
} else {
browsername="N/A";
}
}
function checkspell() {
try {
var tmpis = new ActiveXObject("ieSpell.ieSpellExtension");
tmpis.CheckAllLinkedDocuments(document);
} catch(exception) {
// nothing
}
}
function spellButton() {
if (browsername=="MSIE") {
try {
var tmpis = new ActiveXObject("ieSpell.ieSpellExtension");
document.write('<input type="button" value="Check Spelling" onclick="checkspell()" class="normal_text">');
tmpis = null;
} catch(exception) {
// nothing
}
}
}
</script>
<script language="JavaScript">spellButton()</script>
================================================== ==============
Here is the code for the form:
================================================== ==============
<!-- This is the existing WYSIWYG code from vB3 -->
<!-- I added the id="message" because I was told to -->
<!-- BEGIN vBCODE -->
<div class="controlbar" id="qrdiv">
<textarea name="message" id="qr_message" class="bginput" style="width:600px; height:100px;" rows="5" cols="60" tabindex="1"></textarea>
<!-- End vBCode -->
<!-- Here is the snippet provided to me -->
<!-- BEGIN SNIPPET -->
<textarea style="display: none" id="message"></textarea>
<script type="javascript">
document.getElementById('message').value = document.getElementById('qr_message').InnerHTML;
</script>
<!-- END SNIPPET -->
<!-- BEGIN vBCODE -->
</div>
<!-- END vBCODE -->
================================================== ================
By all accounts and purposes, I am sure this should work...but it's still giving me the same issues. Can SOMEBODY please help me figure this one out!?
Thanks!