update icons license workflow, add authors

This commit is contained in:
Felix Niklas 2016-02-16 11:49:12 +01:00
parent fa8fd5698f
commit 62003f7691
6 changed files with 546 additions and 91 deletions

442
LICENSE-ICONS-3RD-PARTY.json Executable file
View file

@ -0,0 +1,442 @@
{
"eyedropper.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"unmute.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"mute.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"zoom-out.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"zoom-in.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"user.svg": {
"author": "",
"url": "",
"license": ""
},
"twitter.svg": {
"author": "Twitter",
"url": "twitter.com",
"license": ""
},
"twitter-button.svg": {
"author": "Twitter",
"url": "twitter.com",
"license": ""
},
"trash.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"total-tickets.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"tools.svg": {
"author": "Michael Kussmaul",
"url": "https:\/\/thenounproject.com\/term\/tools\/41655\/",
"license": "CC 3.0 Attribution"
},
"templates.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"team.svg": {
"author": "",
"url": "",
"license": ""
},
"task-state.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"switchView.svg": {
"author": "",
"url": "",
"license": ""
},
"stopwatch.svg": {
"author": "",
"url": "",
"license": ""
},
"status.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"status-modified-outer-circle.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"split.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"signout.svg": {
"author": "",
"url": "",
"license": ""
},
"report.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"reply.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"reply-all.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"reopening.svg": {
"author": "",
"url": "",
"license": ""
},
"reload.svg": {
"author": "Anand A Nair",
"url": "https:\/\/thenounproject.com\/anandgrafiti\/uploads\/?i=2149",
"license": "CC 3.0 Attribution"
},
"received-calls.svg": {
"author": "",
"url": "",
"license": ""
},
"radio.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"radio-checked.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"plus.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"plus-small.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"phone.svg": {
"author": "",
"url": "",
"license": ""
},
"person.svg": {
"author": "",
"url": "",
"license": ""
},
"pen.svg": {
"author": "",
"url": "",
"license": ""
},
"paperclip.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"package.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"overviews.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"outbound-calls.svg": {
"author": "",
"url": "",
"license": ""
},
"organization.svg": {
"author": "",
"url": "",
"license": ""
},
"one-ticket.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"note.svg": {
"author": "",
"url": "",
"license": ""
},
"mood-supergood.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"mood-super-bad.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"mood-ok.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"mood-good.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"mood-bad.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"minus.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"minus-small.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"message.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"marker.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"magnifier.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"long-arrow-right.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"logotype.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"logo.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"lock.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"lock-open.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"loading.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"list.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"linkedin-button.svg": {
"author": "Linkedin",
"url": "",
"license": ""
},
"line-right-arrow.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"line-left-arrow.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"in-process.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"important.svg": {
"author": "",
"url": "",
"license": ""
},
"help.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"group.svg": {
"author": "",
"url": "",
"license": ""
},
"google-button.svg": {
"author": "Google",
"url": "",
"license": ""
},
"full-logo.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"facebook.svg": {
"author": "Facebook",
"url": "",
"license": ""
},
"facebook-button.svg": {
"author": "Facebook",
"url": "",
"license": ""
},
"email.svg": {
"author": "",
"url": "",
"license": ""
},
"email-button.svg": {
"author": "",
"url": "",
"license": ""
},
"dropdown-list.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"download.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"diagonal-cross.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"dashboard.svg": {
"author": "Anton Gajdosik",
"url": "https:\/\/thenounproject.com\/term\/gauge\/186120",
"license": "CC 3.0 Attribution"
},
"crown.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"cog.svg": {
"author": "",
"url": "",
"license": ""
},
"cloud.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"small-dot.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"clock.svg": {
"author": "",
"url": "",
"license": ""
},
"clipboard.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"checkmark.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"checkbox.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"checkbox-checked.svg": {
"author": "Zammad",
"url": "",
"license": ""
},
"chat.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"arrow-up.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"arrow-right.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"arrow-left.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
},
"arrow-down.svg": {
"author": "Felix Niklas",
"url": "",
"license": "MIT"
}
}

View file

