Browse Source

possible fix for comment entries with spaces

sparklyballs 9 năm trước cách đây
mục cha
commit
00df5cf997
3 tập tin đã thay đổi với 91 bổ sung1 xóa
  1. 1 1
      README.md
  2. 86 0
      defaults/keyboard.js
  3. 4 0
      init/60_update_get_the_site.sh

+ 1 - 1
README.md

@@ -44,5 +44,5 @@ On first run create an admin account, any folder and its subfolders that you map
 
 
 ## Versions
-
++ **21.08.2015:** Use patched keybaord js from fork of photoshow
 + **21.08.2015:** Initial Release. 

+ 86 - 0
defaults/keyboard.js

@@ -0,0 +1,86 @@
+/**
+ * This file implements the keyboard shortcuts.
+ * 
+ * Javascript
+ *
+ * LICENSE:
+ * 
+ * This file is part of PhotoShow.
+ *
+ * PhotoShow is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * PhotoShow is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhotoShow.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @package	  PhotoShow
+ * @category  Website
+ * @author	  Thibaud Rohmer <thibaud.rohmer@gmail.com>
+ * @copyright 2011 Thibaud Rohmer
+ * @license	  http://www.gnu.org/licenses/
+ * @link	  http://github.com/thibaud-rohmer/PhotoShow
+ */
+$("document").ready(function(){
+	$("body").keyup(function(event){
+	var keyCode = event.which;
+
+	if ($(event.target).is("input") || $(event.target).is("textarea"))
+		return;
+
+	if (keyCode == 0 && event.keyCode != undefined)
+		keyCode = event.keyCode;
+	
+		switch(keyCode)
+		{
+			case $.ui.keyCode.RIGHT	:
+				if($("#image_bar #next").is(":visible")){
+					$("#image_bar #next a").click();
+				}
+				event.preventDefault();
+				break;
+			
+			case $.ui.keyCode.LEFT	:
+				if($("#image_bar #prev").is(":visible")){
+					$("#image_bar #prev a").click();
+				}
+				event.preventDefault();
+				break;
+				
+			case $.ui.keyCode.UP	:
+				if ($("#image_bar #back").is(":visible")){
+					$("#image_bar #back").click();
+				}else if($("#image_bar #stop").is(":visible")){
+					$("#image_bar #stop").click();
+				}
+				event.preventDefault();
+				break;
+
+			case $.ui.keyCode.SPACE :
+				if($("#image_bar #pause").is(":visible")){
+					$("#image_bar #pause").click();
+				}else if($("#image_bar #play").is(":visible") || $("#image_bar #slideshow").is(":visible")){
+					$("#image_bar #play").click();
+				}
+				event.preventDefault();
+				break;
+
+			case $.ui.keyCode.ESCAPE :
+				if($("#image_bar #stop").is(":visible")){
+					$("#image_bar #stop").click();
+				}
+				event.preventDefault();
+				break;
+		}
+
+	});
+
+});
+
+

+ 4 - 0
init/60_update_get_the_site.sh

@@ -13,5 +13,9 @@ echo "checking for updates"
 cd /config/www/PhotoShow
 git pull
 fi
+
+# patch in fixed keyboard.js file
+cp /defaults/keyboard.js /config/www/PhotoShow/src/keyboard.js
+
 sed -i -e "s@\$config->timezone.*@\$config->timezone = \"${TZ}\"@g" /config/www/PhotoShow/config.php
 chown -R abc:abc /config/www/PhotoShow /Thumbs