1 of 4
1
AJAX Reloaded
Posted: 31 March 2006 09:48 PM   [ Ignore ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

Back at the end of November, I wrote a DevBlog entry explaining a few of the issues I had with AJAX usage and with JavaScript libraries that might make such usage easier.  Over the past couple months, my views have started shifting to a more positive stance on AJAX and JavaScript libraries as well.  It is getting to the point where I think the next major version of ExpressionEngine will have a JavaScript library or two included in the system by default.  If we do decide to included these libraries, they should make it relatively easy for developers to add AJAX and other dynamic abilities to the ExpressionEngine Control Panel via extensions and modules.  Further, I have a scheme where with the use of a few variables, these libraries could also be included on the user side and used there as well.  We have not totally decided on this, but a few things are making it more likely.

continue…

 Signature 
Profile
 
 
Posted: 31 March 2006 11:34 PM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15368
Joined  05-15-2004

Wow, the Edit Comments plugin is very cool, and another feature request fulfilled… Speaking of which, would it be possible to add a parameter that allows editing for a certain period only? I’d like to allow my commenters to edit their comments for, say, 24 hours, but not weeks or months after the fact.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 01 April 2006 02:20 AM   [ Ignore ]   [ # 2 ]  
Grad Student
Avatar
Rank
Total Posts:  92
Joined  12-12-2002

Amazing!  You keep making my job easier.  Took all of 5 minutes to implement.  I think this makes previewing comments unnecessary, which is great, because I always found the previewing process cumbersome and confusing for users.

 Signature 

Gridwork Design * Site design for small organizations

Profile
 
 
Posted: 01 April 2006 07:05 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
RankRankRank
Total Posts:  978
Joined  06-13-2005

FR:
> a setting where the admin could set a time limit on how long comments are editable


A question:

Where is the variable to limit the time during which a comment can be edited.

F.ex., the forums http://www.times.lv/index.php?Mode=forum give 60 minutes to edit entries.

 Signature 

tulks.com

Profile
 
 
Posted: 01 April 2006 07:12 AM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15368
Joined  05-15-2004

From what I’ve seen there is no built-in limit, yes, which was the reason for my feature request.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 01 April 2006 07:22 AM   [ Ignore ]   [ # 5 ]  
Research Assistant
RankRankRank
Total Posts:  978
Joined  06-13-2005

Then I don’t see reasons to be delighted. I cannot use it.

P.S. The EE wysiwyg extension doesn’t work with EE website links, this plugin doesn’t have the time limit. Many other php programs are using these features for several years.

IMHO

 Signature 

tulks.com

Profile
 
 
Posted: 01 April 2006 07:37 AM   [ Ignore ]   [ # 6 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15368
Joined  05-15-2004

I cannot use it.

That, quite frankly, is your problem. I find it useful the way it is, and I’m certain that feature should be easy to add. I might take a look at it myself this weekend.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 01 April 2006 07:53 AM   [ Ignore ]   [ # 7 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  344
Joined  05-15-2004

When I implement and then hit “save”, it reloads my whole homepage in the space where the editted comment was. 

Any ideas?

Profile
 
 
Posted: 01 April 2006 08:38 AM   [ Ignore ]   [ # 8 ]  
Summer Student
Total Posts:  12
Joined  08-27-2002

Implementing AJAX capabilities to improve control panel efficiency is great.

What would be AMAZING (like the comments section) would be encapsulating an AJAX library in a manner similar to what Ruby on Rails 1.1 has done to give our templates the power of standard AJAX functionality. Obviously, it can’t be as flexible as that in Ruby because tags aren’t as programmable.

Hopefully this is along the lines of what you are proposing.

(As an aside - Yay Ecommerce module!!!)

Profile
 
 
Posted: 01 April 2006 11:19 AM   [ Ignore ]   [ # 9 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  131
Joined  02-06-2005

YAY!! Thanks for the super plugin. It took me no time at all to get it set up. Your instructions are always so clear and easy to understand so again, my thanks.

 Signature 

..: Voted Most Likely To Wear Granny Panties :..

Profile
 
 
Posted: 01 April 2006 11:27 AM   [ Ignore ]   [ # 10 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  283
Joined  12-22-2003

Yes, quite the cool plugin!! Way to go, Paul.

Question though…how/where do I style the edit comment box that appears?

Profile
 
 
Posted: 01 April 2006 11:43 AM   [ Ignore ]   [ # 11 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15368
Joined  05-15-2004

4. Finally, this plugin tag also goes in your {exp:comment:entries} tag and will create
the Edit Comment link that can be clicked by the member who wrote the
comment or by a Super Admin, so that a textarea appears for editing.

{exp:edit_comments:edit_link comment_id=”{comment_id}” author_id=”{author_id}”}
<div class=“posted”>[{text}Edit Comment{/text}]</div>
{/exp:edit_comments:edit_link}

The {text}{/text} variable pair is where you will put the text for the Edit Comment link.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 01 April 2006 11:46 AM   [ Ignore ]   [ # 12 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  283
Joined  12-22-2003

The BOX…not the link.

Profile
 
 
Posted: 01 April 2006 12:50 PM   [ Ignore ]   [ # 13 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

Ingmar - Version 1.0.1 was just uploaded and it now contains a $time_limit variable at the top of the plugin, which allows that ability.

sigork - Come on, do you have to act this way all of the time?  You seem perpetually unsatisfied and often act like you are trying to be a jerk.  We keep a list of members of this forum who receive complaints, and your name is near the top mostly because of your attitude towards pMachine staff.  Cut it out.  The Tiny MCE extension problem you are having is because Tiny MCE is changing your links, not EE.  And this is not the place to add in your little complaint about it.

Halogen - Did you make sure to create a new template and then specify it in the second tag’s edit_link=”” parameter?  Sounds like the AJAX request is hitting the wrong template or a non-existing template (and defaults to index).

DougH - Basically, it is just a textarea inside a hidden div, so if you use CSS to style the textarea HTML element that should work.  Also, in version 1.0.1, I gave the <div> around the textarea a class attribute set to “editCommentBox”, so you can style that as well if that is preferred.

 Signature 
Profile
 
 
Posted: 01 April 2006 04:26 PM   [ Ignore ]   [ # 14 ]  
Grad Student
Rank
Total Posts:  95
Joined  08-14-2003

I’ve wanted this functionality for quite some time. With great anticipation I implemented the plugin for one of my lesser trafficked blogs this afternoon.

If you follow Paul’s instructions it really does the job. As a superadmin, having the ability to edit a comment directly within a discussion page is simply phenomenal.

The plugin adds a bunch of overhead, however. I use page caching on my comments page. You can’t use page caching with the plugin. I tried putting the comment display block into an uncached sub template. Doing so adds an additional query for each comment. Since I paginate at 100 comments per page, that’s a lot of extra queries per page. With over a million posts in the comments table, the queries aren’t trivial.

Paul, is there an alternative way to implement this functionality? It’s really great and I’d love to be able to use it on my site.

Profile
 
 
Posted: 01 April 2006 05:06 PM   [ Ignore ]   [ # 15 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5891
Joined  11-23-2003

Very cool Paul, you guys are machines. 
You mentioned in your post that several Ajax libraries have reached impressive milestones.  Can you specify which ones you are talking about.  I think I might want to play with some of them to get familiar with Ajax before you ship the version of EE.

 Signature 

EE 2.0:  A designers dream becomes a developers dream | Follow me on Twitter.

Profile
 
 
Posted: 01 April 2006 05:16 PM   [ Ignore ]   [ # 16 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  124
Joined  05-14-2004

This worked great! Took some detective work on my end, as my word safe plugin was messing with the code, but I flipped the tag order and all is well!

 Signature 

danielphillip.com

Profile
 
 
Posted: 01 April 2006 05:20 PM   [ Ignore ]   [ # 17 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  136
Joined  06-04-2002

Regarding the Cloner Extension.

I installed it, but when I select “Clone” next to an entry in the edit menu I get “You have tried to access a weblog that does not exist.”  The entries I’m trying to clone are not the default weblog (it’s long gone).

Secondly, with the Cloner Extension installed, if I go to edit an entry, the edit page is broken.  It starts with the warning: “Warning: Invalid argument supplied for foreach() in /home/toongabbieanglican/system/cp/cp.publish.php on line 464”.  The formatting on the page is different, and some of the fields have been filled in with the number “9”.

Version and build details in signature.

 Signature 

Simon Job · blog · twitter | EE sites: maths · church

Profile
 
 
Posted: 01 April 2006 07:06 PM   [ Ignore ]   [ # 18 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

Jim F - Well, the query is done because I need the original comment data sans formatting so I can put it into the textarea for editing.  A plugin cannot get the original comment data simply because the weblog module does not output it without the formatting.  Hence, query.  There is a way around it, but it would require that I use AJAX and some more javascript so that the edit textarea is only created when an edit is requested.  A fair bit more effort to get it working smoothly.  I might put it on my to do list for a future version.  Oh, and no, page caching will not work with this plugin since we need to always know who is viewing the page.  I will make a note of that in the plugin for the next version. 

manofsteel - Prototype, Xajxa (4.3 and above only, sadly), and Moo.fx are what I have been playing with as of late.

Simon Job - Hm, I tested this on two different sites using PHP 4 and PHP 5, so the only thing I can think of is to have you update to the current build.  Something might have changed that I cannot recall right now.

 Signature 
Profile
 
 
   
1 of 4
1
 
‹‹ Battle of the Bulge      Too Many Secrets ››
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64911 Total Logged-in Users: 28
Total Topics: 81862 Total Anonymous Users: 13
Total Replies: 440094 Total Guests: 170
Total Posts: 521956    
Members ( View Memberlist )