@ -1,8 +1,10 @@
<?
$src = '../LICENSE-ICONS-3RD-PARTY.json';
// check for ajax request
if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
file_put_contents('list.json', json_encode($_POST['list'], JSON_PRETTY_PRINT));
return file_put_contents($src, json_encode($_POST['list'], JSON_PRETTY_PRINT));
exit();
}
@ -19,17 +21,45 @@ if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQ
font-family: sans-serif;
font-size: 13px;
}
.controls {
border: 1px solid hsl(167,72%,60%);
border-radius: 5px;
margin: 0 0 28px 14px;
display: table;
box-shadow: 0 1px hsl(199,44%,96%);
}
.controls label {
padding: 7px 10px;
float: left;
cursor: pointer;
}
.controls label:not(:last-child) {
border-right: 1px solid hsl(167,72%,60%);
}
.controls input {
display: none;
}
.controls input:checked + label {
background: hsl(167,72%,60%);
color: white;
}
.icons {
display: flex;
flex-wrap: wrap;
}
.icon-holder {
border: 1px solid hsl(199,44%,93%);
background: white;
box-shadow: 0 2px hsl(210,7%,96%);
float: left;
margin: 0 0 14px 14px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
max-width: 200px;
flex: 1;
}
.icon-holder.is-filtered {
display: none;
}
.icon {
position: relative;
@ -49,19 +79,22 @@ if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQ
position: relative;
}
.icon-body {
padding: 14px;
padding: 14px 14px 10px;
display: flex;
flex-direction: column;
justify-content: center;
}
.icon-name {
margin: 0 0 7px;
white-space: nowrap;
}
input {
width: 160px;
input:not([type=radio]) {
margin: 0 0 4px;
font: inherit;
border: 1px solid #ddd;
padding: 3px 5px;
}
input:focus {
input:not([type=radio]):focus {
outline: none;
border-color: hsl(205,74%,61%);
}
@ -81,17 +114,23 @@ if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQ
}*/
</style>
<div class="controls">
<input type="radio" value="off" name="filter" checked id="off"><label for="off">No Filter</label>
<input type="radio" value="empty_author" name="filter" id="author"><label for="author">No Author</label>
<input type="radio" value="empty_license" name="filter" id="license"><label for="license">No License</label>
</div>
<div class="icons">
<?
# Path to image folder
$imageFolder = '../../public/assets/images/icons/';
$imageFolder = '../public/assets/images/icons/';
# Show only these file types from the image folder
$imageTypes = '{*.svg}';
# Set to true if you prefer sorting images by name
# If set to false, images will be sorted by date
$sortByImageName = true;
$sortByImageName = false;
# Set to false if you want the oldest images to appear first
# This is only used if images are sorted by date (see above)
@ -102,7 +141,7 @@ $newestImagesFirst = true;
# Add images to array
$images = glob($imageFolder . $imageTypes, GLOB_BRACE);
$author_data = json_decode(file_get_contents('list.json'), true);
$author_data = json_decode(file_get_contents($src), true);
# Sort images
if ($sortByImageName) {
@ -136,25 +175,70 @@ if ($sortByImageName) {
<div class="icon">
<?= file_get_contents($image) ?>
</div>
<div class="icon-body">
<form class="icon-body" data-filename="<?= $filename ?>">
<div class="icon-name"><?= $name ?></div>
<input class="icon-author" value="<?= $author_data[$filename] ?>" placeholder="Author" data-filename="<?= $filename ?>">
</div>
<input name="author" value="<?= $author_data[$filename]['author'] ?>" placeholder="Author">
<input type="url" name="url" value="<?= $author_data[$filename]['url'] ?>" placeholder="URL">
<input name="license" value="<?= $author_data[$filename]['license'] ?>" placeholder="License">
</form>
</div>
<? endforeach ?>
</div>
<script src="../../app/assets/javascripts/app/lib/core/jquery-2.1.1.min.js"></script>
<script src="../app/assets/javascripts/app/lib/core/jquery-2.1.4.js"></script>
<script>
$('input').on('input', storeAuthors)
var self = "<?= basename($_SERVER["SCRIPT_FILENAME"]) ?>"
var filter = "off"
var filterTimeout
$('input').on({
input: storeAuthors,
blur: onBlur,
focus: onFocus
})
function onBlur(){
filterTimeout = setTimeout(applyFilter, 500)
}
function onFocus(){
clearTimeout(filterTimeout)
}
function storeAuthors(){
var iconList = {}
$('.icon-author').each(function(){
iconList[$(this).attr('data-filename')] = $(this).val()
$('.icon-holder form').each(function(){
iconList[$(this).attr('data-filename')] = {
author: this.elements.author.value,
url: this.elements.url.value,
license: this.elements.license.value
}
})
$.post('index.php', { list: iconList }, function(data){ console.log(data) })
$.post(self, { list: iconList }, function(data){ console.log(data) })
}
$('[name="filter"]').change(function(){
filter = this.value
applyFilter()
})
function applyFilter(){
$('.icon-holder').removeClass('is-filtered').each(function(){
var holder = $(this)
switch(filter){
case "empty_author":
if(holder.find("[name='author']").val())
holder.addClass('is-filtered')
break;
case "empty_license":
if(holder.find("[name='license']").val())
holder.addClass('is-filtered')
break;
}
});
}
$('svg').each(function(i, svg){

Binary file not shown.

View file

@ -1,71 +0,0 @@
{
"arrow-down.svg": "Felix Niklas",
"arrow-left.svg": "Felix Niklas",
"arrow-right.svg": "Felix Niklas",
"arrow-up.svg": "Felix Niklas",
"checkbox-checked.svg": "Zammad",
"checkbox.svg": "Zammad",
"checkmark.svg": "Zammad",
"clipboard.svg": "Felix Niklas",
"clock.svg": "",
"cloud.svg": "Felix Niklas",
"cog.svg": "",
"dashboard.svg": "",
"diagonal-cross.svg": "Zammad",
"download.svg": "Felix Niklas",
"email.svg": "",
"facebook.svg": "Facebook",
"full-logo.svg": "Zammad",
"group.svg": "",
"help.svg": "Felix Niklas",
"important.svg": "",
"in-process.svg": "",
"list.svg": "Zammad",
"loading.svg": "Zammad",
"lock-open.svg": "Zammad",
"lock.svg": "Zammad",
"logo.svg": "Zammad",
"logotype.svg": "Zammad",
"long-arrow-right.svg": "Zammad",
"magnifier.svg": "Zammad",
"marker.svg": "Felix Niklas",
"message.svg": "Felix Niklas",
"minus.svg": "Zammad",
"mood-bad.svg": "Zammad",
"mood-good.svg": "Zammad",
"mood-ok.svg": "Zammad",
"mood-super-bad.svg": "Zammad",
"mood-supergood.svg": "Zammad",
"note.svg": "",
"one-ticket.svg": "",
"organization.svg": "",
"outbound-calls.svg": "",
"overviews.svg": "",
"package.svg": "Felix Niklas",
"paperclip.svg": "",
"pen.svg": "",
"person.svg": "",
"phone.svg": "",
"plus.svg": "Zammad",
"priority-modified-inner-circle.svg": "Zammad",
"priority-modified-outer-circle.svg": "Zammad",
"priority.svg": "Zammad",
"radio-checked.svg": "Zammad",
"radio.svg": "Zammad",
"received-calls.svg": "",
"reload.svg": "Refresh by Anand A Nair from the Noun Project",
"reopening.svg": "",
"reply-all.svg": "Felix Niklas",
"reply.svg": "Felix Niklas",
"signout.svg": "Zammad",
"split.svg": "Felix Niklas",
"stopwatch.svg": "",
"switchView.svg": "",
"team.svg": "",
"templates.svg": "Felix Niklas",
"tools.svg": "tools by Michael Kussmaul from the Noun Project",
"total-tickets.svg": "",
"trash.svg": "Felix Niklas",
"twitter.svg": "",
"user.svg": ""
}

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View file

@ -6,7 +6,7 @@
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
<g id="eyedropper" sketch:type="MSArtboardGroup" fill="#50E3C2">
<path d="M10.2240424,7.9513151 L3.86040601,14.3149515 L4.18181818,14.1818182 L3.27272727,14.1818182 C3.15217432,14.1818182 3.03655891,14.2297077 2.9513151,14.3149515 L2.04222419,15.2240424 L2.68504854,15.2240424 L1.77595763,14.3149515 L1.77595763,14.9577758 L2.68504854,14.0486849 C2.77029235,13.9634411 2.81818182,13.8478257 2.81818182,13.7272727 L2.81818182,12.8181818 L2.68504854,13.139594 L9.0486849,6.77595763 L10.2240424,7.9513151 Z M13.4058606,1.13313328 L10.2240424,4.31495146 L10.8668667,4.31495146 L9.95777581,3.40586055 C9.78026477,3.22834951 9.4924625,3.22834951 9.31495146,3.40586055 L7.49676964,5.22404237 C7.3192586,5.40155341 7.3192586,5.68935568 7.49676964,5.86686672 L8.40586055,6.77595763 L8.40586055,6.13313328 L2.04222419,12.4967696 C1.95698038,12.5820135 1.90909091,12.6976289 1.90909091,12.8181818 L1.90909091,13.7272727 L2.04222419,13.4058606 L1.13313328,14.3149515 C0.95562224,14.4924625 0.95562224,14.7802648 1.13313328,14.9577758 L2.04222419,15.8668667 C2.21973523,16.0443778 2.5075375,16.0443778 2.68504854,15.8668667 L3.59413945,14.9577758 L3.27272727,15.0909091 L4.18181818,15.0909091 C4.30237113,15.0909091 4.41798655,15.0430196 4.50323036,14.9577758 L10.8668667,8.59413945 L10.2240424,8.59413945 L11.1331333,9.50323036 C11.3106443,9.6807414 11.5984466,9.6807414 11.7759576,9.50323036 L13.5941394,7.68504854 C13.7716505,7.5075375 13.7716505,7.21973523 13.5941394,7.04222419 L12.6850485,6.13313328 L12.6850485,6.77595763 L15.8668667,3.59413945 C16.0443778,3.4166284 16.0443778,3.12882614 15.8668667,2.9513151 L14.0486849,1.13313328 C13.8711739,0.95562224 13.5833716,0.95562224 13.4058606,1.13313328 Z" id="Shape" sketch:type="MSShapeGroup"></path>
<path d="M10.5707397,4.00701904 L9.95777581,3.40586055 C9.78026477,3.22834951 9.4924625,3.22834951 9.31495146,3.40586055 L7.49676964,5.22404237 C7.3192586,5.40155341 7.3192586,5.68935568 7.49676964,5.86686672 L8.09680176,6.4942627 L2.04222419,12.4967696 C1.95698038,12.5820135 1.90909091,12.6976289 1.90909091,12.8181818 L1.90909094,13.5249023 L1.13313328,14.3149515 C1.03431832,14.4137664 0.990510625,14.5467585 1.00171019,14.675877 C1.0106295,14.7787068 1.0544372,14.8790797 1.13313328,14.9577758 L2.04222419,15.8668667 C2.21973523,16.0443778 2.5075375,16.0443778 2.68504854,15.8668667 L3.4520874,15.090909 L4.18181818,15.0909091 C4.30237113,15.0909091 4.41798655,15.0430196 4.50323036,14.9577758 C4.50323036,14.9577758 5.19989118,14.261115 5.54822159,13.9127846 C7.3211033,12.1399029 10.5020142,8.88342285 10.5020142,8.88342285 L11.1331333,9.50323036 C11.3106443,9.6807414 11.5984466,9.6807414 11.7759576,9.50323036 L13.5941394,7.68504854 C13.7716505,7.5075375 13.7716505,7.21973523 13.5941394,7.04222419 L13.012146,6.4942627 L15.8668667,3.59413945 C16.0443778,3.4166284 16.0443778,3.12882614 15.8668667,2.9513151 L14.0486849,1.13313328 C13.8711739,0.95562224 13.5833716,0.95562224 13.4058606,1.13313328 L10.5707397,4.00701904 Z M10.2240424,7.9513151 L3.95965578,14.1818185 L3.27272727,14.1818182 C3.15217432,14.1818182 3.03655891,14.2297077 2.9513151,14.3149515 L2.31365968,14.959045 L2.04222418,14.6547237 L2.68504854,14.0486849 C2.77029235,13.9634411 2.81818182,13.8478257 2.81818182,13.7272727 L2.8181818,13.0130611 L9.0486849,6.77595763 L10.2240424,7.9513151 Z" id="Shape" sketch:type="MSShapeGroup"></path>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB