Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Browser for GameTextures</title>
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
- <style>
- div.usage
- {
- border: 1px solid #333;
- font-family: Arial;
- font-size: 12px;
- font-weight: lighter;
- color: rgba(255,255,255,0.6);
- padding: 4px;
- margin: 4px;
- }
- body
- {
- background: #222;
- }
- li
- {
- display: inline-block !important;
- width:255px;
- height:255px;
- border: 1px solid #333;
- overflow:hidden;
- position:relative;
- }
- h2
- {
- display:block;
- position: absolute;
- left:6px;
- top:0px;
- right:0px;
- bottom:0px;
- z-index: 11;
- color: white;
- font-family: Arial;
- font-size: 12px;
- font-weight: lighter;
- color: rgba(255,255,255,0.3);
- }
- a.woocommerce-main-image img
- {
- display:block;
- width: 255px;
- height: 255px;
- position: absolute;
- left:0px;
- top:0px;
- z-index: 10;
- background: #222;
- }
- li>a
- {
- display:block;
- position: absolute;
- left:0px;
- top:0px;
- right:0px;
- bottom:0px;
- z-index: 20;
- }
- a.pop-content
- {
- display: none;
- }
- </style>
- <script>
- function getParameterByName(name, url, defval) {
- if (!url) url = window.location.href;
- name = name.replace(/[\[\]]/g, "\\$&");
- var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
- results = regex.exec(url);
- if (!results) return null;
- if (!results[2]) return defval;
- return decodeURIComponent(results[2].replace(/\+/g, " "));
- }
- function fetch(page, entries, cat)
- {
- var link = "http://www.gametextures.com/wp-content/themes/gametextures/woocommerce/callbacks/product-archive.php?paged="
- + page + "&posts_per_load=" + entries + "&product_cat=" + cat;
- console.log(link);
- $.get(link, function(data){$("body").append(data);});
- }
- var category = getParameterByName("cat", null, "architectural");
- var start = Number(getParameterByName("start",null,1));
- var numpages = Number(getParameterByName("numpages",null,4));
- console.log("start = " + start);
- console.log("numpages = " + numpages);
- for(var i = start; i < start + numpages; i++)
- {
- fetch(i, getParameterByName("perpage",null,10), category);
- }
- /**/
- </script>
- </head>
- <body>
- <div class="usage">GameTextures Browser. Example usage: <tt>GTBrowser.html?start=1&numpages=10&perpage=7&cat=natural</tt>. Valid categories: architectural, natural, decal, misc. <i>To use this tool, disable CORS!</i></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement