[refactoring] clean all files

This commit is contained in:
Joxit 2016-05-18 00:31:33 +02:00
parent 304db5a9c3
commit a51845f0ef
8 changed files with 312 additions and 306 deletions

85
add.tag
View file

@ -1,58 +1,57 @@
<!--
Copyright (C) 2016 Jones Magloire @Joxit
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<add>
<dialog id="add-server-dialog" class="mdl-dialog">
<h4 class="mdl-dialog__title">Add your Server ?</h4>
<div class="mdl-dialog__content">
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text" id="add-server-input">
<label class="mdl-textfield__label" for="add-server-input">Server url</label>
</div>
</div>
<div class="mdl-dialog__actions">
<button type="button" class="mdl-button change" onClick="registryUI.addTag.add();">Add</button>
<button type="button" class="mdl-button close" onClick="registryUI.addTag.close();">Cancel</button>
</div>
</dialog> <script type="text/javascript">
registryUI.addTag = registryUI.addTag || {};
registryUI.addTag.update = this.update;
this.on('updated', function () {
componentHandler.upgradeElements(this['add-server-dialog']);
registryUI.addTag.dialog = registryUI.addTag.dialog
|| document.querySelector('#add-server-dialog');
registryUI.addTag.addServer = registryUI.addTag.tileServerList
|| registryUI.addTag.dialog.querySelector('#add-server-input');
if (!registryUI.addTag.dialog.showModal) {
dialogPolyfill.registerDialog(registryUI.addTag.dialog);
}
});
registryUI.addTag.show = function() {
registryUI.addTag.dialog.showModal();
};
registryUI.addTag.add = function() {
if (registryUI.addTag.addServer.value && registryUI.addTag.addServer.value.length > 0) {
registryUI.addServer(registryUI.addTag.addServer.value);
}
registryUI.addTag.addServer.value = '';
registryUI.addTag.dialog.close();
};
registryUI.addTag.close = function() {
registryUI.addTag.dialog.close();
};
registryUI.addTag.update();
</script>
<dialog id="add-server-dialog" class="mdl-dialog">
<h4 class="mdl-dialog__title">Add your Server ?</h4>
<div class="mdl-dialog__content">
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text" id="add-server-input">
<label class="mdl-textfield__label" for="add-server-input">Server url</label>
</div>
</div>
<div class="mdl-dialog__actions">
<button type="button" class="mdl-button change" onClick="registryUI.addTag.add();">Add</button>
<button type="button" class="mdl-button close" onClick="registryUI.addTag.close();">Cancel</button>
</div>
</dialog>
<script type="text/javascript">
registryUI.addTag = registryUI.addTag || {};
registryUI.addTag.update = this.update;
this.on('updated', function () {
componentHandler.upgradeElements(this['add-server-dialog']);
registryUI.addTag.dialog = registryUI.addTag.dialog || document.querySelector('#add-server-dialog');
registryUI.addTag.addServer = registryUI.addTag.tileServerList || registryUI.addTag.dialog.querySelector('#add-server-input');
if (!registryUI.addTag.dialog.showModal) {
dialogPolyfill.registerDialog(registryUI.addTag.dialog);
}
});
registryUI.addTag.show = function () {
registryUI.addTag.dialog.showModal();
};
registryUI.addTag.add = function () {
if (registryUI.addTag.addServer.value && registryUI.addTag.addServer.value.length > 0) {
registryUI.addServer(registryUI.addTag.addServer.value);
}
registryUI.addTag.addServer.value = '';
registryUI.addTag.dialog.close();
};
registryUI.addTag.close = function () {
registryUI.addTag.dialog.close();
};
registryUI.addTag.update();
</script>
</add>

View file

