Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 242
  • Last Modified:

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

0
Jim P.
Asked:
Jim P.
1 Solution
 
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now