Ajax Slider Rating System (not Star Rating) - ajax

I'm looking for a Ajax rating script similar to the one on metacritic, ign, gamespot, etc.
(example)
I've found only star rating systems and one slider that is not similar to the one that I'm looking for. (jquery ui slider)
Anyone knows something like that I'm looking for? Otherwise I'm willing to pay someone for this work.

It's not hard to roll your own, you just need a combination of jQuery/AJAX, CSS and the server-side poison of your choice.
Here is an example:
http://www.99points.info/2010/05/ajax-rating-system-create-simple-ajax-rating-system-using-jquery-ajax-and-php/
Essentially you wire up client-side event handlers which do AJAX HTTP POST requests to your server-side handler/web service, which then return back the response.
Now, that example isn't exactly a "slider" but it illustrates how it can be accomplished.
Check out this site for a multitude of AJAX slider examples - you just need to combine the two principles (rating and slider) and you're good to go.
Obviously if you don't like the "look" of it, you can mess with the CSS/hovering effects to suit your needs, but that should get you up and running.

Related

Laravel - open popup/modal for each post from list

I have a page with a list of blog posts.
What would be the best way to open the post content on the same page in a modal, without redirecting to the single post page?
What I thought it's to make it in vanilla JS, to have an event on each post, have the data for all the posts in some array or each inside an attribute and when the event is triggered, fill the data for that post in the modal and show it. Maybe I can use AlpineJS for this.
Seems rudimentary to have it in vanilla, is there a better way to do it?
I also thought about Livewire, but I'm afraid it will be slow, have looked on some videos on YT, and when the button was clicked, it was visible when the data was filling in, looked slow.
Have thought also to make API calls, but I'd have to make the authentication work on that specific route, which would complicate it too much I guess, since it's going to be used just for this page.
What are your thoughts, how would you do it?
All your suggestions would work. Just depends on what you prefer and are able to implement. Also, think around opening the Post content in a modal, how much data do you want to load in the modal? Such questions will assist in you deciding the best way to design the post page.

Comic navigation in joomla?

I have a joomla site and would like to integrate some old unfinished webcomics to it, so I can pick them up where I stopped in a CMS that won't leave me in an absolute frothing rage (thanks, wordpress).
I've got some experience with Joomla and I believe it would be a pretty good platform for managing multiple comics... except for the small issue of horrid navigation between pages/articles. Joomla's integrated article navigation is a humble but passable start, but if you intend to use categories to organize chapters then getting from the end of one to the beginning of the next is... yeah. This is a pity, as Joomla's category and article management options are beautiful for archiving and presentation, and adding gantry 5 to it means a great deal of control over the reading experience. Basically, joomla has pretty much everything I want, except for the navigation.
Ideally, what I'd like to be able to accomplish for comic navigation in joomla is:
Clickable full-article-image leading to next article/page
Prev/next article buttons (already available)
Prev/next category buttons (do we have those?)
The latter two in a module I can choose where to publish (optional)
And this is it, basically. I understand that implementing the first could be very hard without some major template customization, in which case I'd be willing to insert the image as a link in the article body... but only if there was one single code I could use, like the one that generates the next category article button. Because I'm not willing to create hundreds of menu items to generate links page-by-page.
So is any of this doable?
This is a quick answer but too much for a comment. I'm assuming since you are on SO that you don't mind coding (as opposed to just configuring).
I think you need to do two things. First you need to create a pagination.php for your template. This will let you really super control what the pagination looks like. You can have images, special css and js, whatever you want. You can also add the "last" and "first" options.
I think you need to make a new plugin to replace the core pagenavigation plugin and that also generates the previous/next category links. (Or I guess you could make one just to do categorynavigation depending on what you want.) HOWEVER, it seems to me that there is data on the sibling links that is already being generated in the content category model so you might be able to use that. (Check the code; I think there was never a UI for it, but it is there. Even if it isn't there, siblings are very easy to obtain in nested sets)
The other thing you can really think about if you go that route is changing the whole thing somewhat to use a module that gets the current ID and category ID from JInput. You might also be able to use JPagination. The important thing, however is that you make sure to do the caching the way the pagination that is there does it. In other words you really want to cache the whole list in the order you want so you are not running so many queries and slowing your site down. You may want to look at the categories and category modules to get some ideas about the queries to do.
Hope that gets you started, but it is definitely something you can do without too much trouble.

Backbone JS conceptualization: I'm refactoring a menus app to use Backbone.js: what views/models should I use?

I am taking the lead on refactoring a school lunch menus app to use backbone.js instead of just server-rendered html and jquery: http://tinyurl.com/74nlsu5 . I've never done front-end MVC before, and I'm having trouble figuring out conceptually what the views/models/collections would be.
Can someone take a look at the site and recommend what some of the models/views/collections would be? Conceptualizing a full menu site like this is a bit more complex than a simple TODO or many of the examples I've seen, so a kickstart would be much appreciated to make sure i get started on the right foot.
It's really really hard to provide answers to making FULL Site with Backbone in my answer. So I would provide you with these tips, see what applies to your site and modify them to your liking.( I think you will be spending more time now on SO asking Backbone questions)
Tip #1
Ask a designer to put storyboard of site example1 and example2
Tip #2
From the storyboard draw Grid's putting each functional module as a MVC component example
Tip #3
Refine your models, collections to consumable and maintainable number. Then refine some more. From my experience the pages i developed never had more than 3 models and two collections.
Tip #4
Reuse, Reuse and Reuse again. Server resources and DB call's are costly (unless implemented intelligently with caching, indexing and clever programming). Opt for client localStorage caching use scripts such as Kizzy, use same models to display different views
Tip #5
All customers want is solution to their problem. Don't through a philosophy at them. UX design does not matter the most i have come across sites which were looking extremely simple and really awesome at doing the job. ( I got no time to look at your fancy jingling bananas[means all fancy animations, shiny buttons], but other dev's do)
Tip #6
Sit with single model,view and collection finish it. Try the UI with what ever you think customer will do( not you, not even your manager) your intention here is to find quirks. I noted that signup for newsletter appends validation message each time i click signup
Tip #7
Never assume any views existing in the html sent from server. Views should be self containing
have anything more you want me to answer i will add them here :)

