Automatic Point-Splitter for the Lounge: Opera-Version?

LVL 38
Jim P.Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim P.Author Commented:
0
x4uCommented:
What's the problem with the bookmarklet posted by Dan in Opera? As far as I can see there is nothing Firefox specific in it. So it should work with Opera too. I can't test it right now as I don't have any open questions with sufficent answers.
0
Michel PlungjanIT ExpertCommented:
This should work in IE and Mozilla/FF - I do not have opera to test

function spltpnts() { var eex = document.splitPointsForm.getElementsByTagName('tr'); var eetxt =""; var eeflds = new Array(); var eeTxt ='points_'; for (eei=0;eei<eex.length;eei++) {  if (eex[eei].cells[0].className=='questionHeader' && eex[eei].cells[1].className!='yourHeader') { var eey = eex[eei].cells[0].innerHTML; var eePos = eey.indexOf(eeTxt); eeflds[eeflds.length]=eey.substring(eePos,eePos+eeTxt.length+8); } } var p2split = document.body.innerHTML.split('Points to Split')[0]; p2split = p2split.substring(p2split.toLowerCase().lastIndexOf('<b>')+3); var eepts=prompt('Points?',p2split); var eept = eepts/eeflds.length; for (eei=0;eei<eeflds.length;eei++) { document.splitPointsForm.elements[eeflds[eei]].value=eept; p2split-=eept; } if (p2split>0) alert(p2split +'to go');}spltpnts()
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

wertykCommented:
This works in ALL browsers:



javascript:function spltpnts() { alert("Just give all points to wertyk.");} spltpnts()
0
TimYatesCommented:
hahahaha =D
0
Jim P.Author Commented:
Well let me re-phrase the question.  How do you get it to work with opera?
0
Michel PlungjanIT ExpertCommented:
Did you try mine?
What does it say?
0
Jim P.Author Commented:
How do you get the point splitter to work with opera?
0
Michel PlungjanIT ExpertCommented:
I rephrase. What happens in Opera with the code I posted. Nothing? Error messages, what???
0
Jim P.Author Commented:
Need to add this for the complete understanding:

In opera, create a new bookmark.
Edit its properties and set the name to SplitLizard and set  "Location" to the following
------------------------------------------------------------------------------------------------------------------
function spltpnts() { var eex = document.splitPointsForm.getElementsByTagName('tr'); var eetxt =""; var eeflds = new Array(); var eeTxt ='points_'; for (eei=0;eei<eex.length;eei++) {  if (eex[eei].cells[0].className=='questionHeader' && eex[eei].cells[1].className!='yourHeader') { var eey = eex[eei].cells[0].innerHTML; var eePos = eey.indexOf(eeTxt); eeflds[eeflds.length]=eey.substring(eePos,eePos+eeTxt.length+8); } } var p2split = document.body.innerHTML.split('Points to Split')[0]; p2split = p2split.substring(p2split.toLowerCase().lastIndexOf('<b>')+3); var eepts=prompt('Points?',p2split); var eept = eepts/eeflds.length; for (eei=0;eei<eeflds.length;eei++) { document.splitPointsForm.elements[eeflds[eei]].value=eept; p2split-=eept; } if (p2split>0) alert(p2split +'to go');}spltpnts()
------------------------------------------------------------------------------------------------------------------
(it should be one long line) -- verify by scrolling horizonatlly to the end.

To use:  view a Q that is open and is yours, then click the "Split Points" link.  Then execute the above code by selecting SplitLizard from the Bookmarks menu.  It will populate the EditBoxes, but you will still need to select one of the "Accept this..." radio buttons manually, and you must select a grade and you must distribute the "extra" points manually (extra points are displayed as a popup).

Feel free to test it on this question, but I'd prefer to get the entire 500 points with an A for the not-inconsiderable efforts I put into this.  Thanks! :)  
0
Michel PlungjanIT ExpertCommented:
Any reason for the B?
0
Jim P.Author Commented:
I had to go back to the original thread to pick up the instructions.

That's why my above comment about wrapping the splitter script with instructions.  If you want to object post to CS, and I won't argue.
0
Michel PlungjanIT ExpertCommented:
I of course assumed you had read and understood the other thread since that is what started the whole thing...

I was just curious since if the script worked, then an A was in order in my opinion...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.