Logo

Goto Bottom


Latest Shouts In The Shoutbox -- View The Shoutbox · Rules   


  Add ReplyMake New TopicStart Poll

» Re: skin assets that were hosted in ZB test boards, They can still be saved
Egomednog
 Posted: Jul 12 2018, 10:33 AM
Quote Post


Junior Member
 *  *

Group: Members
Posts: 12
Member No.: 66
Joined: 2-July 18









Maybe this is old news but I found out some skins can still be saved if their assets were hosted in the test board, even if the test board has been migrated to tapatalk.

So I wanted to save my Smooth Blue skin (my favorite out of all the ones that I made) but I noticed the test board had been migrated.

However, I grabbed the css and using Sublime Text's find function (with regular expressions) i got all the asset urls from the css. And if I navigate to the urls, they are still up, so I was able to get the gradients used for the skin.

This is the regexp I used (nothing too fancy):
CODE
url\(.*\)


For example here is the maintitle for Smooth Blue.

I've already saved all the images and styles for that skin. But it may help for others.

(I have no idea if this is the correct forum, feel free to move)


PMEmail Poster
^
Cory
 Posted: Jul 12 2018, 10:58 AM
Quote Post


Administrator
 *  *  *  *  *  *

Group: Admin
Posts: 393
Member No.: 1
Joined: 4-June 18









CODE
console.log($('div:contains(html)').text().match(/url\(.*\)/gi))

Wouldn't that work for the web console?
PM
^
Egomednog
 Posted: Jul 12 2018, 11:33 AM
Quote Post


Junior Member
 *  *

Group: Members
Posts: 12
Member No.: 66
Joined: 2-July 18









QUOTE (Cory @ Jul 12 2018, 09:58 AM)
CODE
console.log($('div:contains(html)').text().match(/url\(.*\)/gi))

Wouldn't that work for the web console?


Where would you run that? In the test board, or in the skin thread in ZBSupport?
PMEmail Poster
^
Cory
 Posted: Jul 12 2018, 12:01 PM
Quote Post


Administrator
 *  *  *  *  *  *

Group: Admin
Posts: 393
Member No.: 1
Joined: 4-June 18









The skin thread.
PM
^
Egomednog
 Posted: Jul 12 2018, 12:12 PM
Quote Post


Junior Member
 *  *

Group: Members
Posts: 12
Member No.: 66
Joined: 2-July 18









Maybe? You would have to deal with the markup in the actual thread.

I put together this (admittedly ugly) html file where you can paste the CSS for a skin and it will give you download links for anything it finds between 'url()'.

just save it and open it from your browser.

CODE

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Download CSS Images</title>
<style>
 label,
 textarea,
 button {
  display: block;
 }

 #found-images a {
  display: block;
 }

 textarea {
  width: 100%;
 }
</style>
</head>

<body>
<label for="css-text">Paste CSS Here</label>
<textarea id="css-text" rows="20"></textarea>
<button id="find-images">Find Images</button>
<hr>
<h3>Found images:</h3>
<div id="found-images"></div>

<script>
 document.getElementById('find-images').addEventListener('click', function () {
  var cssText = document.getElementById('css-text').value;
  var myRegexp = /url\(([^\)]+)\)/gi;
  var match = myRegexp.exec(cssText);
  var downloaded = [];

  while (match !== null) {
   var url = match[1];
   var filename = url.split('/').pop();
   if (!downloaded.includes(url)) {
    var a = document.createElement('a');

    a.href = url;
    a.target = '__blank';
    a.textContent = filename;

    document.getElementById('found-images').appendChild(a);
   }

   downloaded.push(url);
   match = myRegexp.exec(cssText);
  }

 })
</script>
</body>

</html>
PMEmail Poster
^
Cory
 Posted: Jul 12 2018, 12:39 PM
Quote Post


Administrator
 *  *  *  *  *  *

Group: Admin
Posts: 393
Member No.: 1
Joined: 4-June 18









Good job, that should be of use to users. https://files.jcink.net/uploads/cory//2smile.png
PM
^
Egomednog
 Posted: Jul 12 2018, 01:59 PM
Quote Post


Junior Member
 *  *

Group: Members
Posts: 12
Member No.: 66
Joined: 2-July 18









Thanks! If you want to style it a bit more and put it up as a tool somewhere, feel free.
PMEmail Poster
^
Cory
 Posted: Jul 12 2018, 02:13 PM
Quote Post


Administrator
 *  *  *  *  *  *

Group: Admin
Posts: 393
Member No.: 1
Joined: 4-June 18









For now, I'll move this to the coding discussions forum to see if it finds any interest there.
PM
^
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Add ReplyMake New TopicStart Poll


 


 


Goto Top