enchantMOONãããã¯ãªã¼ãã¼ã«ãã
enchantMOONã§PDFãèªã¿ããã£ãã®ã ãPDFãã¡ã¤ã«ãç´ã§æ±ãã®ã¯æ·å± ãé«ãããªã®ã§ãPDFãjpegã«å¤æãã¦indexãã¼ã¸ãä»ä¸ããrubyãã¼ã«ã¨ãç°¡åãªç»é¢é·ç§»å¦çãè¡ãjavascriptãä½ã£ã¦ã¿ãã
èªçããæè¡æ¸çãenchantMOONã«å ¥ãã¦èªãã§ãã¨ãæ°ã«ãªã£ãæãåãåã£ã¦ã¡ã¢ãã¦ãããã®ã§ããªã便å©ï¼
ã¨ããããå ¬å¼ãã¼ã¸ã§é å¸ãã¦ãenchantMOONCrewDevConf1.zipã®è³æãå¤æãã¦ãWEBçµç±ã§åç §ã§ããã·ã¼ã«ãä½ã£ã¦ã¿ãã®ã§ãèå³ã®ããæ¹ã¯è©¦ãã¦ã¿ã¦ãã ããã
http://ahinore-em.org/enchantmoon/bookreader/sample/bookreader_sample.moon.zip
ãã¼ã«ã¯ä¸è¨ã§å ¬éãã¦ã¾ãããããªãææãå®è£ ãªã®ã§èªå·±è²¬ä»»ã§ãå©ç¨ãã ããã
https://github.com/ahinore/bookreader-em
â bookreader-emã®ä¸èº«
âââ bookreader.moon.zip âãã¼ã«ã«ãã¡ã¤ã«ãéãã·ã¼ã«
âââ books âããã¤ãenchantMOONã®Dataã«ãã®ã¾ã¾ã³ãã¼
â  âââ data âãã¼ã«å®è¡ããã¨ããã«å¤æãããjpegãæ ¼ç´ããã
â  âââ index.htmlâãã¼ã«ãå®è¡ããã¨çæãããããããeMããéãã ãã
â Â âââ js
â    âââ bookreader.jsâç»é¢é·ç§»ã®å¶å¾¡ã¨ããè¶ ææã
â Â Â Â âââ jquery-1.10.2.min.js
â Â Â Â âââ jquery.cookie.js
âââ pdf âããã«å¤æããããã¡ã¤ã«ãç½®ã
â Â âââ XXX.pdf
â Â âââ YYY.pdf
âââ pdf_converter.rb âå¤æãã¼ã«ãindex.htmlã®ãã³ãã¬ã¼ããå ¥ã£ã¦ã
â å¤æãã¼ã«ã使ãããã«ã»ããã¢ãããå¿ è¦ãªç©
windows+cygwinã¨CentOS6ã§åä½ããäºã確èªãã¦ã¾ãããCentOS6ã®æ¹ãã»ããã¢ããã楽ã§ãã
â ãã¼ã«ã®ä½¿ãæ¹
- git clone https://github.com/ahinore/bookreader-em
- cd bookreader-em
- mkdir pdf
- pdfãã£ã¬ã¯ã㪠é ä¸ã«å¤æãããPDFãé ç½®ï¼è¤æ°å¯ï¼
- ruby pdf_converter.rb
â»çµæ§æéãããããImageMagicã®ä¸éãã¡ã¤ã«ã¨ãã¦ï¼ãã¼ã¸å½ãã300MBä½ã®ãã¡ã¤ã«ãä½ãããã®ã§æ³¨æ - booksãã£ã¬ã¯ããªãenchantMOONã®Dataãã£ã¬ã¯ããªã«ã³ãã¼
- bookreader.moon.zipãenchantMOONã«ã¤ã³ã¹ãã¼ã«ãã¦å®è¡
https://github.com/ahinore/bookreader-em/raw/master/bookreader.moon.zip
â»åã«ãMOON.openUrl("file:///mnt/extsd/Data/books/index.html");ããã¦ãã ã
â ããã¯ãªã¼ãã¼ã®ä½¿ãæ¹
- ããã¯ãªã¹ã â ãã¼ã¸ãªã¹ã â jpegç»å ã®ããã«é·ç§»ã§ãã
- jpegç»åã®å³å´ãã¿ããããã¨æ¬¡é ãå·¦å´ãã¿ããããã¨åé ãä¸é¨ãã¿ããããã¨ãã¼ã¸ãªã¹ãã«é·ç§»Â
â ç¬ãè¨
- ããã¯ãªã¼ãã¼ã¯enchant.jsã§ã·ã¼ã«ã¨ãã¦å®è£ ãããã¨ãæã£ãããããããã¨ãã¼ã¸ã®åãæãã¨ãä¸çç¸ã§ãããªãããªã®ã§æ®éã®Webãã¼ã¸+jQueryã§å®è£ ããã
- ããã¯ãªã¹ãã¨ããã¼ã¸ãªã¹ãã¨ãè¶ ã·ã§ãã¤ããã®ãã¡cssã§ç¶ºéºã«ãããã
- ãã©ã¦ã¶ãéãã¦ãå度éããæã«æå¾ã«è¦ã¦ããã¼ã¸ã表示ãããã®ã ãããã¼ã«ã«ãã¡ã¤ã«ã ã¨ã¯ããã¼ã使ããªãã£ããHTML5ã®ãã¼ã«ã«ãã¡ã¤ã«ã使ããªã模æ§ãã©ãã«ããããããã¾ããããçã«åãæãã¦ç½®ãã°OKãªæ°ããã¦ããã
- HTMLã®é·ç§»ã¯ããããªãã£ãã®ã§ç»åã®ã¿ãå ¥ãæ¿ããããã«ãã¦ããããããããã¨URLãå¤ãããªãã¦åæãããå ãã¼ã¸ã«æ»ããªããªã£ã¦ãã¾ãã®ã§ãURLã®ããã·ã¥å¤ãå¤æ´ããããã«ãã¦ããããã³ãã¯pushStateã¨ã使ãã¹ããªã®ãããããªãã
- index.htmlã«ããã¯ãªã¹ãã®jsonãã¼ã¿ãåãè¾¼ãã§ãããããã¯ajaxã§ãã¼ã«ã«ãã¡ã¤ã«ã«ã¢ã¯ã»ã¹ã§ããªãã®ã§ä»æ¹ãªãããã
- ãã³ãã¤ã³ãã¢ã¦ãã§æ¡å¤§ç¸®å°ã¨ããå®è£ ãããã
- jpegãªã¼ãã¼çãªjavascriptã¯è²ã å ¬éããã¦ããããªã®ã§ãè¯ãã®ãã£ããå ¥ãæ¿ãããã