Scripts:Animepage:Sourcecode1: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1: Line 1:
<pre>
<pre>
// AniDB-Site-Enhancer-Full-Version
// AniDB-Site-Enhancements
// - Select all files of a group
// - Select all files of a group
// - Replace vote-dropdowns with textfields (enter integers from 100 to 1000)
// - Replace vote-dropdowns with textfields (enter integers from 100 to 1000)
//
//
// Version 20050809.02
// Version 20051204.01
// works with FF1.5 and greasemonkey 0.6.4
// Copyright (c) 2005, Lupin III.
// Copyright (c) 2005, Lupin III.
// Released under the GPL license
// Released under the GPL license
Line 11: Line 12:
//
//
// ==UserScript==
// ==UserScript==
// @name          AniDB-Site-Enhancer-Full-Version
// @name          AniDB-Site-Enhancer
// @namespace  lupin_sanseis_scripts
// @namespace  lupin_sanseis_scripts
// @description  selects all files of a release group, replaces vote dropdowns with textfields
// @description  selects all files of a release group, replaces vote dropdowns with textfields
Line 47: Line 48:
             input.setAttribute('type', 'checkbox');
             input.setAttribute('type', 'checkbox');
             input.setAttribute('id', 'toggle_gid_'+gid);
             input.setAttribute('id', 'toggle_gid_'+gid);
             input.setAttribute('onclick', 'toggle('+gid+')');
             input.setAttribute('value', gid);
            input.addEventListener('click', toggle, false);
             td.appendChild(input);
             td.appendChild(input);
         } else
         } else
Line 90: Line 92:


       // finally add the function for the checkbox onclick-handler to the document
       // finally add the function for the checkbox onclick-handler to the document
       window.toggle =
       function toggle(_gid) {
      function(_gid) {
        var _gid = this.getAttribute('value');
 
         for (var i=0; i < checkbox_names[_gid].length; i++) {
         for (var i=0; i < checkbox_names[_gid].length; i++) {
             document.getElementsByName(checkbox_names[_gid][i])[0].checked = document.getElementById('toggle_gid_'+_gid).checked;
             document.getElementsByName(checkbox_names[_gid][i])[0].checked = document.getElementById('toggle_gid_'+_gid).checked;
Line 118: Line 121:
   window.addEventListener("load", initialize(), false);
   window.addEventListener("load", initialize(), false);


})();</pre>
})(); </pre>
24

edits

MediaWiki spam blocked by CleanTalk.
MediaWiki spam blocked by CleanTalk.