Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: CodePress is not a constructor

  1. #11
    Ext User
    Join Date
    Jun 2009
    Posts
    11

    Default

    Quote Originally Posted by Animal View Post
    Post a screenshot of Firebug's Net tab showing the GET.
    Get request:
    <script src="/system/admin/js/ExtJS/plugins/Ext.ux.plugins.codepress.js" type="text/javascript"></script>

    <script type="text/javascript">
    myCMS.editot = function() {

    var cp = new Ext.ux.CodePress({
    id: 'code_content',
    sourceEl: 'ext_html_example',
    language: 'php',
    width: 600,
    height: 600,
    autoResize: true,
    //, initialized: true,
    //, url // ?????? ??????,
    //, renderTo: 'codepressTestDiv'
    });

    //
    var editForm = new Ext.FormPanel({
    border:false,
    //reader:new Ext.data.JsonReader({}, ['content']),
    items:cp
    });
    // public space
    return {
    // public methods
    init: function() {
    var desktop = MyDesktop.getModule('editor-win').app.getDesktop();
    var win = desktop.getWindow('editor-win');
    if(!win){
    win = desktop.createWindow({
    id:'editor-win',
    title:'????????????',
    width:600,
    height:500,
    minWidth:300,
    minHeight:200,
    tools:[{
    id:'help',
    handler: function(){
    Ext.get('loading').show();
    Ext.get('loader').load({
    waitMsg:'?????????...',
    url:'/admin/help/index/context/config',
    scripts:true
    });
    }
    }],
    layout:'fit',
    buttonAlign:'right',
    iconCls:'bogus',
    shim:false,
    animCollapse:false,
    constrainHeader:true,
    items:editForm,
    buttons:[{
    text:'?????????',
    iconCls:'save',
    handler:function() {
    if (editForm.form.isValid()) {
    editForm.form.submit({
    waitMsg:'?????????...',
    url:'/admin/config/save',
    failure:function(form, action) {
    Ext.MessageBox.alert('??????', action.result.msg);
    },
    success:function(form, action) {
    Ext.MessageBox.alert('??????????', '?????? ??????? ?????????');
    win.close();
    }
    });
    } else {
    Ext.MessageBox.alert('??????', '??????? ?????????? ??????');
    }
    }
    }]
    });
    //editForm.form.load({url:'/admin/config/load', waitMsg:'?????????...'});
    } else {
    Ext.MessageBox.alert('??????', '???????? ?????? ??? ???????!');
    }
    Ext.get('loading').hide();
    win.show();
    }
    };
    }();

    Ext.onReady(myCMS.editot.init, myCMS.editot);
    </script>

  2. #12
    Ext User
    Join Date
    Jun 2009
    Posts
    11

    Default

    Quote Originally Posted by Animal View Post
    Post a screenshot of Firebug's Net tab showing the GET.
    Code:
    <!--script src="/system/admin/systems/editor/engines/gecko.js" type="text/javascript"></script-->
    <!--script src="/system/admin/systems/editor/codepress.js" type="text/javascript"></script-->
    <!--link href="/system/admin/systems/editor/codepress.css" rel="stylesheet" type="text/css" /-->
    
    <script src="/system/admin/js/ExtJS/plugins/Ext.ux.plugins.codepress.js" type="text/javascript"></script>
    
    <script type="text/javascript">
    myCMS.editot = function() {
    	
    	var cp = new Ext.ux.CodePress({
    		id: 'code_content',
    		sourceEl: 'ext_html_example',
    		language: 'php',
    		width: 600,
    		height: 600,
            autoResize: true,
            //, initialized: true,
            //, url // ?????? ??????,
    		//, renderTo: 'codepressTestDiv'
    	});
    	
    	//
        var editForm = new Ext.FormPanel({
            border:false,
            //reader:new Ext.data.JsonReader({}, ['content']),
            items:cp
        });
    // public space
    return {
    // public methods
    init: function() {
        var desktop = MyDesktop.getModule('editor-win').app.getDesktop();
        var win = desktop.getWindow('editor-win');
        if(!win){
            win = desktop.createWindow({
                id:'editor-win',
                title:'????????????',
                width:600,
                height:500,
                minWidth:300,
                minHeight:200,
                tools:[{
                    id:'help',
                    handler: function(){
                    Ext.get('loading').show();
                    Ext.get('loader').load({
                        waitMsg:'?????????...',
                        url:'/admin/help/index/context/config',
                        scripts:true
                        });
                    }
                }],
                layout:'fit',
                buttonAlign:'right',
                iconCls:'bogus',
                shim:false,
                animCollapse:false,
                constrainHeader:true,
                items:editForm,
                buttons:[{
                    text:'?????????',
                    iconCls:'save',
                    handler:function() {
                    if (editForm.form.isValid()) {
                        editForm.form.submit({
                            waitMsg:'?????????...',
                            url:'/admin/config/save',
                            failure:function(form, action) {
                            Ext.MessageBox.alert('??????', action.result.msg);
                            },
                            success:function(form, action) {
                                Ext.MessageBox.alert('??????????', '?????? ??????? ?????????');
                                win.close();
                                }
                            });
                        } else {
                            Ext.MessageBox.alert('??????', '??????? ?????????? ??????');
                            }
                    }
                }]
                });
            //editForm.form.load({url:'/admin/config/load', waitMsg:'?????????...'});
            } else {
                Ext.MessageBox.alert('??????', '???????? ?????? ??? ???????!');
                }
        Ext.get('loading').hide();
        win.show();
        }
    };
    }();
    
    Ext.onReady(myCMS.editot.init, myCMS.editot);
    </script>

  3. #13
    Ext User
    Join Date
    Jun 2009
    Posts
    11

    Default

    Quote Originally Posted by Animal View Post
    Post a screenshot of Firebug's Net tab showing the GET.
    HTML Code:
    <!--script src="/system/admin/systems/editor/engines/gecko.js" type="text/javascript"></script-->
    <!--script src="/system/admin/systems/editor/codepress.js" type="text/javascript"></script-->
    <!--link href="/system/admin/systems/editor/codepress.css" rel="stylesheet" type="text/css" /-->
    
    <script src="/system/admin/js/ExtJS/plugins/Ext.ux.plugins.codepress.js" type="text/javascript"></script>
    
    <script type="text/javascript">
    myCMS.editot = function() {
    	
    	var cp = new Ext.ux.CodePress({
    		id: 'code_content',
    		sourceEl: 'ext_html_example',
    		language: 'php',
    		width: 600,
    		height: 600,
            autoResize: true,
            //, initialized: true,
            //, url // ?????? ??????,
    		//, renderTo: 'codepressTestDiv'
    	});
    	
    	//
        var editForm = new Ext.FormPanel({
            border:false,
            //reader:new Ext.data.JsonReader({}, ['content']),
            items:cp
        });
    // public space
    return {
    // public methods
    init: function() {
        var desktop = MyDesktop.getModule('editor-win').app.getDesktop();
        var win = desktop.getWindow('editor-win');
        if(!win){
            win = desktop.createWindow({
                id:'editor-win',
                title:'????????????',
                width:600,
                height:500,
                minWidth:300,
                minHeight:200,
                tools:[{
                    id:'help',
                    handler: function(){
                    Ext.get('loading').show();
                    Ext.get('loader').load({
                        waitMsg:'?????????...',
                        url:'/admin/help/index/context/config',
                        scripts:true
                        });
                    }
                }],
                layout:'fit',
                buttonAlign:'right',
                iconCls:'bogus',
                shim:false,
                animCollapse:false,
                constrainHeader:true,
                items:editForm,
                buttons:[{
                    text:'?????????',
                    iconCls:'save',
                    handler:function() {
                    if (editForm.form.isValid()) {
                        editForm.form.submit({
                            waitMsg:'?????????...',
                            url:'/admin/config/save',
                            failure:function(form, action) {
                            Ext.MessageBox.alert('??????', action.result.msg);
                            },
                            success:function(form, action) {
                                Ext.MessageBox.alert('??????????', '?????? ??????? ?????????');
                                win.close();
                                }
                            });
                        } else {
                            Ext.MessageBox.alert('??????', '??????? ?????????? ??????');
                            }
                    }
                }]
                });
            //editForm.form.load({url:'/admin/config/load', waitMsg:'?????????...'});
            } else {
                Ext.MessageBox.alert('??????', '???????? ?????? ??? ???????!');
                }
        Ext.get('loading').hide();
        win.show();
        }
    };
    }();
    
    Ext.onReady(myCMS.editot.init, myCMS.editot);
    </script>

  4. #14
    Ext User
    Join Date
    Jun 2009
    Posts
    11

    Default

    Quote Originally Posted by Animal View Post
    Post a screenshot of Firebug's Net tab showing the GET.
    Get requst
    http://www.atm-soft.net/sc/sc1.txt

  5. #15

    Default

    Hmmm... it's a bit impractical, don't you think, for you to say, "here's a bug in my code, now will everybody-out-there please fix it for me."

    You need to approach your problem in a systematic way:

    1. Use Firebug to set a breakpoint at an appropriate point in your code, e.g. the statement before the point where it blows up. Reload the page to run to that break point.
    2. Now, look at the Scripts pull-down to see if all of the JavaScript modules that you expect to be listed ... are listed.
    3. Nearby variables may or may not automatically be listed as "watch expressions" but if you select or type-in a variable name, you should see a meaningful value (not "undefined") for it. Also see that this points to what you expect it to.
    4. If everything that you expect to be there, is there, then your statement-syntax is probably 'subtly wrong.' (For example, omitting "()," or including it, at the wrong times.)

    Make the effort, and give us something we can realistically answer. But don't ask a forum to "do your job for you." We have bugs of our own.

  6. #16
    Ext User
    Join Date
    Jun 2009
    Posts
    11

    Default

    Quote Originally Posted by Mike Robinson View Post
    Hmmm... it's a bit impractical, don't you think, for you to say, "here's a bug in my code, now will everybody-out-there please fix it for me."

    You need to approach your problem in a systematic way:

    1. Use Firebug to set a breakpoint at an appropriate point in your code, e.g. the statement before the point where it blows up. Reload the page to run to that break point.
    2. Now, look at the Scripts pull-down to see if all of the JavaScript modules that you expect to be listed ... are listed.
    3. Nearby variables may or may not automatically be listed as "watch expressions" but if you select or type-in a variable name, you should see a meaningful value (not "undefined") for it. Also see that this points to what you expect it to.
    4. If everything that you expect to be there, is there, then your statement-syntax is probably 'subtly wrong.' (For example, omitting "()," or including it, at the wrong times.)

    Make the effort, and give us something we can realistically answer. But don't ask a forum to "do your job for you." We have bugs of our own.
    I do not ask to do for me work, I cannot understand an error and I ask to help me

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •