View Single Post
  #1  
Old 03-11-2004, 10:22 PM
SpeedStreet SpeedStreet is offline
 
Join Date: Aug 2002
Posts: 291
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default One Step Away From Spellcheck

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.

PHP Code:
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!
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01242 seconds
  • Memory Usage 1,797KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete