Topic: Jot 1.1.4 ajax version  (Read 5485 times)

Pages: [1]   Go Down

#1: 22-Dec-2008, 11:13 AM

Moderators

AHHP
Posts: 397

Salut capitan,

WWW
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:
Code:
[+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

* Jot_1.1.4_ajax.zip (31.38 KB - downloaded 212 times.)
« Last Edit: 15-Jan-2009, 09:44 AM by AHHP »

#2: 22-Dec-2008, 11:19 AM

Administrator

smashingred
Posts: 1,422

Jay Gilmore

WWW
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.

« Last Edit: 22-Dec-2008, 11:24 AM by smashingred »

#3: 22-Dec-2008, 11:47 AM

Foundation

rthrash
Posts: 11,352

WWW
Would need to be added to the demo content too. There's always 0964 or Evo though Wink
MODx is a content managmeent framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Please help us help you when asking for assistance and read the wiki. Searching the forums from the top level helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.

#4: 22-Dec-2008, 04:04 PM

Testers

dev_cw
Posts: 4,179

WWW
Very cool indeed, thanks. I will give it a test drive as soon as I get some time and report any issues.  Grin
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]

#5: 22-Dec-2008, 04:09 PM

Moderators

MotSmart
MODx RTL Guru.
Posts: 923

WWW
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?
[Search] [Add-ons] | [MODx Lovers Don't miss this link!]
[Documentation] [Wiki]
[Persian support forum]
[RoadMap] [SVN] [RTL SVN Branch] [Development] [Trac] [FishEye+Crucible] [Confluence] | [My Google Code]
[برای دسترسی به راهنمای فارسی به  » وبگاه مادایکس فارسی « و یا به » انجمنهای پشتیبانی فارسی مادایکس « مراجعه کنید]
A Person is Either your Brother in Faith or Your Equal in Humanity. - Imam Ali.  # Discover Islam. | # Discover Middle East @ PressTV.Creation of Earth and Sky and the birth of Adam
BBC, CNN, FOX, MSNBC: Israeli officials: We don't want to kill (AKA Genocide) innocent people of Gaza. ~ Stupid Me, Myself: So why don't you stop doing so?!

#6: 22-Dec-2008, 04:23 PM

Foundation

rthrash
Posts: 11,352

WWW
Time, effort and re-testing. And secret plans for the future stuff. Tongue
MODx is a content managmeent framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Please help us help you when asking for assistance and read the wiki. Searching the forums from the top level helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.

#7: 24-Dec-2008, 03:39 PM

Moderators

AHHP
Posts: 397

Salut capitan,

WWW
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,
« Last Edit: 24-Dec-2008, 03:56 PM by AHHP »

#8: 24-Dec-2008, 06:56 PM


mrhaw
Posts: 1,932

modx == freedom

WWW
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
My playground: http://4up2date.info | Twitter: mrhaw
---> Check out: ReadSpeaker webReader Plugin | Support/Comments Thread

--=[ MR. HAW ]=--

#9: 3-Jan-2009, 02:07 PM

Moderators

AHHP
Posts: 397

Salut capitan,

WWW
I solved the problems and completed the script, Now All actions are AJAX. Please test it.


You have any demo page somewhere?  Smiley
I will create it soon   Smiley

#10: 5-Jan-2009, 08:55 AM

Administrator

smashingred
Posts: 1,422

Jay Gilmore

WWW
This works like a charm. Took a little to get it working but WOW! Thanks for this.

#11: 14-Jan-2009, 11:21 PM

Administrator

zi
MODx Special Forces /
Posts: 3,555

May Peace Be On You

WWW
Does this fall back to non-ajax form in IE6? and still posts the comment?

#12: 15-Jan-2009, 09:50 AM

Moderators

AHHP
Posts: 397

Salut capitan,

WWW
Does this fall back to non-ajax form in IE6? and still posts the comment?

Thank you Zi, it can cover problem with IE6.
So in current attached Jot, if user use IE6, &ajax will be 0.

#13: 25-Jan-2009, 10:47 AM

nikk
Posts: 7

Can't get it work with input buttons with type="image", + if captcha is enabled there is error on refresh captcha link with example form
« Last Edit: 31-Jan-2009, 11:57 AM by nikk »

#14: 9-Feb-2009, 08:21 PM

Moderators

AHHP
Posts: 397

Salut capitan,

WWW
This hack only gets data from form by JS and sends it to Jot files and display results it means all processes are same as when &ajax=0

Can't get it work with input buttons with type="image"
The JS use an element which has id="ajax_jot" and onclick="ajax_comment('submit');" so it is not important that what the element is. it can be button, link, a simple word, an image or etc.


if captcha is enabled there is error on refresh captcha link with example form
What error you get on refreshing captcha?

#15: 11-Jul-2009, 03:50 PM

x0149128
Posts: 411

Hi,

I like the idea of this, how I install it? Is it just a case of replacing the current Jot snippet code with the new code?

#16: 12-Jul-2009, 12:14 AM

Administrator

zi
MODx Special Forces /
Posts: 3,555

May Peace Be On You

WWW
Hi,

I like the idea of this, how I install it? Is it just a case of replacing the current Jot snippet code with the new code?

It should be only this, but you will have to test it before changing the calls on the live page.

#17: 12-Jul-2009, 07:44 AM

Moderators

AHHP
Posts: 397

Salut capitan,

WWW
Hi,

I like the idea of this, how I install it? Is it just a case of replacing the current Jot snippet code with the new code?

It should be only this, but you will have to test it before changing the calls on the live page.
... and read .html file in package.

#18: 28-Jan-2010, 11:01 AM

Bartol
Posts: 17

When you are 11 comments, and found 10 per page, there is a transition on the pages, in IE 8 problem, there is "Loading Please wait ...." and so many times each time you press the transition between pages is not happening.
Maybe you know how to correct?
« Last Edit: 28-Jan-2010, 11:10 AM by Bartol »
Pages: [1]   Go Up
0 Members and 1 Guest are viewing this topic.