We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33992 ☆ A M B ☆
    • 455 Posts
    Hi,
    The Jot snippet has good potential to add ajax features to it. I added &ajax [1|0] parameter as a new parameter to this snippet. Now by this version user can submit comment use all parts by ajax.

    I have not changed the main codes, i’ve just added a javascript file to jot/templates directory and about 20 lines to main class of Jot snippet.

    For ajax commenting,
    You must put your Jot call in a container which has id attribute and DO NOT put your Jot FORM in any container! or give a container to snippet for printing data, see jot/ajax_config.html.


    If &placeholders is on, ajax Jot only updates placeholders below:
    [+jot.html.form+]
    [+jot.html.comments+]
    [+jot.html.moderate+]
    [+jot.html.navigation+]
    [+jot.html.subscribe+]

    for getting output, you must put each placeholder in a container that has id attribute and get IDs to Jot, for do that see jot/ajax_config.html.


    You can also create a dynamic form tpl that sets a ajax form with necessary data when &ajax=`1` and sets a non-ajax form when &ajax=`0` by PHx, see jot/ajax_config.html and jot/templates/chunk.form.inc.html.


    Note: There is an javascript error when using ajax commenting in Internet Explorer 6 and unfortunately i can’t find it. So ajax commenting does not work in IE6 sad but it works well in browsers i’ve tested: Firefox3, Opera9.52, Chrome0.2.149.27 (Chrome uses Apple webkit processors so probably Safari output is same as Chrome)
    But in current version if you use IE6, &ajax will be disabled!



    Thanks
    AHHP
      God loves me. 【ツ】


      MODX.ir (Persian Support)

      Boplo.ir/modx/ (Persian)
      • 27708 MODX Staff
      • 2,502 Posts
      Great Idea. I know it is a short horizon but I think this would make a great addition to the 0.9.6.3 release if it could be tested quickly.

        Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
        • 25663 MODX Staff
        • 12,272 Posts
        Would need to be added to the demo content too. There’s always 0964 or Evo though wink
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 7231
          • 4,205 Posts
          Very cool indeed, thanks. I will give it a test drive as soon as I get some time and report any issues. grin
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don't know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 20289
            • 958 Posts
            Amir, Excellent contribution! smiley

            Ryan, I remember that modxhost theme doesn’t pass the W3C test, Why not using something that represents all the built-in features of 0.9.6 series and passes the W3C test?
              [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
              [td][Wiki] [Persian support forum]
              [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
              [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]
              • 25663 MODX Staff
              • 12,272 Posts
              Time, effort and re-testing. And secret plans for the future stuff. tongue
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 33992 ☆ A M B ☆
                • 455 Posts
                It seems nobody has downloaded it or test it because i found out that the last JS codes that i added to scripts before uploading, made error and the ajax commenting did not work!

                Anyway i fixed it and upgraded the snippet, now there is possible to use all actions by ajax.

                Please test it and report bugs,
                  God loves me. 【ツ】


                  MODX.ir (Persian Support)

                  Boplo.ir/modx/ (Persian)
                  • 20413
                  • 2,877 Posts
                  Can’t wait get from this work computer and try!! I love Jot and with ajax to it... kiss

                  You have any demo page somewhere? smiley
                    @hawproductions | http://mrhaw.com/

                    Infograph: MODX Advanced Install in 7 steps:
                    http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                    Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                    http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                    • 33992 ☆ A M B ☆
                    • 455 Posts
                    I solved the problems and completed the script, Now All actions are AJAX. Please test it.


                    Quote from: mrhaw at Dec 24, 2008, 06:56 PM

                    You have any demo page somewhere? smiley
                    I will create it soon smiley
                      God loves me. 【ツ】


                      MODX.ir (Persian Support)

                      Boplo.ir/modx/ (Persian)
                      • 27708 MODX Staff
                      • 2,502 Posts
                      This works like a charm. Took a little to get it working but WOW! Thanks for this.
                        Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub