Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Ext JS Premium Member antonye's Avatar
    Join Date
    May 2010
    Location
    London, UK
    Posts
    27
    Vote Rating
    0
    antonye is on a distinguished road

      0  

    Question Unanswered: Inject VBScript include and function call into ExtJS 4 w/ MVC

    Unanswered: Inject VBScript include and function call into ExtJS 4 w/ MVC


    Strange request, but bear with me...

    We need to do some spell checking on an internal ExtJS application.

    The key there is "internal" which means we have a known platform of Internet Explorer with Microsoft Word installed, and one of the "nice to haves" is to use the user's own dictionary in Word.

    I have a nice little piece of code which I've used a lot previously to do exactly this... but my problem is that it's in VBScript so I will need to either inject this script into my page at some point, or a reference to an include, and then call that function, all in my ExtJS 4.1.3 MVC app.

    What is the best/recommended way of doing this?

    The VBScript function is very simple, and is currently in an include file, and consists of the following code. Remember that this needs to stay as VBScript to interact with the Windows environment and launch Word.

    Code:
    function Spelling_Grammar(TextValue)
         Dim objWord, objDocument, strReturnValue
         Set objWord = CreateObject("word.Application")
         if objWord IS NOTHING then
              MsgBox "Microsoft Word is not installed!" & vbCr & "This is required to check spelling.", vbCritical, "Error"
         else
              objWord.WindowState = 2
              objWord.Visible = False
              'Create a new instance of Document
              Set objDocument = objWord.Documents.Add
              objDocument.Content=TextValue
              objDocument.CheckSpelling
              'Return checked text and quit Word
              strReturnValue = objDocument.Content
              objDocument.Close False
              objWord.Application.Quit True
              MsgBox "Spelling Check Complete!", vbInformation, "Spelling"
         end if
         Spelling_Grammar=strReturnValue
    End function
    You can call the function very simply from a button or image using the following:

    Code:
    onClick="document.all.boxId.value = Spelling_Grammar(document.all.boxId.getText())">
    So ideally I would like to include a reference to my SpellCheck.vbs file (somewhere) in my ExtJS code, and then call the function as above.

    Any thoughts appreciated!

  2. #2
    Ext JS Premium Member antonye's Avatar
    Join Date
    May 2010
    Location
    London, UK
    Posts
    27
    Vote Rating
    0
    antonye is on a distinguished road

      0  

    Default


    So I've had some time to think about this and have managed to do pretty much the same thing in JavaScript rather than using VBScript:

    Code:
    ...
        handler: function () {
            var box = Ext.ComponentQuery.query('#commentaryText')[0];
            var wordApp = new ActiveXObject("Word.Application");
            wordApp.Visible = false;
            wordApp.WindowState = 2;
            wordApp.Documents.Add();
            wordDoc = wordApp.ActiveDocument;
            wordDoc.Content = box.value;
            wordDoc.CheckSpelling();
            box.setValue(wordDoc.Content.Text);
            wordDoc.Close(false);
            wordApp.Quit(true);
        }
    ...
    This works, but the only problem is that the text returned from the wordDoc.Content.Text gets stripped of some formatting such as carriage returns, when it is set into the textArea.

    I'm trying to figure out where that is happening (it's not the returned text) and to see if I can work round this, but otherwise I think I've just about solved it!

Tags for this Thread