MCPcopy Create free account
hub / github.com/Tampermonkey/tampermonkey / createSortable

Function createSortable

src/fire.js:150–238  ·  view source on GitHub ↗
(i, ext, text, cmp, dflt)

Source from the content-addressed store, hash-verified

148 var r = [];
149
150 var createSortable = function(i, ext, text, cmp, dflt) {
151
152 var t = crc('div', "settingsth", i.name, i.id, ext);
153
154 var markSort = function(a, a_up, a_down) {
155 var mu = document.getElementsByName('settingsth_a_up' + i.name);
156 var md = document.getElementsByName('settingsth_a_down' + i.name);
157 var mh;
158 var ms;
159 for (var e=0; e<mu.length; e++) {
160 mu[e].style.display = 'none';
161 }
162 for (var e=0; e<md.length; e++) {
163 md[e].style.display = 'none';
164 }
165 if (scriptOrderDown) {
166 a_up.style.display = '';
167 } else {
168 a_down.style.display = '';
169 }
170 };
171
172 var a = crc('a', "settingsth_a", i.name, i.id, ext + '_a');
173 a.setAttribute('name', 'settingsth_a' + i.name);
174 var a_up = crc('a', "settingsth_a_up", i.name, i.id, ext + '_a_up');
175 a_up.setAttribute('name', 'settingsth_a_up' + i.name);
176 var a_down = crc('a', "settingsth_a_down", i.name, i.id, ext + '_a_down');
177 a_down.setAttribute('name', 'settingsth_a_down' + i.name);
178
179 a_up.style.display = 'none';
180 a_down.style.display = 'none';
181
182 var mS = function() {
183 markSort(a, a_up, a_down);
184 };
185 var cb = function() {
186 mS();
187 Please.hide();
188 };
189 var sort = function() {
190 var run = function() {
191 scriptOrder = cmp;
192 sortScripts(scriptItems, scriptOrder, scriptOrderDown, cb);
193 };
194 Please.wait(I18N.getMessage("Please_wait___"));
195 window.setTimeout(run, 1);
196 };
197 var sortUp = function() {
198 var run = function() {
199 scriptOrderDown = false;
200 scriptOrder = cmp;
201 sortScripts(scriptItems, scriptOrder, scriptOrderDown, cb);
202 };
203 Please.wait(I18N.getMessage("Please_wait___"));
204 window.setTimeout(run, 1);
205 };
206 var sortDown = function() {
207 var run = function() {

Callers 1

createScriptTableFunction · 0.85

Calls 1

crcFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…