hid create new article ui from normal users
This commit is contained in:
parent
2fcc91850b
commit
1f600dce5a
@ -603,31 +603,7 @@
|
|||||||
<button onclick="cloudArticleApp."></button>
|
<button onclick="cloudArticleApp."></button>
|
||||||
<button onclick="cloudArticleApp.export_as_file()">Export Selections as file</button>
|
<button onclick="cloudArticleApp.export_as_file()">Export Selections as file</button>
|
||||||
</div>
|
</div>
|
||||||
<section class="popup-container hide" id="article_creation_div">
|
<div id="admindiv"></div>
|
||||||
<div id="article_creation_modal" class="popup">
|
|
||||||
<h3>Create a new article</h3>
|
|
||||||
<input type="text" id="article_name" placeholder="Article name">
|
|
||||||
|
|
||||||
<input type="number" id="section_nums" placeholder="Number of sections">
|
|
||||||
|
|
||||||
<button onclick="hidePopup('article_creation_modal')">Cancel</button>
|
|
||||||
<button id="reset_data_btn">Create</button>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<div class="popup-container hide">
|
|
||||||
<div id="edit_article" class="popup">
|
|
||||||
<header>
|
|
||||||
<h3>Edit section names</h3>
|
|
||||||
<button onclick="cloudArticleApp.update_section_names()">
|
|
||||||
<svg viewBox="0 0 45.91 32.62">
|
|
||||||
<polyline points="0.71,17.21 14.71,31.21 45.21,0.71 "/>
|
|
||||||
</svg>
|
|
||||||
Done</button>
|
|
||||||
</header>
|
|
||||||
<div id="edit_section_container"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<nav id="navbar">
|
<nav id="navbar">
|
||||||
<svg id="icon" viewBox="0 0 99.555 117.877">
|
<svg id="icon" viewBox="0 0 99.555 117.877">
|
||||||
@ -666,80 +642,122 @@
|
|||||||
<div id="current_data"></div>
|
<div id="current_data"></div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// function required for popups or modals to appear
|
|
||||||
function showPopup(popup) {
|
// function required for popups or modals to appear
|
||||||
let thisPopup = document.getElementById(popup);
|
function showPopup(popup) {
|
||||||
thisPopup.parentNode.classList.remove('hide');
|
let thisPopup = document.getElementById(popup);
|
||||||
thisPopup.classList.add('no-transformations');
|
thisPopup.parentNode.classList.remove('hide');
|
||||||
window.onclick = function(event) {
|
thisPopup.classList.add('no-transformations');
|
||||||
if (event.target == thisPopup.parentNode)
|
window.onclick = function(event) {
|
||||||
hidePopup(popup);
|
if (event.target == thisPopup.parentNode)
|
||||||
|
hidePopup(popup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// hides the popup or modal
|
||||||
|
function hidePopup(popup) {
|
||||||
|
let thisPopup = document.getElementById(popup);
|
||||||
|
thisPopup.parentNode.classList.add('hide');
|
||||||
|
thisPopup.classList.remove('no-transformations');
|
||||||
|
}
|
||||||
|
function prevArticle(container){
|
||||||
|
let observer = new IntersectionObserver((entries) => {
|
||||||
|
if(entries[0].isIntersecting)
|
||||||
|
container.children[1].classList.add('hide')
|
||||||
|
else
|
||||||
|
container.children[1].classList.remove('hide')
|
||||||
|
},{
|
||||||
|
root: container,
|
||||||
|
threshold: 1
|
||||||
|
})
|
||||||
|
observer.observe(container.children[0].firstElementChild)
|
||||||
|
container.children[0].scrollBy({
|
||||||
|
top: 0,
|
||||||
|
left: -400,
|
||||||
|
behavior: 'smooth'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function nextArticle(container){
|
||||||
|
container.children[1].classList.remove('hide')
|
||||||
|
let observer = new IntersectionObserver((entries) => {
|
||||||
|
if(entries[0].isIntersecting)
|
||||||
|
container.children[2].classList.add('hide')
|
||||||
|
else
|
||||||
|
container.children[2].classList.remove('hide')
|
||||||
|
}, {
|
||||||
|
root: container,
|
||||||
|
threshold: 1
|
||||||
|
})
|
||||||
|
observer.observe(container.children[0].lastElementChild)
|
||||||
|
|
||||||
|
container.children[0].scrollBy({
|
||||||
|
top: 0,
|
||||||
|
left: 400,
|
||||||
|
behavior: 'smooth'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function showMessage(msg) {
|
||||||
|
document.getElementById('show_log_events').textContent = msg;
|
||||||
|
if(document.getElementById('loader_container').classList.contains('hide')){
|
||||||
|
showLoader()
|
||||||
|
setTimeout(() => {
|
||||||
|
hideLoader()
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function showLoader(){
|
||||||
|
let spinner = document.getElementById('loader_container');
|
||||||
|
spinner.firstElementChild.classList.add('pulse');
|
||||||
|
spinner.classList.remove('hide');
|
||||||
|
}
|
||||||
|
function hideLoader(){
|
||||||
|
let spinner = document.getElementById('loader_container');
|
||||||
|
spinner.firstElementChild.classList.remove('pulse');
|
||||||
|
spinner.classList.add('hide');
|
||||||
|
}
|
||||||
|
|
||||||
|
function buidAdminUI() {
|
||||||
|
|
||||||
|
if(floGlobals.subAdmins.includes(myFloID)) {
|
||||||
|
let admindivui = `<section class="popup-container hide" id="article_creation_div">
|
||||||
|
<div id="article_creation_modal" class="popup">
|
||||||
|
<h3>Create a new article</h3>
|
||||||
|
<input type="text" id="article_name" placeholder="Article name">
|
||||||
|
|
||||||
|
<input type="number" id="section_nums" placeholder="Number of sections">
|
||||||
|
|
||||||
|
<button onclick="hidePopup('article_creation_modal')">Cancel</button>
|
||||||
|
<button id="reset_data_btn">Create</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<div class="popup-container hide">
|
||||||
|
<div id="edit_article" class="popup">
|
||||||
|
<header>
|
||||||
|
<h3>Edit section names</h3>
|
||||||
|
<button onclick="cloudArticleApp.update_section_names()">
|
||||||
|
<svg viewBox="0 0 45.91 32.62">
|
||||||
|
<polyline points="0.71,17.21 14.71,31.21 45.21,0.71 "/>
|
||||||
|
</svg>
|
||||||
|
Done</button>
|
||||||
|
</header>
|
||||||
|
<div id="edit_section_container"></div>
|
||||||
|
</div>
|
||||||
|
</div>`;
|
||||||
|
|
||||||
|
document.getElementById('admindiv').innerHTML = admindivui;
|
||||||
|
|
||||||
|
const reset_data_btn = document.getElementById('reset_data_btn');
|
||||||
|
reset_data_btn.onclick = function() {
|
||||||
|
cloudArticleApp.resetArticleContent();
|
||||||
|
hidePopup('edit_article')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// hides the popup or modal
|
|
||||||
function hidePopup(popup) {
|
|
||||||
let thisPopup = document.getElementById(popup);
|
|
||||||
thisPopup.parentNode.classList.add('hide');
|
|
||||||
thisPopup.classList.remove('no-transformations');
|
|
||||||
}
|
|
||||||
function prevArticle(container){
|
|
||||||
let observer = new IntersectionObserver((entries) => {
|
|
||||||
if(entries[0].isIntersecting)
|
|
||||||
container.children[1].classList.add('hide')
|
|
||||||
else
|
|
||||||
container.children[1].classList.remove('hide')
|
|
||||||
},{
|
|
||||||
root: container,
|
|
||||||
threshold: 1
|
|
||||||
})
|
|
||||||
observer.observe(container.children[0].firstElementChild)
|
|
||||||
container.children[0].scrollBy({
|
|
||||||
top: 0,
|
|
||||||
left: -400,
|
|
||||||
behavior: 'smooth'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function nextArticle(container){
|
|
||||||
container.children[1].classList.remove('hide')
|
|
||||||
let observer = new IntersectionObserver((entries) => {
|
|
||||||
if(entries[0].isIntersecting)
|
|
||||||
container.children[2].classList.add('hide')
|
|
||||||
else
|
|
||||||
container.children[2].classList.remove('hide')
|
|
||||||
}, {
|
|
||||||
root: container,
|
|
||||||
threshold: 1
|
|
||||||
})
|
|
||||||
observer.observe(container.children[0].lastElementChild)
|
|
||||||
|
|
||||||
container.children[0].scrollBy({
|
};
|
||||||
top: 0,
|
</script>
|
||||||
left: 400,
|
|
||||||
behavior: 'smooth'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function showMessage(msg) {
|
|
||||||
document.getElementById('show_log_events').textContent = msg;
|
|
||||||
if(document.getElementById('loader_container').classList.contains('hide')){
|
|
||||||
showLoader()
|
|
||||||
setTimeout(() => {
|
|
||||||
hideLoader()
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function showLoader(){
|
|
||||||
let spinner = document.getElementById('loader_container');
|
|
||||||
spinner.firstElementChild.classList.add('pulse');
|
|
||||||
spinner.classList.remove('hide');
|
|
||||||
}
|
|
||||||
function hideLoader(){
|
|
||||||
let spinner = document.getElementById('loader_container');
|
|
||||||
spinner.firstElementChild.classList.remove('pulse');
|
|
||||||
spinner.classList.add('hide');
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script id="init_lib">
|
<script id="init_lib">
|
||||||
//All util libraries required for Standard operations (DO NOT EDIT ANY)
|
//All util libraries required for Standard operations (DO NOT EDIT ANY)
|
||||||
@ -9423,6 +9441,7 @@ Bitcoin.Util = {
|
|||||||
console.log(result)
|
console.log(result)
|
||||||
showMessage(result)
|
showMessage(result)
|
||||||
showMessage(`Welcome FLO_ID: ${myFloID}`)
|
showMessage(`Welcome FLO_ID: ${myFloID}`)
|
||||||
|
buidAdminUI();
|
||||||
cloudArticleApp.retrieveLatestContent();
|
cloudArticleApp.retrieveLatestContent();
|
||||||
}).catch(error => console.error(error))
|
}).catch(error => console.error(error))
|
||||||
}
|
}
|
||||||
@ -9892,16 +9911,5 @@ Bitcoin.Util = {
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
|
||||||
(function() {
|
|
||||||
const reset_data_btn = document.getElementById('reset_data_btn');
|
|
||||||
reset_data_btn.onclick = function() {
|
|
||||||
cloudArticleApp.resetArticleContent();
|
|
||||||
hidePopup('edit_article')
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Loading…
Reference in New Issue
Block a user