Basic PHP document management system, including automatic detection of corporate logos in letters
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.

dms.js 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. var lastImage = null;
  2. var searchTO = null;
  3. function click(image) {
  4. document.getElementById('previewimg').src = image.src.replace(/thumb/, 'prog');
  5. document.getElementById('previewlink').href = document.getElementById('previewimg').src;
  6. if (lastImage != null) {
  7. lastImage.style.opacity = 1.0;
  8. }
  9. image.style.opacity = 0.5;
  10. image.parentNode.style.backgroundColor = 'red';
  11. lastImage = image;
  12. var name = image.src.replace(/^.*?thumb\.php\?/, '');
  13. new Ajax.Updater('info', 'info.php', {parameters: {image: name}, asynchronous: true});
  14. new Ajax.Updater('ocr', 'ocr.php', {parameters: {image: name}, asynchronous: true});
  15. new Ajax.Updater('logo', 'logo.php', {parameters: {image: name}, asynchronous: true});
  16. }
  17. function doSearch() {
  18. if (searchTO != null) {
  19. clearTimeout(searchTO);
  20. }
  21. $('search_throbber').style.visibility = 'visible';
  22. searchTO = setTimeout(doSearch2, 1000);
  23. }
  24. function doSearch2() {
  25. var term = $('search_text').value;
  26. new Ajax.Updater('searchresults', 'search.php', {parameters: {query: term}, asynchronous: true, onComplete: doneSearch});
  27. }
  28. function doneSearch() {
  29. $('search_throbber').style.visibility = 'hidden';
  30. }
  31. function showTab(what) {
  32. $$('#previewtabs a').each(function(e) {
  33. e.className = '';
  34. });
  35. $('preview_' + what).className = 'active';
  36. $$('.preview').each(function(e) {
  37. e.style.zIndex = 0;
  38. });
  39. $(what).style.zIndex = 10;
  40. }