Looking for an anti-spam solution easier to implement than Captcha

I'm looking for a simple anti spam form submission solution, other than Captcha. I've tried implementing Captcha into my website for anti-spam purposes, but it's been too difficult to integrate into the site. I don't get many spam attacks but I'd like to have something in place for the random spam that I get. Does anyone know of something they think would work?
you can add an additional textfield to your form and hide it with css. human users don't see the field, so it should always be empty. spambots usually fill out all form fields and don't know that this one is hidden. if you receive any content in this field, reject the form submission.
Put up something like "What is 3 plus 6?" and give the user a form to type the answer. Any human will get that, including blind ones who can't see a captcha, but no bot will. You don't even need to vary the numbers, really.

What are the "best practices" for AJAX with Django (or any web framework)

I am developing an issue tracking application in Django, mostly for a learning exercise but also for my own projects - and I am looking into using some AJAX for "enhanced" usability. For example, allowing users to "star" particular issues, which would add them to their watch list. This is implemented in a lot of sites, and is often AJAX - as the URL that the user is viewing doesn't need to change when they click the star.
Now, I am wondering what kind of response to return from my star_unstar view - that detects whether the request is being made via AJAX or not.
At present, if the request is an AJAX request, it returns just the section of HTML that is needed for the star, so I can replace the HTML in the star's parent DIV, so as the star appears "on" or "off", depending on the user's action.
However, I would much rather return some kind of JSON object, as it just seems more "proper", I think. The problem with this method is that the javascript would have to modify the star image's src attribute, the href on it, and the link title also, which seems a lot of work for such a simple feature. I am also looking into in-line commenting in the future, but I want to get a feel for how things "should" be done before I start coding lots of JS.
What is the general consensus when implementing features such as this, not just with Django, but all frameworks that operate in a similar way?
When I work with Ajax my main concern is usually to limit the amount of data I have to send. Ajax applications of this type should be very responsive (invisible if possible).
In the case of toggling a star, I would create the actual on/off states as CSS classes, StarOn and StarOff. The client will download both the off and on star when they first visit the page, which is acceptable considering that the star is a small image. When you want to change the star appearance in the future, you'll only be editing CSS, and won't have to touch the javascript at all.
As for the Ajax, I'd send back and forth one thing -- a JSON variable true/false that says whether or not the request was successful. As soon as the user clicks on the star, I'd change it to the StarOn state and send out the request. 99% of the time Ajax will return true and the user will not even realize that there was some sort of delay in the web request. In the rare case where you get a false back, you'll have to revert the star to StarOff and display an error message to the user.
I don't think your question relates particularly to Django or Python, as you point out at the end.
There's a lot of personal preference in whether you return a blob of HTML to write into the DOM or some serialized data as JSON. There are some practical factors you might want to take into account though.
Advantages of HTML:
- Easy and fast to write straight into the page.
Advantages of JSON:
- Not coupled to the front-end of your application. If you need that functionality anywhere else in the application, it is there ready to go.
My call on it. It's only a relatively trivial amount of HTML to update, and I'd probably go for returning JSON in this case and giving myself the extra flexibility that might be useful down the road.

Resources