TradeMe List View Enforcer

List view!

目前為 2014-12-12 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name           TradeMe List View Enforcer
// @namespace      http://www.girlza.com/
// @include        http://www.trademe.co.nz/*
// @description    List view!
// @require  http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @grant    GM_addStyle
// @version 0.1
// ==/UserScript==
function getParameterByName(name) {
  name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
  var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'),
  results = regex.exec(location.search);
  return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
}

function doMe(){
$( document ).ready(function() {
 document.getElementById('listViewTab').click()
});}

if (document.getElementById('listingLayout') != null) {
  var x = document.getElementById('listingLayout').value
  if (x.toUpperCase() == 'GALLERY') {
    if (document.getElementById('listViewTab') != null) {
      doMe()
    }
  }
} else if (document.getElementById('ListingsTitle_galleryViewTab_icon_a') != null) {
		var v = getParameterByName('v');
        var w = document.location.toString().substring(document.location.toString().length-9)
        
		if (v.toUpperCase()!="GALLERY" && w.toUpperCase()!="V-GALLERY" && document.getElementById("ListingsTitle_galleryViewTab_icon_a").classList.contains('btn-checked')) {
   			window.location.href = document.getElementById("ListingsTitle_listViewTab_icon_a").href
        //doMe()
		}
  
}