You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

271 lines
10 KiB

<html>
<head>
<meta charset=UTF-8>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<script src="assets/js/jquery.min.3.2.1.js"></script>
<script src="assets/bootstrap/js/bootstrap.bundle.min.js"></script>
<title>Wordcloud Admin</title>
<!-- Bootstrap core CSS -->
<link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="assets/css/wordcloud_admin.css" rel="stylesheet">
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg fixed-top">
<div class="container">
<a class="navbar-brand" href="#">Home</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="#admin">Admin</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#help">Help</a>
</li>
</ul>
</div>
</div>
</nav>
<header class="masthead text-center">
<div class="masthead-content">
<div class="container">
<h1 class="masthead-heading">Admin Wordcloud</h1>
</div>
</div>
</header>
<section id="admin">
<div class="container text-center">
<h2 class="text-center">Administration</h2>
<div class="table-responsive">
<table class="table table-hover">
<tr >
<td class="col-lg-12">
<div class="form-group" id="show_data_number">
Number of words/phrases:
</div>
</td>
</tr>
<tr >
<td class="col-lg-12">
<div class="form-group" id="show_data_words">
Words/phrases:
</div>
</td>
</tr>
<tr>
<td class="col-lg-12">
<div class="form-group">
<button type="submit" id="show_number" class="btn btn-info">Number of words</button>
To refresh the number of words, press this button or reload the page.
</div>
</td>
</tr>
<tr>
<td class="col-lg-12">
<div class="form-group">
<button type="submit" id="show_words" class="btn btn-info">List of words/ phrases</button>
To refresh words/ phrases, press this button or reload the page.
</div>
</td>
</tr>
<tr >
<td class="col-lg-12">
<div class="form-group">
<label for="pwd">Type in the authentication code for execute one of the following actions:</label>
<input type="password" id="w_auth" class="form-control">
</div>
</td>
</tr>
<tr>
<td class="col-lg-12">
<div class="form-group">
<label>To delete a number of a specific word, type in the word/phrase:</label>
<input type="text" id="w_spec" class="form-control">
<label for="sel1">Select the number of words to delete:</label>
<select class="form-control" id="w_number" name="numberlist">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
</select>
</div>
<div class="form-group">
<button type="submit" id="delete_spec_number" class="btn btn-warning">Delete a number of a specific word</button>
Press the yellow button.
</div>
</td>
</tr>
<tr>
<td class="col-lg-12">
<div class="form-group">
<label>To delete all of a specific word, type in the word/phrase:</label>
<input type="text" id="w_spec_all" class="form-control">
</div>
<div class="form-group">
<button type="submit" id="delete_spec_all" class="btn btn-warning">Delete specific word</button>
Press the yellow button.
</div>
</td>
</tr>
<tr>
<td class="col-lg-12">
<div class="form-group">
<button type="submit" id="delete_all" class="btn btn-danger">Delete all words</button>
To clear the cloud, press the red button.
</div>
</td>
</tr>
</table>
</div>
</div>
</section>
<section id="help">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="p-5">
<h2 class="text-center">Help</h2>
<p class="text-center">
Delete all or a specific word/phrase.
</p>
</div>
</div>
</div>
</div>
</section>
<script>
$(document).ready(function(){
function show_number(){
var w_auth=$("#w_auth").val();
var c_options="number";
$.ajax({
url:'assets/php/show.php',
method:'POST',
data:{
w_auth:w_auth,
c_options:c_options
},
success:function(data){
$("#show_data_number").html(data);
}
});
};
function show_words(){
var w_auth=$("#w_auth").val();
var c_options="words";
$.ajax({
url:'assets/php/show.php',
method:'POST',
data:{
w_auth:w_auth,
c_options:c_options
},
success:function(data){
$("#show_data_words").html(data);
}
});
};
show_number();
show_words();
$("#show_number").click(function(){
show_number();
});
$("#show_words").click(function(){
show_words();
});
$("#delete_all").click(function(){
var w_auth=$("#w_auth").val();
var c_options="all_words";
$.ajax({
url:'assets/php/delete.php',
method:'POST',
data:{
w_auth:w_auth,
c_options:c_options
},
success:function(data){
alert(data);
$("#w_auth").val("");
show_number();
show_words();
}
});
});
$("#delete_spec_number").click(function(){
var w_auth=$("#w_auth").val();
var c_options="number_of_one_word";
var w_spec=$("#w_spec").val();
var w_number=$("#w_number").val();
$.ajax({
url:'assets/php/delete.php',
method:'POST',
data:{
w_auth:w_auth,
c_options:c_options,
w_spec:w_spec,
w_number:w_number
},
success:function(data){
alert(data);
$("#w_auth").val("");
$("#w_spec").val("");
show_number();
show_words();
}
});
});
$("#delete_spec_all").click(function(){
var w_auth=$("#w_auth").val();
var c_options="all_of_one_word";
var w_spec_all=$("#w_spec_all").val();
$.ajax({
url:'assets/php/delete.php',
method:'POST',
data:{
w_auth:w_auth,
c_options:c_options,
w_spec_all:w_spec_all
},
success:function(data){
alert(data);
$("#w_auth").val("");
$("#w_spec_all").val("");
show_number();
show_words();
}
});
});
});
</script>
<!-- Footer -->
<footer class="footer text-center">
<div>
<a href="https://codeberg.org/cExplorer/wordcloud">cExplorer's Wordcloud</a>, based on <a href="https://github.com/mattdodge/MySQL-Word-Cloud">Matt Dodge's MySQL-Word-Cloud</a> and using <a href="http://timc.idv.tw/wordcloud/">timdream's wordcloud</a>
</div>
</footer>
</body>
</html>