Added a reset button to searchfields, improved js code
Signed-off-by: Roman Schmerold (BNoiZe) <bnoize@froxlor.org>
This commit is contained in:
21
templates/Sparkle/assets/js/main.js
vendored
21
templates/Sparkle/assets/js/main.js
vendored
@@ -28,7 +28,7 @@ $(document).ready(function() {
|
|||||||
// Load Newsfeed
|
// Load Newsfeed
|
||||||
var ajax_load = "<div id='newsitem'>Loading newsfeed...</div>";
|
var ajax_load = "<div id='newsitem'>Loading newsfeed...</div>";
|
||||||
$("#newsfeeditems").html(ajax_load).load("lib/ajax.php?action=newsfeed", function() {
|
$("#newsfeeditems").html(ajax_load).load("lib/ajax.php?action=newsfeed", function() {
|
||||||
if ($("#newsfeeditems").html() != "") {
|
if ($("#newsfeeditems").html().length > 0) {
|
||||||
$(window).trigger('resize');
|
$(window).trigger('resize');
|
||||||
$("#newsfeed").slideDown();
|
$("#newsfeed").slideDown();
|
||||||
}
|
}
|
||||||
@@ -39,6 +39,12 @@ $(document).ready(function() {
|
|||||||
direction: "right"
|
direction: "right"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Enable reset search click
|
||||||
|
$(".resetsearch").click(function() {
|
||||||
|
$(".searchtext").val("");
|
||||||
|
$(".submitsearch").click();
|
||||||
|
});
|
||||||
|
|
||||||
// Height of divs fix
|
// Height of divs fix
|
||||||
var snheight = $('#sidenavigation').height();
|
var snheight = $('#sidenavigation').height();
|
||||||
var mainheight = $('#maincontent').height();
|
var mainheight = $('#maincontent').height();
|
||||||
@@ -49,7 +55,7 @@ $(document).ready(function() {
|
|||||||
// this is necessary for the special setting feature (ref #1010)
|
// this is necessary for the special setting feature (ref #1010)
|
||||||
$.getQueryVariable = function(key) {
|
$.getQueryVariable = function(key) {
|
||||||
var urlParams = decodeURI( window.location.search.substring(1) );
|
var urlParams = decodeURI( window.location.search.substring(1) );
|
||||||
if(urlParams == false | urlParams == '') return null;
|
if(urlParams === false | urlParams === '') return null;
|
||||||
var vars = urlParams.split("&");
|
var vars = urlParams.split("&");
|
||||||
for (var i=0;i<vars.length;i++) {
|
for (var i=0;i<vars.length;i++) {
|
||||||
var pair = vars[i].split("=");
|
var pair = vars[i].split("=");
|
||||||
@@ -58,7 +64,7 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
};
|
||||||
|
|
||||||
if ($('#speciallogwarningpopup').length) {
|
if ($('#speciallogwarningpopup').length) {
|
||||||
var $speciallogdialog = $('#speciallogwarningpopup')
|
var $speciallogdialog = $('#speciallogwarningpopup')
|
||||||
@@ -67,19 +73,18 @@ $(document).ready(function() {
|
|||||||
closeOnEscape: false,
|
closeOnEscape: false,
|
||||||
draggable: false,
|
draggable: false,
|
||||||
modal: true,
|
modal: true,
|
||||||
resizable: false,
|
resizable: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// make rel="external" links open in a new window
|
// make rel="external" links open in a new window
|
||||||
$("a[rel='external']").attr('target', '_blank');
|
$("a[rel='external']").attr('target', '_blank');
|
||||||
$(".main").css('min-height', $("nav").height() - 134);
|
|
||||||
|
|
||||||
// set focus on username-field if on loginpage
|
// set focus on username-field if on loginpage
|
||||||
$("#loginname").focus();
|
$("#loginname").focus();
|
||||||
|
|
||||||
if ($("table.bradius").length != 0) {
|
if ($("table.bradius").length !== 0) {
|
||||||
$("table.bradius tbody tr").hover(function() {
|
$("table.bradius tbody tr").hover(function() {
|
||||||
$(this).css("background-color", "#f5f5f5");
|
$(this).css("background-color", "#f5f5f5");
|
||||||
}, function() {
|
}, function() {
|
||||||
@@ -114,7 +119,7 @@ $(document).ready(function() {
|
|||||||
$speciallogdialog.dialog("close");
|
$speciallogdialog.dialog("close");
|
||||||
if($('#delete_stats').val().toLowerCase() != $('#delete_statistics_str').val().toLowerCase()) {
|
if($('#delete_stats').val().toLowerCase() != $('#delete_statistics_str').val().toLowerCase()) {
|
||||||
$("#speciallogverified").val("0");
|
$("#speciallogverified").val("0");
|
||||||
if($('input[name=speciallogfile]').prop("checked") != false) {
|
if($('input[name=speciallogfile]').prop("checked") !== false) {
|
||||||
$('input[name=speciallogfile]').attr("checked", false);
|
$('input[name=speciallogfile]').attr("checked", false);
|
||||||
} else {
|
} else {
|
||||||
$('input[name=speciallogfile]').attr("checked", true);
|
$('input[name=speciallogfile]').attr("checked", true);
|
||||||
@@ -127,7 +132,7 @@ $(document).ready(function() {
|
|||||||
$('input[id=speciallognobutton]').click(function () {
|
$('input[id=speciallognobutton]').click(function () {
|
||||||
$speciallogdialog.dialog("close");
|
$speciallogdialog.dialog("close");
|
||||||
$("#speciallogverified").val("0");
|
$("#speciallogverified").val("0");
|
||||||
if($('input[name=speciallogfile]').prop("checked") != false) {
|
if($('input[name=speciallogfile]').prop("checked") !== false) {
|
||||||
$('input[name=speciallogfile]').attr("checked", false);
|
$('input[name=speciallogfile]').attr("checked", false);
|
||||||
} else {
|
} else {
|
||||||
$('input[name=speciallogfile]').attr("checked", true);
|
$('input[name=speciallogfile]').attr("checked", true);
|
||||||
|
|||||||
5
templates/Sparkle/misc/htmlsearchcode.tpl
vendored
5
templates/Sparkle/misc/htmlsearchcode.tpl
vendored
@@ -2,5 +2,6 @@
|
|||||||
<select name="searchfield">
|
<select name="searchfield">
|
||||||
{$fieldoptions}
|
{$fieldoptions}
|
||||||
</select>
|
</select>
|
||||||
<input type="text" name="searchtext" value="{$searchtext}" />
|
<input type="text" name="searchtext" class="searchtext" value="{$searchtext}" />
|
||||||
<input type="submit" name="Go" value="Go" />
|
<input type="submit" name="Go" value="Go" class="submitsearch" />
|
||||||
|
<input type="reset" name="Reset" value="Reset" class="resetsearch" />
|
||||||
|
|||||||
Reference in New Issue
Block a user