1. #1
    Sencha User eVizions's Avatar
    Join Date
    Apr 2007
    Posts
    23
    Vote Rating
    0
    eVizions is on a distinguished road

      0  

    Default Ext.ux.CodePress

    Ext.ux.CodePress


    I've been playing around with trying to integrate CodePress into Ext. I'll share what I have currently and hopefully get a few fresh eyes to help me fix what's still broken.

    To use:

    You must download the CodePress library (http://codepress.org) and use as suggested. Add the following code into a file called 'Ext.ux.codepress.js' and put it in the main codepress folder. Instead of
    HTML Code:
    <script type="text/javascript" src="includes/codepress/codepress.js"></script>
    you would then use
    HTML Code:
    <script type="text/javascript" src="includes/codepress/Ext.ux.codepress.js"></script>
    From there, you call it as a form item:
    PHP Code:
    new Ext.ux.CodePress({
        
    id'docadminTemplateEditor'
        
    language'html'
        
    autoResizetrue
    }) 
    The main config options for it are:
    id: The id of the component
    element: If your code is in a textarea element, put the id here
    code: If you want to input the code via initialization
    language: The language to use
    height: The component's height
    width: The component's width
    autoResize: If you don't enter a width or height and want it to automatically resize (still not perfect)

    There are probably quite a few things still wrong with this at this point, but it's a good start and I figured I would put it out there so others can improve on it as well.


    Download the file here or check out the example here.

  2. #2
    Sencha User galdaka's Avatar
    Join Date
    Mar 2007
    Location
    Spain
    Posts
    1,166
    Vote Rating
    -1
    galdaka is an unknown quantity at this point

      0  

    Default


    Live example please!!

    Thanks in advance,

  3. #3
    Sencha User eVizions's Avatar
    Join Date
    Apr 2007
    Posts
    23
    Vote Rating
    0
    eVizions is on a distinguished road

      0  

    Default


    Since people love live examples, I threw one up quickly here.

    Please note that I am having some issues with it that are noted on the page, but most importantly that it broke (again) in IE, so I would recommend either viewing in Firefox or helping me figure out why I'm getting an 'invalid argument' message in IE7.

    All feedback appreciated.

  4. #4
    Ext User
    Join Date
    Mar 2007
    Posts
    2
    Vote Rating
    0
    redbulljunkie is on a distinguished road

      0  

    Default


    Quote Originally Posted by eVizions View Post
    Since people love live examples, I threw one up quickly here.

    Please note that I am having some issues with it that are noted on the page, but most importantly that it broke (again) in IE, so I would recommend either viewing in Firefox or helping me figure out why I'm getting an 'invalid argument' message in IE7.

    All feedback appreciated.
    Did a quick check in the IE script debugger which breaks on this line

    this.editor.body.style.width = w + 'px';

    Try removing the ' + 'px' ' at the end of the line as you already add this previously.

  5. #5
    Sencha User galdaka's Avatar
    Join Date
    Mar 2007
    Location
    Spain
    Posts
    1,166
    Vote Rating
    -1
    galdaka is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by eVizions View Post
    Since people love live examples, I threw one up quickly here.

    Please note that I am having some issues with it that are noted on the page, but most importantly that it broke (again) in IE, so I would recommend either viewing in Firefox or helping me figure out why I'm getting an 'invalid argument' message in IE7.

    All feedback appreciated.
    OK I have error with IE6.

  6. #6
    Sencha User eVizions's Avatar
    Join Date
    Apr 2007
    Posts
    23
    Vote Rating
    0
    eVizions is on a distinguished road

      0  

    Default


    Thanks redbulljunkie... that seemed to do the trick. Code has been updated.

  7. #7
    Sencha User galdaka's Avatar
    Join Date
    Mar 2007
    Location
    Spain
    Posts
    1,166
    Vote Rating
    -1
    galdaka is an unknown quantity at this point

      0  

    Default


    Thanks good work!

  8. #8
    Ext User
    Join Date
    Mar 2007
    Posts
    30
    Vote Rating
    0
    kevinzc is on a distinguished road

      0  

    Default Tested, Great

    Tested, Great


    Tested, Working, Great !

  9. #9
    Ext User
    Join Date
    May 2007
    Posts
    71
    Vote Rating
    0
    DeeZ is on a distinguished road

      0  

    Thumbs up


    Great ! Thank you.
    Coud you please add it to the user community extension page ? => http://extjs.com/learn/Ext_Extensions

  10. #10
    Sencha User eVizions's Avatar
    Join Date
    Apr 2007
    Posts
    23
    Vote Rating
    0
    eVizions is on a distinguished road

      0  

    Default


    Created as an Extension : http://extjs.com/learn/Extension:CodePress