fyneworks / star-rating Goto Github PK
View Code? Open in Web Editor NEWjQuery Star Rating Plugin
License: MIT License
jQuery Star Rating Plugin
License: MIT License
Here's a link to the original issue I posted a minute ago on gCode:
https://code.google.com/p/jquery-star-rating-plugin/issues/detail?id=140&thanks=140&ts=1388264957
I am sorry, but I didn't figure out how to link your JS to jsfidle. Please read through my issue, I really need this. BTW: I have uploaded the .js, but then it still didn't work, because it couldn't find the images..
What steps will reproduce the problem?
HTML:
<input class="star" type="radio" name="rating" value="1" title="Worst" disabled="disabled" />
<input class="star" type="radio" name="rating" value="2" title="Bad" disabled="disabled" />
<input class="star" type="radio" name="rating" value="3" title="OK" disabled="disabled" />
<input class="star" type="radio" name="rating" value="4" title="Good" disabled="disabled" checked="checked" />
<input class="star" type="radio" name="rating" value="5" title="Best" disabled="disabled" />
<div id="edit">
EDIT
</div>
<script>
$( document ).ready(function() {
$( "#edit" ).click(function() {
$('input').rating('readOnly',false);
});
});
</script>
I have also tried to get rid of the script and change the DIV to this:
<div id="edit" onclick="javascript:$('input[type=radio]',this.form).rating('readOnly',false)" value="Set readOnly = false" class="">
EDIT
</div>
But this also didn't work. It also only displays the "cancel" button, but I can't select any of the stars.
INSPECT ELEMENT classes on the <div role="text">
as I have 5 radio boxes, where the 4th one has selected
attribute.
Original
1-4 star-rating rater-0 star star-rating-applied star-rating-readonly star-rating-on
5 star-rating rater-0 star star-rating-applied star-rating-readonly
After clicking the DIV
1-4 star-rating rater-0 star star-rating-applied star-rating-on
5 star-rating rater-0 star star-rating-applied
What is the expected output? What do you see instead?
I was expecting that clicking the edit div would make the rating active again so I could change the value. But, it somehow glitches. When I click the #edit div the "cancel rating" button is displayed, but I am unable to click on any of the stars. The first screen shot is what I see right after clicking the DIV. The second is a screenshot of how it looks like when I place my mouse over the second star. For some reason Mac doesn't put the mouse to the screenshot, but it is right over the star.. Please, do you have any ideas or tips on what could be causing this issue? Right now the only solution for me is to reload the page and load new rating when the user clicks the edit button, but I really don't want to do that.
What version of the plugin/jQuery are you using?
PLUGIN VERSION: v4.11
JQUERY VERSION: 2.0.3
BROWSER(S) VERSION(S): Chrome 31.0.1650.63
Feel free to provide any additional information below.
I hope this makes some sense. I really don't understand what could be causing the problem here. Since I am doing something so simple. If you would require any ideational information feel free to ask for it. I am looking forward to your reply. Sincerely James B.
The package is not registered in Bower registry and it's name is conflicting with star-rating from cmartinezv https://github.com/cmartinezv/star-rating/blob/master/bower.json
Also I couldn't install with bower install fyneworks/star-rating
and bower install git://github.com/fyneworks/star-rating
, in both cases there's an error:
bower star-rating#* ECMDERR Failed to execute "git ls-remote --tags --heads git://github.com/fyneworks/star-rating.git=git://github.com/fyneworks/star-rating.git", exit code of #128
Additional error details:
fatal: remote error:
fyneworks/star-rating.git=git://github.com/fyneworks/star-rating is not a valid repository name
I was about to switch libraries when I noticed you may be setting up a repo here. A big +1 if this is the case. GitHub makes it easy for us to keep things up-to-date via Composer.
With most jQuery UI widgets, you simply give a container element, and some options, and it will create all the necessary DOM elements. This is not quite possible with this plugin.
What I propose is the addition of a "stars" option, which indicates how many stars to display. Then, if the radios aren't already created, it would create them. This allows all the options for the widget to be defined all in one place (javascript, rather than html and javascript)
'cancelValue' is not working. Using callback the value is always undefined and submitting the form (without ajax) posts nothing instead of cancelValue!
When hovering a star that doesn't have a title, it will show an "on" popup
Hi, I found a problem that the rating stars are missing when we try to reload a page by using Ajax.
How can we fix this?
Why are you initializing plugin from inside the plugin? I'm referring to this line: https://github.com/fyneworks/star-rating/blob/master/jquery.rating.js#L404
This means users shouldn't use class="star" on input elements if they want to initialize plugin themselves otherwsie plugin will initialize twice and cause various bugs such as callback not executing anymore, etc.
How does this plugin differ from @kartik-v's bootstrap-star-rating, which is more popular and actively maintained?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.