1
0
Fork 0
This commit is contained in:
Heiko Kernbach 2012-05-11 12:44:04 +02:00
parent ebc5f0165b
commit 8175228858
3 changed files with 108 additions and 19 deletions

View File

@ -102,12 +102,35 @@ pre ul li span{
font-size: 0.8em !important; font-size: 0.8em !important;
} }
#logToolbar button, #documentsToolbar button { #logToolbar button {
float:right; float:right;
margin-bottom: 10px; margin-bottom: 10px;
padding-right: 5px;
} }
#logToolbar a, #documentsToolbar a { #documentsToolbar button {
padding:0;
}
#docPageInput {
width:40px;
}
#docPageForm {
display:inline;
vertical-align:3px;
font-size: 0.8em;
}
.floatRight {
float:right;
}
.floatLeft {
float:left;
}
#logToolbar a {
font-size: 0.85em; font-size: 0.85em;
} }
@ -252,8 +275,8 @@ pre ul li span{
} }
.ui-tabs-nav { .ui-tabs-nav {
font-size: 0.8em !important; font-size: 0.7em !important;
height: 35px; height: 30px;
-webkit-box-shadow: inset 0 0 1px 1px #f6f6f6 !important; -webkit-box-shadow: inset 0 0 1px 1px #f6f6f6 !important;
-moz-box-shadow: inset 0 0 1px 1px #f6f6f6 !important; -moz-box-shadow: inset 0 0 1px 1px #f6f6f6 !important;
box-shadow: inset 0 0 1px 1px #f6f6f6 !important; box-shadow: inset 0 0 1px 1px #f6f6f6 !important;
@ -276,6 +299,10 @@ pre ul li span{
box-shadow: none !important; box-shadow: none !important;
} }
form {
margin: 0;
}
#tab_right { #tab_right {
margin-top: -18px; margin-top: -18px;
} }
@ -318,6 +345,11 @@ pre ul li span{
width:100%; width:100%;
} }
#welcomemsg {
padding-left: 10px;
padding-top: 10px;
font-family: "courier";
}
#avocshWindow p { #avocshWindow p {
margin-top: 10px; margin-top: 10px;
@ -332,8 +364,8 @@ pre ul li span{
#avocshContent { #avocshContent {
font-family: "courier"; font-family: "courier";
width: 90.5%; width: 100%;
height: 40px; height: 30px;
background-color: white; background-color: white;
margin-right: 0.5%; margin-right: 0.5%;
} }
@ -355,6 +387,7 @@ pre ul li span{
} }
#submitAvoc { #submitAvoc {
visibility:hidden;
height: 40px !important; height: 40px !important;
width: 9% !important; width: 9% !important;
margin-top: 10px !important; margin-top: 10px !important;
@ -630,6 +663,7 @@ pre ul li span{
padding-top: 2px; padding-top: 2px;
padding-right: 2px; padding-right: 2px;
} }
/* /*
############################################################################## ##############################################################################
### small buttons ### small buttons

View File

@ -155,13 +155,23 @@
</table> </table>
<div id="documentsToolbar"> <div id="documentsToolbar">
<button class="enabled" id="documents_last"><img src="/_admin/html/media/icons/rnd_br_first_icon16.png"></button>
<button class="enabled" id="documents_next"><img src="/_admin/html/media/icons/rnd_br_prev_icon16.png"></button> <div class="floatLeft">
<button class="enabled" id="documents_prev"><img src="/_admin/html/media/icons/rnd_br_next_icon16.png"></button>
<button class="enabled" id="documents_first"><img src="/_admin/html/media/icons/rnd_br_last_icon16.png"></button>
<a id="documents_status">Showing</a> <a id="documents_status">Showing</a>
</div> </div>
<div class="floatRight">
<form id="docPageForm">
Jump to: <input type="text" id="docPageInput" placeholder="Page"></input>
<button id="submitDocPageInput">Ok</button>
</form>
<button class="enabled" id="documents_first"><img src="/_admin/html/media/icons/rnd_br_last_icon16.png"></button>
<button class="enabled" id="documents_prev"><img src="/_admin/html/media/icons/rnd_br_next_icon16.png"></button>
<button class="enabled" id="documents_next"><img src="/_admin/html/media/icons/rnd_br_prev_icon16.png"></button>
<button class="enabled" id="documents_last"><img src="/_admin/html/media/icons/rnd_br_first_icon16.png"></button>
</div>
</div>
</div> </div>
<div id="documentEditView" style="display: none"> <div id="documentEditView" style="display: none">
@ -340,18 +350,21 @@
</div> </div>
<div id="configView" style="display: none"> <div id="configView" style="display: none">
<button class="minimal enabled" id="updateConfiguration">
<img src="/_admin/html/media/icons/refresh_icon16.png" width="16" height="16">
<a>Update configuration</a>
</button>
<div id="configContent"> <div id="configContent">
</div> </div>
</div> </div>
<div id="avocshView" style="display: none"> <div id="avocshView" style="display: none">
<div id="avocshWindow"> <div id="avocshWindow">
<a id="welcomemsg">Welcome! AvocSH 0.9<a><br><br>
</div> </div>
<form> <form>
<input type="text" class="editBox" id="avocshContent"></input><button class="minimal" id="submitAvoc">Ok</button> <input type="text" class="editBox" id="avocshContent"></input><button class="minimal" id="submitAvoc">Ok</button>
</form> </form>
</div> </div>
<div id="queryView" style="display: none"> <div id="queryView" style="display: none">

View File

@ -1018,7 +1018,6 @@ var logTable = $('#logTableID').dataTable({
return false; return false;
}); });
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// toggle button for source / table - new document view /// toggle button for source / table - new document view
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -1223,7 +1222,6 @@ var logTable = $('#logTableID').dataTable({
contentType: "application/json", contentType: "application/json",
url: "/document/" + documentID url: "/document/" + documentID
}); });
location.reload();
} }
catch(e) { catch(e) {
@ -1690,7 +1688,6 @@ function createnav (menue) {
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
$(function() { $(function() {
var open = false;
$('#footerSlideButton').click(function() { $('#footerSlideButton').click(function() {
if(open === false) { if(open === false) {
$('#footerSlideContent').animate({ height: '120px' }); $('#footerSlideContent').animate({ height: '120px' });
@ -1991,7 +1988,6 @@ function FormatJSON(oData, sIndent) {
var sIndentStyle = " "; var sIndentStyle = " ";
var sDataType = RealTypeOf(oData); var sDataType = RealTypeOf(oData);
// open object
if (sDataType == "array") { if (sDataType == "array") {
if (oData.length == 0) { if (oData.length == 0) {
return "[]"; return "[]";
@ -2154,6 +2150,47 @@ function stateReplace (value) {
return output; return output;
} }
$('#submitDocPageInput').live('click', function () {
try {
var enteredPage = JSON.parse($('#docPageInput').val());
if (enteredPage > 0 && enteredPage <= totalCollectionCount) {
$('#documentsTableID').dataTable().fnClearTable();
var offset = enteredPage * 10 - 10;
$.ajax({
type: 'PUT',
url: '/_api/simple/all/',
data: '{"collection":"' + globalCollectionName + '","skip":' + offset + ',"limit":10}',
contentType: "application/json",
success: function(data) {
$.each(data.result, function(k, v) {
$('#documentsTableID').dataTable().fnAddData(['<button class="enabled" id="deleteDoc"><img src="/_admin/html/media/icons/doc_delete_icon16.png" width="16" height="16"></button><button class="enabled" id="editDoc"><img src="/_admin/html/media/icons/doc_edit_icon16.png" width="16" height="16"></button>', v._id, v._rev, '<pre class=prettify>' + cutByResolution(JSON.stringify(v)) + '</pre>' ]);
});
$(".prettify").snippet("javascript", {style: "nedit", menu: false, startText: false, transparent: true, showNum: false});
collectionCurrentPage = enteredPage;
$('#documents_status').text("Showing page " + enteredPage + " of " + totalCollectionCount);
return 0;
},
error: function(data) {
}
});
}
else {
console.log("out of reach");
return 0;
}
}
catch(e) {
alert("No valid Page");
return 0;
}
return 0;
});
function highlightNav (string) { function highlightNav (string) {
$("#nav1").removeClass("nonhighlighted"); $("#nav1").removeClass("nonhighlighted");
$("#nav2").removeClass("nonhighlighted"); $("#nav2").removeClass("nonhighlighted");
@ -2195,3 +2232,8 @@ function is_int(value){
return false; return false;
} }
} }
$('#docPageInput').submit(function() {
alert('Handler for .submit() called.');
return false;
});