@ -1,82 +1,85 @@
<!--
Copyright (C) 2016 Jones Magloire @Joxit
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<catalog>
<!-- Begin of tag -->
<div class="catalog" if="{ registryUI.content == 'catalog' }">
<div class="section-centerd mdl-card mdl-shadow--2dp mdl-cell--6-col">
<div class="mdl-card__title">
<h2 class="mdl-card__title-text">Repositories of { registryUI.url() }</h2>
<!-- Begin of tag -->
<div id="catalog-tag" class="catalog" if="{ registryUI.content == 'catalog' }">
<div class="section-centerd mdl-card mdl-shadow--2dp mdl-cell--6-col">
<div class="mdl-card__title">
<h2 class="mdl-card__title-text">Repositories of { registryUI.url() }</h2>
</div>
<div id="catalog-spinner" style="{ catalog.loadend ? 'display:none;': '' }" class="mdl-spinner mdl-js-spinner is-active section-centerd"></div>
<ul class="mdl-list">
<li class="mdl-list__item mdl-menu__item" style="opacity: 1;" each="{ item in catalog.repositories }" onclick="registryUI.taglist.display('{item}');">
<span class="mdl-list__item-primary-content">
<i class="material-icons mdl-list__item-icon">send</i>
{ item }
</span>
</li>
</ul>
</div>
<div id="error-snackbar" aria-live="assertive" aria-atomic="true" aria-relevant="text" class="mdl-js-snackbar mdl-snackbar">
<div class="mdl-snackbar__text"></div>
<button class="mdl-snackbar__action" type="button"></button>
</div>
</div>
<div id="catalog-spinner" style="{ catalog.loadend ? 'display:none;': '' }"
class="mdl-spinner mdl-js-spinner is-active section-centerd"></div>
<ul class="mdl-list">
<li class="mdl-list__item mdl-menu__item" style="opacity: 1;" each="{ item in catalog.repositories }" onclick="registryUI.taglist.display('{item}');">
<span class="mdl-list__item-primary-content">
<i class="material-icons mdl-list__item-icon">send</i> { item }
</span>
</li>
</ul>
</div>
<div id="error-snackbar" aria-live="assertive" aria-atomic="true" aria-relevant="text" class="mdl-js-snackbar mdl-snackbar">
<div class="mdl-snackbar__text"></div>
<button class="mdl-snackbar__action" type="button"></button>
</div>
</div>
<script>
catalog.instance = this;
catalog.display = function () {
registryUI.content = 'catalog';
var oReq = new XMLHttpRequest();
catalog.createSnackbar = function (msg) {
var snackbar = document.querySelector('#error-snackbar');
catalog.error = msg;
var data = {
message: catalog.error,
timeout: 100000,
actionHandler: function(){
snackbar.classList.remove('mdl-snackbar--active');
},
actionText: 'Undo'
<script>
catalog.instance = this;
catalog.display = function () {
registryUI.content = 'catalog';
var oReq = new XMLHttpRequest();
catalog.createSnackbar = function (msg) {
var snackbar = document.querySelector('#error-snackbar');
catalog.error = msg;
var data = {
message: catalog.error,
timeout: 100000,
actionHandler: function () {
snackbar.classList.remove('mdl-snackbar--active');
},
actionText: 'Undo'
};
snackbar.MaterialSnackbar.showSnackbar(data);
};
snackbar.MaterialSnackbar.showSnackbar(data);
oReq.addEventListener('load', function () {
if (this.status == 200) {
catalog.repositories = JSON.parse(this.responseText).repositories.sort();
} else if (this.status == 404) {
catalog.createSnackbar('Server not found');
} else {
catalog.createSnackbar(this.responseText);
}
});
oReq.addEventListener('error', function () {
catalog.createSnackbar('An error occured');
});
oReq.addEventListener('loadend', function () {
catalog.loadend = true;
catalog.instance.update();
});
oReq.open('GET', registryUI.url() + '/v2/_catalog');
oReq.withCredentials = false;
oReq.send();
riot.update();
};
oReq.addEventListener('load', function () {
if (this.status == 200) {
catalog.repositories = JSON.parse(this.responseText).repositories;
} else if (this.status == 404) {
catalog.createSnackbar('Server not found');
} else {
catalog.createSnackbar(this.responseText);
}
this.on('updated', function () {
componentHandler.upgradeElements(this['catalog-tag']);
});
oReq.addEventListener('error', function () {
catalog.createSnackbar('An error occured');
});
oReq.addEventListener('loadend', function () {
catalog.loadend = true;
catalog.instance.update();
});
oReq.open('GET', registryUI.url() + '/v2/_catalog');
oReq.withCredentials = false;
oReq.send();
riot.update();
};
catalog.display();
</script>
<!-- End of tag -->
catalog.display();
</script>
<!-- End of tag -->
</catalog>

View file

@ -1,11 +1,11 @@
<!--
Copyright (C) 2016 Jones Magloire @Joxit
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@ -15,45 +15,44 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<change>
<dialog id="change-server-dialog" class="mdl-dialog">
<h4 class="mdl-dialog__title">Change your Server ?</h4>
<div class="mdl-dialog__content">
<div class="mdl-textfield mdl-js-textfield">
<select class="mdl-textfield__input mdl-textfield__select" name="server-list" id="server-list">
<option each="{ url in registryUI.getRegistryServer() }" value={url}>{url}</option>
</select>
</div>
</div>
<div class="mdl-dialog__actions">
<button type="button" class="mdl-button change" onClick="registryUI.changeTag.change();">Change</button>
<button type="button" class="mdl-button close" onClick="registryUI.changeTag.close();">Cancel</button>
</div>
</dialog> <script type="text/javascript">
registryUI.changeTag = registryUI.changeTag || {};
registryUI.changeTag.update = this.update;
this.on('updated', function () {
componentHandler.upgradeElements(this['change-server-dialog']);
registryUI.changeTag.dialog = registryUI.changeTag.dialog
|| document.querySelector('#change-server-dialog');
registryUI.changeTag.serverList = registryUI.changeTag.serverList
|| registryUI.changeTag.dialog.querySelector('#server-list');
if (!registryUI.changeTag.dialog.showModal) {
dialogPolyfill.registerDialog(registryUI.changeTag.dialog);
}
});
registryUI.changeTag.show = function() {
registryUI.changeTag.update();
registryUI.changeTag.dialog.showModal();
};
registryUI.changeTag.change = function() {
if (registryUI.changeTag.serverList.value && registryUI.changeTag.serverList.value.length > 0) {
registryUI.changeServer(registryUI.changeTag.serverList.value);
}
registryUI.changeTag.serverList.value = '';
registryUI.changeTag.dialog.close();
};
registryUI.changeTag.close = function() {
registryUI.changeTag.dialog.close();
};
</script>
<dialog id="change-server-dialog" class="mdl-dialog">
<h4 class="mdl-dialog__title">Change your Server ?</h4>
<div class="mdl-dialog__content">
<div class="mdl-textfield mdl-js-textfield">
<select class="mdl-textfield__input mdl-textfield__select" name="server-list" id="server-list">
<option each="{ url in registryUI.getRegistryServer() }" value={url}>{url}</option>
</select>
</div>
</div>
<div class="mdl-dialog__actions">
<button type="button" class="mdl-button change" onClick="registryUI.changeTag.change();">Change</button>
<button type="button" class="mdl-button close" onClick="registryUI.changeTag.close();">Cancel</button>
</div>
</dialog>
<script type="text/javascript">
registryUI.changeTag = registryUI.changeTag || {};
registryUI.changeTag.update = this.update;
this.on('updated', function () {
componentHandler.upgradeElements(this['change-server-dialog']);
registryUI.changeTag.dialog = registryUI.changeTag.dialog || document.querySelector('#change-server-dialog');
registryUI.changeTag.serverList = registryUI.changeTag.serverList || registryUI.changeTag.dialog.querySelector('#server-list');
if (!registryUI.changeTag.dialog.showModal) {
dialogPolyfill.registerDialog(registryUI.changeTag.dialog);
}
});
registryUI.changeTag.show = function () {
registryUI.changeTag.update();
registryUI.changeTag.dialog.showModal();
};
registryUI.changeTag.change = function () {
if (registryUI.changeTag.serverList.value && registryUI.changeTag.serverList.value.length > 0) {
registryUI.changeServer(registryUI.changeTag.serverList.value);
}
registryUI.changeTag.serverList.value = '';
registryUI.changeTag.dialog.close();
};
registryUI.changeTag.close = function () {
registryUI.changeTag.dialog.close();
};
</script>
</change>

View file

@ -1,67 +1,70 @@
<!--
Copyright (C) 2016 Jones Magloire @Joxit
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<LINK href="node_modules/dialog-polyfill/dialog-polyfill.css" rel="stylesheet" type="text/css">
<LINK href="node_modules/material-design-lite/dist/material.min.css" rel="stylesheet" type="text/css">
<LINK href="node_modules/leaflet/dist/leaflet.css" rel="stylesheet" type="text/css">
<LINK href="node_modules/material-design-icons/iconfont/material-icons.css" rel="stylesheet" type="text/css">
<LINK href="style.css" rel="stylesheet" type="text/css">
<LINK href="https://fonts.googleapis.com/css?family=Roboto:regular,bold,italic,thin,light,bolditalic,black,medium&amp;lang=en" rel="stylesheet" type="text/css">
<title>Docker Registry UI</title>
<meta charset="UTF-8">
<LINK href="node_modules/dialog-polyfill/dialog-polyfill.css" rel="stylesheet" type="text/css">
<LINK href="node_modules/material-design-lite/dist/material.min.css" rel="stylesheet" type="text/css">
<LINK href="node_modules/leaflet/dist/leaflet.css" rel="stylesheet" type="text/css">
<LINK href="node_modules/material-design-icons/iconfont/material-icons.css" rel="stylesheet" type="text/css">
<LINK href="style.css" rel="stylesheet" type="text/css">
<LINK href="https://fonts.googleapis.com/css?family=Roboto:regular,bold,italic,thin,light,bolditalic,black,medium&amp;lang=en" rel="stylesheet" type="text/css">
<title>Docker Registry UI</title>
</head>
<body>
<!-- Always shows a header, even in smaller screens. -->
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header">
<div class="mdl-layout__header-row">
<!-- Title -->
<span class="mdl-layout-title">Docker Registry UI</span>
<menu></menu>
</div>
</header>
<main class="mdl-layout__content">
<div class="page-content">
<catalog></catalog>
<taglist></taglist>
<!-- Always shows a header, even in smaller screens. -->
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header">
<div class="mdl-layout__header-row">
<!-- Title -->
<span class="mdl-layout-title">Docker Registry UI</span>
<menu></menu>
</div>
</header>
<main class="mdl-layout__content">
<div class="page-content">
<catalog></catalog>
<taglist></taglist>
</div>
</main>
<change></change>
<add></add>
<footer class="mdl-mini-footer">
<div class="mdl-mini-footer__left-section">
<div class="mdl-logo">Docker Registry UI</div>
<ul class="mdl-mini-footer__link-list">
<li><a href="https://github.com/Joxit/docker-registry-ui">Contribute on GitHub</a></li>
<li><a href="https://github.com/Joxit/docker-registry-ui/blob/master/LICENSE">Privacy &amp; Terms</a></li>
</ul>
</div>
</footer>
</div>
</main>
<change></change>
<add></add>
<footer class="mdl-mini-footer">
<div class="mdl-mini-footer__left-section">
<div class="mdl-logo">Docker Registry UI</div>
<ul class="mdl-mini-footer__link-list">
<li><a href="https://github.com/Joxit/docker-registry-ui">Contribute on GitHub</a></li>
<li><a href="https://github.com/Joxit/docker-registry-ui/blob/master/LICENSE">Privacy &amp; Terms</a></li>
</ul>
</div>
</footer>
</div>
<script src="catalog.tag" type="riot/tag"></script>
<script src="taglist.tag" type="riot/tag"></script>
<script src="add.tag" type="riot/tag"></script>
<script src="change.tag" type="riot/tag"></script>
<script src="menu.tag" type="riot/tag"></script>
<script src="node_modules/riot/riot+compiler.min.js"></script>
<script src="node_modules/dialog-polyfill/dialog-polyfill.js"></script>
<script src="node_modules/material-design-lite/dist/material.min.js"></script>
<script src="script.js"></script>
<script src="catalog.tag" type="riot/tag"></script>
<script src="taglist.tag" type="riot/tag"></script>
<script src="add.tag" type="riot/tag"></script>
<script src="change.tag" type="riot/tag"></script>
<script src="menu.tag" type="riot/tag"></script>
<script src="node_modules/riot/riot+compiler.min.js"></script>
<script src="node_modules/dialog-polyfill/dialog-polyfill.js"></script>
<script src="node_modules/material-design-lite/dist/material.min.js"></script>
<script src="script.js"></script>
</body>
</html>

View file

@ -1,36 +1,36 @@
<!--
Copyright (C) 2016 Jones Magloire @Joxit
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<menu>
<div id="card-menu" class="mdl-card__menu">
<button id="registry-menu" name="registry-menu" class="mdl-button mdl-button--icon mdl-js-button mdl-js-ripple-effect">
<i class="material-icons">more_vert</i>
</button>
<ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu mdl-js-ripple-effect" for="registry-menu">
<li class="mdl-menu__item" onclick="registryUI.addTag.show();">Add URL</li>
<li class="mdl-menu__item" onclick="registryUI.changeTag.show();">Change URL</li>
</ul>
</div>
<div id="card-menu" class="mdl-card__menu">
<button id="registry-menu" name="registry-menu" class="mdl-button mdl-button--icon mdl-js-button mdl-js-ripple-effect">
<i class="material-icons">more_vert</i>
</button>
<ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu mdl-js-ripple-effect" for="registry-menu">
<li class="mdl-menu__item" onclick="registryUI.addTag.show();">Add URL</li>
<li class="mdl-menu__item" onclick="registryUI.changeTag.show();">Change URL</li>
</ul>
</div>
<script type="text/javascript">
registryUI.menuTag = registryUI.menuTag || {};
registryUI.menuTag.update = this.update;
this.on('updated', function () {
componentHandler.upgradeElements(this['card-menu']);
});
registryUI.menuTag.update();
</script>
<script type="text/javascript">
registryUI.menuTag = registryUI.menuTag || {};
registryUI.menuTag.update = this.update;
this.on('updated', function () {
componentHandler.upgradeElements(this['card-menu']);
});
registryUI.menuTag.update();
</script>
</menu>

View file

@ -15,10 +15,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
var registryUI = {}
registryUI.url = function () {
registryUI.url = function() {
return registryUI.getRegistryServer(0);
}
registryUI.getRegistryServer = function (i) {
registryUI.getRegistryServer = function(i) {
try {
var res = JSON.parse(localStorage.getItem('registryServer'));
if (res instanceof Array) {
@ -27,7 +27,7 @@ registryUI.getRegistryServer = function (i) {
} catch (e) {}
return (!isNaN(i)) ? '' : [];
}
registryUI.addServer = function (url) {
registryUI.addServer = function(url) {
var registryServer = registryUI.getRegistryServer();
url = url.trim();
var index = registryServer.indexOf(url);
@ -37,7 +37,7 @@ registryUI.addServer = function (url) {
registryServer.push(url);
localStorage.setItem('registryServer', JSON.stringify(registryServer));
}
registryUI.changeServer = function (url) {
registryUI.changeServer = function(url) {
var registryServer = registryUI.getRegistryServer();
url = url.trim();
var index = registryServer.indexOf(url);
@ -45,7 +45,7 @@ registryUI.changeServer = function (url) {
return;
}
registryServer.splice(index, 1);
registryServer = [ url ].concat(registryServer);
registryServer = [url].concat(registryServer);
registryUI.registryServer.servers = registryServer;
localStorage.setItem('registryServer', JSON.stringify(registryServer));
}

View file

@ -14,9 +14,9 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
html > body {
font-family: 'Roboto','Helvetica','Arial',sans-serif !important;
font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif !important;
}
.mdl-mini-footer {
@ -31,6 +31,7 @@ html > body {
.section-centerd {
margin: auto;
}
.mdl-data-table th {
font-size: 18px;
}

View file

@ -1,103 +1,104 @@
<!--
Copyright (C) 2016 Jones Magloire @Joxit
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<taglist>
<!-- Begin of tag -->
<div id="taglist-tag" class="taglist" if="{ registryUI.content == 'taglist' }">
<div class="section-centerd mdl-card mdl-shadow--2dp mdl-cell--6-col">
<div class="mdl-card__title">
<a href="#" onclick="catalog.display();"><i class="material-icons mdl-list__item-icon">arrow_back</i></a>
<h2 class="mdl-card__title-text">Tags of { registryUI.url() + '/' + registryUI.taglist.name }</h2>
<!-- Begin of tag -->
<div id="taglist-tag" class="taglist" if="{ registryUI.content == 'taglist' }">
<div class="section-centerd mdl-card mdl-shadow--2dp mdl-cell--6-col">
<div class="mdl-card__title">
<a href="#" onclick="catalog.display();">
<i class="material-icons mdl-list__item-icon">arrow_back</i>
</a>
<h2 class="mdl-card__title-text">Tags of { registryUI.url() + '/' + registryUI.taglist.name }</h2>
</div>
<div id="taglist-spinner" style="{ registryUI.taglist.loadend ? 'display:none;': '' }" class="mdl-spinner mdl-js-spinner is-active section-centerd"></div>
<table class="mdl-data-table mdl-js-data-table full-table" style="border: none;">
<thead>
<tr>
<th class="mdl-data-table__cell--non-numeric">Repository</th>
<th class="mdl-data-table__header--sorted-ascending" onclick="registryUI.taglist.reverse(this);">Tag</th>
</tr>
</thead>
<tbody>
<tr each="{ item in registryUI.taglist.tags }">
<td class="mdl-data-table__cell--non-numeric">{ registryUI.taglist.name }</td>
<td>{ item }</td>
</tr>
</tbody>
</table>
</div>
<div id="error-snackbar" aria-live="assertive" aria-atomic="true" aria-relevant="text" class="mdl-js-snackbar mdl-snackbar">
<div class="mdl-snackbar__text"></div>
<button class="mdl-snackbar__action" type="button"></button>
</div>
</div>
<div id="taglist-spinner" style="{ registryUI.taglist.loadend ? 'display:none;': '' }"
class="mdl-spinner mdl-js-spinner is-active section-centerd"></div>
<table class="mdl-data-table mdl-js-data-table full-table" style="border: none;">
<thead>
<tr>
<th class="mdl-data-table__cell--non-numeric">Repository</th>
<th class="mdl-data-table__header--sorted-ascending" onclick="registryUI.taglist.reverse(this);">Tag</th>
</tr>
</thead>
<tbody>
<tr each="{ item in registryUI.taglist.tags }">
<td class="mdl-data-table__cell--non-numeric">{ registryUI.taglist.name }</td>
<td>{ item }</td>
</tr>
</tbody>
</table>
</div>
<div id="error-snackbar" aria-live="assertive" aria-atomic="true" aria-relevant="text" class="mdl-js-snackbar mdl-snackbar">
<div class="mdl-snackbar__text"></div>
<button class="mdl-snackbar__action" type="button"></button>
</div>
</div>
<script>
registryUI.taglist.instance = this;
registryUI.taglist.instance.update();
this.on('updated', function() {
componentHandler.upgradeElements(this['taglist-tag']);
})
registryUI.taglist.display = function (name){
registryUI.content = 'taglist';
var oReq = new XMLHttpRequest();
registryUI.taglist.name = name;
registryUI.taglist.createSnackbar = function (msg) {
var snackbar = document.querySelector('#error-snackbar');
registryUI.taglist.error = msg;
var data = {
message: registryUI.taglist.error,
timeout: 100000,
actionHandler: function(){
snackbar.classList.remove('mdl-snackbar--active');
},
actionText: 'Undo'
};
snackbar.MaterialSnackbar.showSnackbar(data);
};
oReq.addEventListener('load', function () {
if (this.status == 200) {
registryUI.taglist.tags = JSON.parse(this.responseText).tags.sort();
} else if (this.status == 404) {
registryUI.taglist.createSnackbar('Server not found');
} else {
registryUI.taglist.createSnackbar(this.responseText);
}
});
oReq.addEventListener('error', function () {
registryUI.taglist.createSnackbar('An error occured');
});
oReq.addEventListener('loadend', function () {
registryUI.taglist.loadend = true;
registryUI.taglist.instance.update();
});
oReq.open('GET', registryUI.url() + '/v2/' + name + '/tags/list');
oReq.withCredentials = false;
oReq.send();
riot.update();
}
registryUI.taglist.reverse = function (th){
if (th.className == 'mdl-data-table__header--sorted-ascending') {
th.className = 'mdl-data-table__header--sorted-descending';
} else {
th.className = 'mdl-data-table__header--sorted-ascending';
}
registryUI.taglist.tags.reverse();
<script>
registryUI.taglist.instance = this;
registryUI.taglist.instance.update();
};
</script>
<!-- End of tag -->
this.on('updated', function () {
componentHandler.upgradeElements(this['taglist-tag']);
})
registryUI.taglist.display = function (name) {
registryUI.content = 'taglist';
var oReq = new XMLHttpRequest();
registryUI.taglist.name = name;
registryUI.taglist.createSnackbar = function (msg) {
var snackbar = document.querySelector('#error-snackbar');
registryUI.taglist.error = msg;
var data = {
message: registryUI.taglist.error,
timeout: 100000,
actionHandler: function () {
snackbar.classList.remove('mdl-snackbar--active');
},
actionText: 'Undo'
};
snackbar.MaterialSnackbar.showSnackbar(data);
};
oReq.addEventListener('load', function () {
if (this.status == 200) {
registryUI.taglist.tags = JSON.parse(this.responseText).tags.sort();
} else if (this.status == 404) {
registryUI.taglist.createSnackbar('Server not found');
} else {
registryUI.taglist.createSnackbar(this.responseText);
}
});
oReq.addEventListener('error', function () {
registryUI.taglist.createSnackbar('An error occured');
});
oReq.addEventListener('loadend', function () {
registryUI.taglist.loadend = true;
registryUI.taglist.instance.update();
});
oReq.open('GET', registryUI.url() + '/v2/' + name + '/tags/list');
oReq.withCredentials = false;
oReq.send();
riot.update();
}
registryUI.taglist.reverse = function (th) {
if (th.className == 'mdl-data-table__header--sorted-ascending') {
th.className = 'mdl-data-table__header--sorted-descending';
} else {
th.className = 'mdl-data-table__header--sorted-ascending';
}
registryUI.taglist.tags.reverse();
registryUI.taglist.instance.update();
};
</script>
<!-- End of tag -->
</taglist>