Wowhead Items TSM

Easy TSM Import from Wowhead Item Lists, edited by boail. Original: https://gist.github.com/BobuSumisu/d5a3fccbd4f6ddbc2817

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Wowhead Items TSM
// @namespace    boail
// @version      1.0a
// @description  Easy TSM Import from Wowhead Item Lists, edited by boail. Original: https://gist.github.com/BobuSumisu/d5a3fccbd4f6ddbc2817
// @author       Øyvind Ingvaldsen <[email protected]>
// @match        http://*.wowhead.com/*
// @match        https://*.wowhead.com/*
// @grant        none
// ==/UserScript==

function getIds(getAll) {
  var ids = [];
  for (var x = 0, item; item = g_listviews.items.data[x]; x++) {
  	if (getAll || (item.hasOwnProperty('__tr') && item.__tr.className.indexOf('checked') >= 0)) {
  	  ids.push('i:' + item.id);
  	}
  }
  
  return ids;
}

function main() {
  var $btnSelected = $('<input type="button" value="TSMI Selected" style="background-color:#628a2c !important;">').on('click', function () {    
    $outTxt.text(getIds(false));
    $outDiv.show();
  });
  
  var $btnAll = $('<input type="button" value="TSMI All" style="background-color:#628a2c !important;">').on('click', function () {
    $outTxt.text(getIds(true));
    $outDiv.show();
  });
  
  var $nav = $('div.listview-band-top > div.listview-withselected');
  $nav.append($btnSelected);
  $nav.append($btnAll);
  
  var $outDiv = $('<div style="display:none; margin: 20px;"></div>');
  var $outTxt = $('<textarea style="box-sizing: border-box; height:100px; width:100%;"></textarea>').appendTo($outDiv);
  var $refresh = $('<div style="float:left">Click the button again to refresh</div>').appendTo($outDiv);
  var $closeOut = $('<input type="button" value="Close TSMI" style="float:right; background-color:#628a2c; margin:5px;">').appendTo($outDiv).on('click', function () {
    $outDiv.hide();
  });
  
  $outDiv.appendTo('#lv-items > div.listview-band-top');
  $outDiv.appendTo('#tab-items > div.listview-band-top');
}

setTimeout(main, 250);