diff --git a/js/javascript.js b/js/javascript.js index 6cb76ac..e8140cf 100644 --- a/js/javascript.js +++ b/js/javascript.js @@ -610,13 +610,16 @@ var index2 = { $('#signinform').submit(function() { $('#signinbutton').click(); return false; - }).find('select').selectmenu() - .data("ui-selectmenu") - ._resizeMenu = function() { - this.menu.width(parseInt($('#signinform').find('select').next('span').width())); - if ($('#signinform select').find('option').length > 12) - this.menu.height('300'); - }; + }); + if ($('#signinform').find('select').length === 1) { + $('#signinform').find('select').selectmenu() + .data("ui-selectmenu") + ._resizeMenu = function() { + this.menu.width(parseInt($('#signinform').find('select').next('span').width())); + if ($('#signinform select').find('option').length > 12) + this.menu.height('300'); + }; + } $('#signupbutton').click(function() { var $form = $('#signupform'), passwd = $form.find('input[name=pass]').val(), username = $form.find('input[name=user]').val(), passwd2 = $form.find('input[name=pass2]').val(); @@ -2041,7 +2044,7 @@ var items = { if ($('#deletebutton').is(':visible')) $('#deletebutton').click(); }).bind('keydown', 'q', function() { - $('.backbutton').click(); + $('.backbutton').click(); }); } }; @@ -3030,7 +3033,7 @@ var displaywindow = { }).bind('keydown', 'w', function() { $('.prevrecord').click(); }).bind('keydown', 'q', function() { - $('.backbutton').click(); + $('.backbutton').click(); }); } }; @@ -3041,7 +3044,7 @@ var filetop = { gravity: 's' }); common.init(); - $('#file-top-notes').find('p').first().css('margin-top','0'); + $('#file-top-notes').find('p').first().css('margin-top', '0'); $('#file-panel2').find('.anotherurl').tipsy({gravity: 's'}); $('#file-panel2').click(function(event) { var t = event.target; diff --git a/js/pdfviewer.js b/js/pdfviewer.js index 0f448da..b0c2ffd 100644 --- a/js/pdfviewer.js +++ b/js/pdfviewer.js @@ -1057,14 +1057,16 @@ $('#pdf-viewer-copy-text').change(function() { //SHOW TEXT CONTAINER $('.text-container').show().css('cursor', 'default'); //BIND CURSOR TO TEXT LAYER - $('.text-container').mouseenter(function() { - $("#cursor").show(); - }).mouseleave(function() { - $("#cursor").hide(); - }).mousemove(function(e) { - var posx = 16 + e.pageX, posy = 16 + e.pageY; - $('#cursor').css('top', posy + 'px').css('left', posx + 'px'); - }); + if ($('#pdf-viewer-marker').prop('checked') === true) { + $('.text-container').mouseenter(function() { + $("#cursor").show(); + }).mouseleave(function() { + $("#cursor").hide(); + }).mousemove(function(e) { + var posx = 16 + e.pageX, posy = 16 + e.pageY; + $('#cursor').css('top', posy + 'px').css('left', posx + 'px'); + }); + } //IF ALREADY POPULATED, EXIT FUNCTION if (!$('#pdf-viewer-img-div').find('.text-container').is(':empty')) { clearoverlay(); diff --git a/upload.php b/upload.php index a253d23..83d0600 100644 --- a/upload.php +++ b/upload.php @@ -401,7 +401,7 @@ function trim_value(&$value) { $supplement_filename = sprintf("%05d", intval($new_file)) . $_FILES['form_new_file']['name']; copy($temp_dir . DIRECTORY_SEPARATOR . $_FILES['form_new_file']['name'], $library_path . DIRECTORY_SEPARATOR . 'supplement' . DIRECTORY_SEPARATOR . $supplement_filename); } else { - $error[] = "Error! No PDF was found. " . $pdf_contents; + $error[] = "Error! No PDF was found.
" . $title; } } @@ -536,11 +536,11 @@ function trim_value(&$value) { $_POST = array(); - if (!empty($error) || !empty($message)) { + if (count($error) > 0 || count($message) > 0) { $json = array(); - if (!empty($error)) + if (count($error) > 0) $json['error'] = $error; - if (!empty($message)) + if (count($message) > 0) $json['message'] = $message; $json_output = json_encode($json); die($json_output);