divs2slides.js 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. /**
  2. * divs2slides.js
  3. * Ver : 1.3.2
  4. * update: 14/05/2018
  5. * Author: meshesha , https://github.com/meshesha
  6. * LICENSE: MIT
  7. * url:https://github.com/meshesha/divs2slides
  8. *
  9. * New:
  10. * - fixed fullscreen (fullscreen on div only insted all page)
  11. */
  12. (function( $ ){
  13. var orginalMainDivWidth,
  14. orginalMainDivHeight,
  15. orginalSlidesWarpperScale,
  16. orginalSlideTop,
  17. orginalSlideLeft,
  18. orginalSlidesToolbarWidth,
  19. orginalSlidesToolbarTop;
  20. var pptxjslideObj = {
  21. init: function(){
  22. var data = pptxjslideObj.data;
  23. var divId = data.divId;
  24. var isInit = data.isInit;
  25. $("#"+divId+" .slide").hide();
  26. if(data.slctdBgClr != false){
  27. var preBgClr = $(document.body).css("background-color");
  28. data.prevBgColor = preBgClr;
  29. $(document.body).css("background-color",data.slctdBgClr)
  30. }
  31. if (data.nav && !isInit){
  32. data.isInit = true;
  33. // Create navigators
  34. $("#"+divId).prepend(
  35. $("<div></div>").attr({
  36. "class":"slides-toolbar",
  37. "style":"width: 90%; padding: 10px; text-align: center;font-size:18px; color: "+data.navTxtColor+";" ////New for Ver: 1.2.1
  38. })
  39. );
  40. $("#"+divId+" .slides-toolbar").prepend(
  41. $("<img></img>").attr({
  42. "id":"slides-next",
  43. "class":"slides-nav",
  44. "alt":"Next Slide",
  45. "src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAADZ0lEQVRIiZ2Va2xTdRjGH5xEg0aXeInRqE00pKwfHAkydYMdlXFpiG5LYFFi0iBZFFeLrm50ZrbrYLeyneEFcHMMhxoksGUSTEw01UQz1ukO29quO11vXNZNwBI1gRDN4wfa0q3n1MKT/D697/s8//OenP8BspD2jSGNtmpISEVjcOZmM6sqjcGZm/f2sC2/+tfQpnYvdxwK0NwXpLkvyB2HAixr83C5eUTSGV2GmzZfVjVc+qxlNFb/dYRHh2Psdl7knpNzbDkxy5YTs9xzco7dzov88pdLtHwV5tM1v4W0VUNCVuZ5plO9r3b62O28wF2DURr7zmRk12CUvT9dYLnDw/99Gp3JJW7bL7Pj2zlW9kS4tTucFZU9EX743RwrOibVQ7RVQ0K5w8uG/hm+8knolmjon+Fa+zh12135aQEFtaMh6/HzLN8bSIMkmwajirWFWI6cpc7kcs5fjdFlWNPoYdneAF/qmE6DJP+++i+bBqOK9VQ2fRSkYBvnvJeeZxoeWNcqc2P7tCKp+t79Jys+Dqr2bmyfZkmzjzqTS0wGLH9vNKZ3+KnGQs1evsbaI+dU+/UOP596Z0RKBqy0nOb6VlkVNX3x8yXVmZWW0wQArDCPCIX14yxp8nFt85QimTQ9e5VvHgzP6y+2e24E5O+UNAV1YyyoG2PhBxMsbvDw+UYv1+yeTJJJf135h63fzLC4wcMi6wSfef+6V0HdGJMrKqyfoBKrrG6usrpVzeXoFRr2+RVnn6sfiyUDiqxuabXNTTWU1Pvj76r9q21uFlknBpIBgt0rvtDopRqpisausbIrqNqbQLB7blwZgm1SU9LsoxoJHXf9wTJRVu1L8OJuX0ywSfP/F+taZHFDm0wlSNI+MKNYU2J985Qt7S4SbFKu3uGXMn2h2aB3+KU084T0bXJ+qRiIlXUGeCu8LAaktNUsVKk4qdmyLyS9diDMm2HL/pCzVMxsvijObQByKj+dqjb2RS6bDp9lJoyfhyPbDvheB5ATn034JJUDYDGAOwHcDSAXwIMAHgWwdHPtZ+btnT/01/SMequ7XHJ118hUzUHJ/Van81iFpfddAE8AeATAAwDuBbAEwB0Abo8HXj9xSshd8ZD7ATwM4HEATwJYBkAXRxs3fgzAQwDuA3BPivniuOei/wDo+pj+wU2R5QAAAABJRU5ErkJggg==",
  46. "style":"float: right;cursor: pointer;opacity: 0.7;"
  47. }).on("click", pptxjslideObj.nextSlide)
  48. );
  49. if(data.showTotalSlideNum){
  50. $("#"+divId+" .slides-toolbar").prepend(
  51. $("<span></span>").attr({
  52. "id":"slides-total-slides-num"
  53. }).html(data.totalSlides)
  54. );
  55. }
  56. if(data.showSlideNum && data.showTotalSlideNum){
  57. $("#"+divId+" .slides-toolbar").prepend(
  58. $("<span></span>").attr({
  59. "id":"slides-slides-num-separator"
  60. }).html(" / ")
  61. );
  62. }
  63. if(data.showSlideNum){
  64. $("#"+divId+" .slides-toolbar").prepend(
  65. $("<span></span>").attr({
  66. "id":"slides-slide-num"
  67. }).html(data.slideCount)
  68. );
  69. }
  70. if(data.showFullscreenBtn){
  71. $("#"+divId+" .slides-toolbar").prepend(
  72. $("<img></img>").attr({
  73. "id":"slides-full-screen",
  74. "class":"slides-nav-play",
  75. "alt":"fullscreen Slide",
  76. "src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAGwUlEQVRIibWWW0zU+RWAR1eHgaJtN92kbXYTkjUtlW26u6m7cQsMFwsyzAAOMyBQVGCAhUFgUFirYlABgSAXB6MgcinoDCBR3IGxwhABg1wEZQYRMIg3arn9B7ft+vj1AcK2Tdq+tCf5Hn7nnPy+nKdzRKL/d5SVld9uaLxiN//xtt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ErkJggg==",
  77. "style":"float: left;cursor: pointer;opacity: 0.7; padding: 0 10px 0 10px"
  78. }).bind("click", function(){
  79. pptxjslideObj.fullscreen();
  80. })
  81. )
  82. }
  83. if(data.showPlayPauseBtn){
  84. $("#"+divId+" .slides-toolbar").prepend(
  85. $("<img></img>").attr({
  86. "id":"slides-play-pause",
  87. "class":"slides-nav-play",
  88. "alt":"Play/Pause Slide",
  89. "src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAF4UlEQVRIibWW+3NU9RnGz4ZR+5t0qjOVXmZ6M9b+0LEyuFRDjCEElMhEZlCSaWcohWgQoZE9e3Zdwg4Xd1FjJBQxlmgxbcm0NWNMJ6vBJuQCLCYxl92w2Vz3vtmTy2ZzOUnO7vrpDyklMEjbmfb9A97n+7zP+z7PVxBuU2KRqNXr9JIkSTUmo8lrNBgTRoMxYTKavJIk1eh1ekksErW363HL0ul0aZIolVst1pCtzobT4USWZVRVRVVVZFnG6XBiq7NhtVhDkiiV63S6tP+ouSiKheZic5fdbkdRFPrlODW9KmUXVV6pVzlYr/LbFpVah8pQJI6iKNjtdszF5i5RFAtv3/yAaKg6VxWWZZmrYZXfd8R58W8qOZXzPPHOHGknpkkvmSLz9SibS6fY/d40lS3z9IeWWFWdqwqLB0TDV7686lxVOB6PY3MtcvDvCTa8P8/qk7OsKZlm7fEpHnt1kvTD4zx+aIx0k0y6IUKWKYL43hSNXQvE4/ElkJuZ6HS6NHOxuUuWZWyuBXbVqDxyWuGh0lnWHI+hPRYl/fAE6SaZdVKETClClhhigxhiw4EQWS8HyTsSoaFjHlmWMRebu27QRBKlcrvdjiu8iL4+gfb0HNq3ZsksjfLUG2NsPBLhccMomfowG3R+Hi30kb0/yKb9AZ7c52fzvgCbX/JTVDLGgHcRu92OJErlS6MpErVWizWkKAoVbXEyKhRWl87w1IkJukeiBEfH6XGH2fSyi+KKMP3ecQxlg2TsHCB7t5cte3xsKfSSu8fHMy/6qPhwCk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fgbNUQWhLMGdZ+CePyTJ+DTJ++7EV9v1rQLnYts0Ba+EWbnJi+ZpPyn5/wQQY0sAJ5OsrITCVrCHE/8+cJYzWR6Zbc45LB9EyT0WJVUfI/WoQu5ZFUtzgrZg8r+LzOWa/N9C/wY2/4Nvyz8A92FZT9kSnHgAAAAASUVORK5CYII=",
  90. "style":"float: left;cursor: pointer;opacity: 0.7; padding: 0 10px 0 10px"
  91. }).html("<span style='font-size:80%;'>&#x23ef;</span>").bind("click", function(){
  92. if(data.isSlideMode){
  93. pptxjslideObj.startAutoSlide();
  94. }
  95. })
  96. );
  97. }
  98. $("#"+divId+" .slides-toolbar").prepend(
  99. $("<img></img>").attr({
  100. "id":"slides-prev",
  101. "class":"slides-nav",
  102. "alt":"Prev. Slide",
  103. "src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAADXklEQVRIiZ2Ve2hTZxjGH+tE0bEFdGNM1IBj1PYPKzjr1roeN6tdEW0LWpwMgpMytVncGttF6ZKm2lu0qXdtrdV6wY3ZUsXBYCMbOGrTrce2SZqeNrc5m9bLIjpQxPHsD5PYpMkx+sAPDnzv+zwf3+0ACUipsiiSizuFCL7oVCbSK6tUtVW1SNst5tfZuf2Ui9pWN7Wtbm4/5eK6fQ6mlfzhSfmyy6BUWRQvZJxc3Cm8V/qnR3fey3O/32WT5Q73XhljzeVR1lwe5d4rY2yy3OH3XQGWf+fj+7qewILirryEZ11gsrPlt9vc3eGnuvUvWXZ3+Nlkuc1PG5xM0Vxrea55Yf0AD/w0xqJmHzc1eROiqNnH+h/HuPmoxFSN1RzbfKs1baWxjxVtI9xw2PNSVLSNsMDkYHJxpzAxQGO16C7cYMF+13Op6vCTZMwx/cWbTC/r8UzYVMHQx3UH3VxTPyxLVYef/z76jyRjjufvd3FFpZ2paqtq/OzN2dVOrt43HJfCQ27+bLvP8YpXu6pWYoqmqz0csPCrbjHXNMR4lF34m6P3HjNacj2LdvQEwgFLdNeZUyvF5OzVuxOMQ4rXk1MrcYnuOiMCsox2rqweDLPlpJfDo4/impOMqB9PdpWTGeV9XKztfnqa0nf2Mn1nL5fu6mWmvp9ZFXbWXhrhg4dPZANW7BkIs7zSwawKOzO+7WfIL+0bUQkA+KC8N5BR3s9oVEeGKPkfxg1Yprdxmd42oS9EeIky9f3tHxpsjEfLr7diBsj1ZOptYjhAMNpVH1U6KEdRo5v+QORJkqsXjI5nT4ZgEBUf73EGsqudlCPfLPGi9Z9wgFytYBhQRtzmnOpBwyd1EhPB2D5CknHHV9VIsR+8XNOQKHebEyHXNCQKBjH2D0gwiIq1ZpeY3+Diy5BndgVy66S0mOYh5ZlFxcajHstnx7x8ETYe8Yh55qh1j9KkIEkAJm8+5vxcfdrr05y5QTnUrb57RccHSwBMDvaGfMJKAvAKgKkApgN4HcAbAGYDmF+oa/l6W4Plh9KToq2ksXuwpNEqlTb3OLY2/NK2vuyEFsC7AOYAeBOAAsCrAKYBmBIMxaTgx5RxIa8BmAngLQBzAcwHkAwgNcgCAO8AmAfgbQCzguYzosyT/gcSaJj+/BZ/OQAAAABJRU5ErkJggg==",
  104. "style":"float: left;cursor: pointer; opacity: 0.7;",
  105. }).bind("click", pptxjslideObj.prevSlide)
  106. );
  107. $(".slides-nav, .slides-nav-play").on("mouseover",function(){
  108. $(this).css({
  109. "opacity":1
  110. });
  111. });
  112. $(".slides-nav, .slides-nav-play").on("mouseout",function(){
  113. $(this).css({
  114. "opacity": 0.7
  115. });
  116. });
  117. if(data.slideCount == 1){
  118. $("#"+divId+" #slides-prev").hide();
  119. }else if(data.slideCount == data.totalSlides){
  120. $("#"+divId+" #slides-next").hide();
  121. }else{
  122. $("#"+divId+" #slides-next").show();
  123. }
  124. }else{
  125. $("#"+divId+" .slides-toolbar").show();
  126. data.isEnbleNextBtn = true;
  127. data.isEnblePrevBtn = true;
  128. }
  129. if(document.getElementById("all_slides_warpper") === null){
  130. $("#" + divId + " .slide").wrapAll("<div id='all_slides_warpper'></div>");
  131. }
  132. // Go to first slide
  133. pptxjslideObj.gotoSlide(1);
  134. },
  135. nextSlide: function(){
  136. var data = pptxjslideObj.data;
  137. var isLoop = data.isLoop;
  138. var isAutoMode = data.isAutoSlideMode;
  139. if (data.slideCount < data.totalSlides){
  140. pptxjslideObj.gotoSlide(data.slideCount+1);
  141. if(!isAutoMode) $("#slides-next").show();
  142. }else{
  143. if(isLoop){
  144. pptxjslideObj.gotoSlide(1);
  145. }else{
  146. if(!isAutoMode) $("#slides-next").hide();
  147. }
  148. }
  149. if(!isAutoMode){
  150. if(data.slideCount > 1){
  151. $("#slides-prev").show();
  152. }else{
  153. $("#slides-prev").hide();
  154. }
  155. if(data.slideCount == data.totalSlides && !isLoop){
  156. $("#slides-next").hide();
  157. }
  158. }
  159. //return this;
  160. },
  161. prevSlide: function(){
  162. var data = pptxjslideObj.data;
  163. var isAutoMode = data.isAutoSlideMode;
  164. if (data.slideCount > 1){
  165. pptxjslideObj.gotoSlide(data.slideCount-1);
  166. }
  167. if(!isAutoMode){
  168. if(data.slideCount == 1){
  169. $("#slides-prev").hide();
  170. }else{
  171. $("#slides-prev").show();
  172. }
  173. $("#slides-next").show();
  174. }
  175. return this;
  176. },
  177. gotoSlide: function(idx){
  178. var index = idx - 1;
  179. var data = pptxjslideObj.data;
  180. var slides = data.slides;
  181. var prevSlidNum = data.prevSlide;
  182. var transType = data.transition; /*"slid","fade","default" */
  183. if(transType=="random"){
  184. var tType = ["","default","fade","slid"];
  185. var randomNum = Math.floor(Math.random() * 3) + 1; //random number between 1 to 3
  186. transType = tType[randomNum];
  187. }
  188. var transTime = 1000*(data.transitionTime);
  189. if (slides[index]){
  190. var nextSlide = $(slides[index]);
  191. if ($(slides[prevSlidNum]).is(":visible")){ //remove "index >= 1 &&" bugFix to ver. 1.2.1
  192. if(transType=="default"){
  193. $(slides[prevSlidNum]).hide(transTime);
  194. }else if(transType=="fade"){
  195. $(slides[prevSlidNum]).fadeOut(transTime);
  196. }else if(transType=="slid"){
  197. $(slides[prevSlidNum]).slideUp(transTime);
  198. }
  199. }
  200. if(transType=="default"){
  201. nextSlide.show(transTime);
  202. }else if(transType=="fade"){
  203. nextSlide.fadeIn(transTime);
  204. }else if(transType=="slid"){
  205. nextSlide.slideDown(transTime);
  206. }
  207. data.prevSlide = index;
  208. pptxjslideObj.data.slideCount = idx;
  209. $("#slides-slide-num").html(idx);
  210. }
  211. return this;
  212. },
  213. keyDown: function(event){
  214. event.preventDefault();
  215. var key = event.keyCode;
  216. //console.log(key);
  217. var data = pptxjslideObj.data;
  218. switch(key){
  219. case(37): // Left arrow
  220. case(8): // Backspace
  221. if(data.isSlideMode && data.isEnblePrevBtn){
  222. pptxjslideObj.prevSlide();
  223. }
  224. break;
  225. case(39): // Right arrow
  226. case(32): // Space
  227. case(13): // Enter
  228. if(data.isSlideMode && data.isEnbleNextBtn){
  229. pptxjslideObj.nextSlide();
  230. }
  231. break;
  232. case(46): //Delete
  233. //if in auto mode , stop auto mode TODO
  234. if(data.isSlideMode){
  235. var div_id = data.divId;
  236. $("#"+div_id+" .slide").hide();
  237. pptxjslideObj.gotoSlide(1); //bugFix to ver. 1.2.1
  238. }
  239. break;
  240. case(27): //Esc
  241. if(data.isSlideMode){
  242. pptxjslideObj.closeSileMode();
  243. data.isSlideMode = false;
  244. }
  245. break;
  246. case(116): //F5
  247. if(!data.isSlideMode){
  248. pptxjslideObj.startSlideMode();
  249. data.isSlideMode = true;
  250. if(data.isAutoSlideMode || data.isLoopMode){
  251. clearInterval(data.loopIntrval);
  252. data.isAutoSlideMode = false;
  253. data.isLoopMode = false;
  254. }
  255. }
  256. break;
  257. case(113): // F2
  258. if(data.isSlideMode){
  259. pptxjslideObj.fullscreen();
  260. }
  261. break;
  262. case(119): // F8
  263. if(data.isSlideMode){
  264. pptxjslideObj.startAutoSlide();
  265. }
  266. break;
  267. }
  268. return true;
  269. },
  270. startSlideMode: function(){
  271. pptxjslideObj.init();
  272. },
  273. closeSileMode: function(){
  274. var data = pptxjslideObj.data;
  275. data.isSlideMode = false;
  276. var div_id= data.divId;
  277. $("#"+div_id+" .slides-toolbar").hide();
  278. $("#"+div_id+" .slide").show();
  279. $(document.body).css("background-color",pptxjslideObj.data.prevBgColor);
  280. if(data.isLoopMode){
  281. clearInterval(data.loopIntrval);
  282. data.isLoopMode = false;
  283. }
  284. pptxjslideObj.exitFullscreenMod();
  285. },
  286. startAutoSlide: function(){
  287. var data = pptxjslideObj.data;
  288. var isAutoSlideOption = data.timeBetweenSlides
  289. var isAutoSlideMode = data.isAutoSlideMode;
  290. if(!isAutoSlideMode && isAutoSlideOption !== false){
  291. data.isAutoSlideMode = true;
  292. //var isLoopOption = data.isLoop;
  293. var isStrtLoop = data.isLoopMode;
  294. //hide and disable next and prev btn
  295. if(data.nav){
  296. var div_Id = data.divId;
  297. $("#"+div_Id+" .slides-toolbar .slides-nav").hide();
  298. $("#"+div_Id + " #slides-play-pause").attr("src" , "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAF00lEQVRIibWW7U+b5xXGb02TWu3DwodqW7R2XdVpbFW1hiBEAJu0iCSQqgloQ2oaLYhNSdos2xoSP37wGHHTD7Cp/YboIqVSAylBnZRCSu125IVAgh8wL8Zv2NjgF+LH8PAWE3BiQ/rbhywLydJsk7bzB1znPuc613XdQjympGppi9FglGVZ7qg11UZMNaY1U41prdZUG5FlucNoMMpStbTlcRiPLIPBoJcl+WRDfYNqtVhxu9xomkY6nSadTqNpGm6XG6vFSkN9gypL8kmDwaD/j8AlSTpkrjM7FEUhmUyS9nhYOXWKxNu/Z37XLubKylg8epTl06dJ+Xwkk0kURcFcZ3ZIknTo8eDHpJq2s21xTdNIOUZYOn6c2cJCpnNyUHNzmcrLI1pQQFinI6TXEykpYeHPf+K2x4OmabSdbYtLx6Sar31529m2+OrqKiutrczv3s1MTg7xfwBH8vMJ63RM6vVMbN1K8OWXCRYVESwuJrpvH0vnz7O6unq3ycOTGAwGvbnO7NA0jZXWVmbz84lv3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/kLHUlUpt/5S/6DQ1ltFwmbDm5mJIgRDu3cR6u0h1NNN5Go3U31XuK70EBvoQR28RnxIIT5iJzbUj/3IARb3V5A2HyEVGHvQKh42u5mmJoafeII+IbjwpOBihqD7e4KrPxTYMgUDWU8yrNuIc8cLeMrz8b9RivabSu788RipnkuPNruH7Xq6qQlvZibObwvGvisIPCsI/UQwlSWI6zOYLf0RixW53Kzaye3f7eOr994lbev7ert+VOAk+vu5/uZBxp/LwP/sXRFFNgti+g3MlD7Pws9zWDlQRvr0B6TDk/8+cNZPsj4yl50jzDXWE99fjrojk5nyTBb/sI/lv54iHRr/7yJzPSf/t9B/YJr/wbfl7/GTWKgJirhoAAAAAElFTkSuQmCC");
  299. }
  300. data.isEnbleNextBtn = false;
  301. data.isEnblePrevBtn = false;
  302. ///////////////////////////////
  303. var t = isAutoSlideOption + data.transitionTime;
  304. var slideNums = data.totalSlides;
  305. var isRandomSlide = data.randomAutoSlide;
  306. if(!isStrtLoop){
  307. var timeBtweenSlides = t*1000; //milisecons
  308. data.isLoopMode = true;
  309. data.loopIntrval = setInterval(function(){
  310. if(isRandomSlide){
  311. var randomSlideNum = Math.floor(Math.random() * slideNums) + 1;
  312. pptxjslideObj.gotoSlide(randomSlideNum);
  313. }else{
  314. pptxjslideObj.nextSlide();
  315. }
  316. }, timeBtweenSlides);
  317. }else{
  318. clearInterval(data.loopIntrval);
  319. data.isLoopMode = false;
  320. }
  321. }else{
  322. clearInterval(data.loopIntrval);
  323. data.isAutoSlideMode = false;
  324. data.isLoopMode = false;
  325. //show and enable next and prev btn
  326. if(data.nav){
  327. var div_Id = data.divId;
  328. $("#"+div_Id + " .slides-toolbar .slides-nav").show();
  329. $("#"+div_Id + " #slides-play-pause").attr("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAF4UlEQVRIibWW+3NU9RnGz4ZR+5t0qjOVXmZ6M9b+0LEyuFRDjCEElMhEZlCSaWcohWgQoZE9e3Zdwg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zzeyhobGZ5ubzXGhu5Js//Zj8fXau2M/TcvECbR2X6XZ04HJ3I0dcePw+cg66EHI8pBaMo6oqRoMx8S+A5/+8QPYbUZ62jvOTXSFSt/bSctlOX187Pb2drNLWscPUhWekE1e/gyFvH77gMKNyAHV+guhkkK2HLyLkeUkVY9cBro3oVds8OSWTpBaEELRD/GBTD73uPiLyMCPeIe5b9wkFFhexmIfQaICxyQgLC9Mk43NUX3Bx/wufIfzKjUYXI/dt5fqIron818/n+F5hBGH9CMKaAe7f2IPHH2R+YZLImMyq9fXsKR0imYwxvzAHfIk3PMHOt1rR7LAjGKbQHFPRHFawfLp4XeRra9o9PM/K5yJosoYRfubmgaxuxqOzAEzPzPHtJ+vZfzrAUiU495mL7+9tQCjyIpQmEcq+RDiRYOWpBFc8ietruvzQCt6cJCVzCOEhN999rIsrXTLB0Sk6egPcm9PI9pIAVz1jbLc2IexsQzg6i/AOrPgd3HEG7qiAgkZuPLTlVnGpZ4bU/BAr1rhJ+XEP9z7cxHcy6rknuxFNrpu7dvj4+q5OhBeGEY4nEE7DnRVw99kE36hMsroWWgPJG63iZrM7VTXJ134+yIoHexEe7EXQDiBke0nJG0XYPYFQNI3myCJCaYKUd+Hus0lW/SnOA9UJyq8mb212N9v1qcoxUrOHWPFwHykZg6Tk+EjJC6N5fhyNfgbNUQWhLMGdZ+CePyTJ+DTJ++7EV9v1rQLnYts0Ba+EWbnJi+ZpPyn5/wQQY0sAJ5OsrITCVrCHE/8+cJYzWR6Zbc45LB9EyT0WJVUfI/WoQu5ZFUtzgrZg8r+LzOWa/N9C/wY2/4Nvyz8A92FZT9kSnHgAAAAASUVORK5CYII=");
  330. }
  331. data.isEnbleNextBtn = true;
  332. data.isEnblePrevBtn = true;
  333. }
  334. },
  335. fullscreen: function(){
  336. if (!document.fullscreenElement &&
  337. !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement ) { // current working methods
  338. var data = pptxjslideObj.data;
  339. var div_Id = data.divId;
  340. if (document.documentElement.requestFullscreen) {
  341. document.getElementById(div_Id).requestFullscreen();
  342. } else if (document.documentElement.msRequestFullscreen) {
  343. document.getElementById(div_Id).msRequestFullscreen();
  344. } else if (document.documentElement.mozRequestFullScreen) {
  345. document.getElementById(div_Id).mozRequestFullScreen();
  346. } else if (document.documentElement.webkitRequestFullscreen) {
  347. document.getElementById(div_Id).webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
  348. }
  349. var winWidth = $(window).width();
  350. var winHeight = $(window).height();
  351. //Need to save:
  352. orginalMainDivWidth = $("#"+div_Id).width();
  353. orginalMainDivHeight = $("#"+div_Id).height();
  354. var m = $("#"+div_Id +" #all_slides_warpper").css('transform');
  355. orginalSlidesWarpperScale = m.substring(m.indexOf('(') + 1, m.indexOf(')')).split(",")
  356. orginalSlideTop = $("#"+div_Id +" #all_slides_warpper .slide").offset().top;
  357. orginalSlideLeft = $("#"+div_Id +" #all_slides_warpper .slide").offset().left;
  358. orginalSlidesToolbarWidth = $("#"+div_Id+" .slides-toolbar").width();
  359. orginalSlidesToolbarTop = $("#"+div_Id+" .slides-toolbar").offset().top;
  360. $("#"+div_Id).attr({
  361. style: "width: " + (winWidth - 10) + "px; height: " + (winHeight - 10) + "px;"
  362. });
  363. $("#"+div_Id +" #all_slides_warpper").css({
  364. "transform":"scale(1)"
  365. });
  366. var slideWidth = $("#"+div_Id +" #all_slides_warpper .slide").width();
  367. var sildeHeight = $("#"+div_Id +" #all_slides_warpper .slide").height();
  368. $("#"+div_Id +" #all_slides_warpper .slide").css({
  369. "top": ((winHeight - sildeHeight)/2) + "px",
  370. "left": ((winWidth - slideWidth)/2) + "px"
  371. });
  372. if(data.nav){
  373. $("#"+div_Id+" .slides-toolbar").css({
  374. "width": "99%",
  375. "top": "20px"
  376. });
  377. }
  378. //change fullscreen icon to other icon (red color)
  379. $("#"+div_Id + " #slides-full-screen").attr("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAAGXcA1uAAAA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6ve+CUSMFKW6KwdD85xJoixdNHH7TZMsQW6Gh7xmLf2CtPCdftPESxe+fG3O5XnP5KNyinddl1Ur0O/GCkeF7BrFgjt7Rne2tKJzqqi4bw4/BBXiDPIn5dDPBqF768ghiGGhpZJUuuVQ+VuZYHsU98SwqgUWFXRZXsosGii12kSfS6bQLsR/T6XGJA7xGC3TwwIj+j3tok+j10gO0RvsxFtSY3f1pK/Cc+DEtF+M1d2lh64w55Fmavft4jLod06nYtKdkKq1G3/AXQ7ZlFGn4JYwn0ap3lcp90Wyd+oVn6AnvczV8OYuVBGw4oVNuQrFh2pNZ9ZFDBXcULDNCQO97ka2DD73HZuKfF4Q9YkmaowVKCv3QJ9ejTHeroB2bbt2Go+CZ2c6EqVIysnMyRBkxgoyPMgHRCdKajv4TWk+kXorL4Emi3fcCySAB44uAERS5P8LTxK/Jyd1V1xlqlCH5Dr0oa0MTkHB8OfBM2RTshh3HdPs3chbeDh2kkci2KydjCXwpLzK1OdjI0slmTQevUQ66a97DgbIvkB6SsMmmu7nsOGyLJB7yDpUB1JZxSTpaPdMVuYs5fxBvTfIX8m6djPbGGQnzcVbgdH0c6g7sLAdxqnefuZzSHJJUHVsnGsGoqJ9i5LmpRIYcpaytoLO63p4BJcsJxtmq5KNaKiERmegt5xnObptBSQvqmMexfqkqYAxUSWyRKal0wTRLnntVsx91VuWeezR+D7aFDOiwgi9nWoiHmNx3hdaG34W6IwxcSfVECqWv1pxL2YN95XJUzINGUv66w/uCRgyooPmHNWyMgEgf8Vf0Peej9arw/7iPWhdp0fb+G35q6WLUcSZEtOQsB8eDn1PdUJE3YqYt4aY9wTFxHS87OHLCAk/zexPwbb8YiJiM8QUxHTQpiMmIT4EDEW8Q6uH43tS9gOCYX7vx9J+hsvJPGPOaYclwAAAABJRU5ErkJggg==")
  380. } else {
  381. if (document.exitFullscreen) {
  382. document.exitFullscreen();
  383. } else if (document.msExitFullscreen) {
  384. document.msExitFullscreen();
  385. } else if (document.mozCancelFullScreen) {
  386. document.mozCancelFullScreen();
  387. } else if (document.webkitExitFullscreen) {
  388. document.webkitExitFullscreen();
  389. }
  390. pptxjslideObj.exitFullscreenMod();
  391. }
  392. },
  393. exitFullscreenMod: function(){
  394. var data = pptxjslideObj.data;
  395. var div_Id = data.divId;
  396. //saved:
  397. /*
  398. orginalMainDivWidth
  399. orginalMainDivHeight
  400. orginalSlidesWarpperScale
  401. orginalSlideTop
  402. orginalSlideLeft
  403. orginalSlidesToolbarWidth
  404. orginalSlidesToolbarTop
  405. */
  406. $("#"+div_Id).attr({
  407. style: "width: " + orginalMainDivWidth + "px; height: " + orginalMainDivHeight + "px;"
  408. });
  409. console.log(orginalSlidesWarpperScale[0])
  410. $("#"+div_Id +" #all_slides_warpper").css({
  411. "transform":"scale(" + orginalSlidesWarpperScale[0] + ")"
  412. });
  413. $("#"+div_Id +" #all_slides_warpper .slide").css({
  414. "top": "0px", /**orginalSlideTop + */
  415. "left": "0px" /**orginalSlideLeft + */
  416. });
  417. if(data.nav){
  418. $("#"+div_Id+" .slides-toolbar").css({
  419. "width": orginalSlidesToolbarWidth + "px",
  420. "top": orginalSlidesToolbarTop + "px"
  421. });
  422. }
  423. //change fullscreen icon to orginal icon - TODO
  424. $("#"+div_Id + " #slides-full-screen").attr("src","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAGwUlEQVRIibWWW0zU+RWAR1eHgaJtN92kbXYTkjUtlW26u6m7cQsMFwsyzAAOMyBQVGCAhUFgUFirYlABgSAXB6MgcinoDCBR3IGxwhABg1wEZQYRMIg3arn9B7ft+vj1AcK2Tdq+tCf5Hn7nnPy+nKdzRKL/d5SVld9uaLxiN//xttDT2yf03xsQhu+PCGNWqzD+aEJ48mRGePbsufDq1ZywsLgoLAuCML+wILx4+VJ4+nRWeDw5LVhtNmF09IFwb2BQ6LJ0C0Zjs1BZWWUvKSm1iDIOH35TWFRMWfk5jh07xonjxzmVk0Nebi6FBQWcLS6mrLSUCr2eyosXu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sqFuDgN3lIPfuTqTuiJZlTZVwk7aUR9somw0y1E5LcSVXCD6MK2daIKbhCR30r46RZCc4wEHW0kKLuZH277DC9PD+LiNAQHB9tFMlmgEBsbh5fUg+9/+Dl+GXX4plaxK72a3Zm1yI80EHT0CiHHr6I8YVgl20DI8asEHb1C4Ff1BGTWsiu9Gl9dHVtdfo3Uw52YmFgUiiC7KCBAJhw4EIPUw52tLjtwTzyPe3w5XskV+B68iH96FQEZ1cgyLxOYVbOOLPMyARnV+KdX4ZNyAWmSHqm2EucPPsHT/TccOBCDXK6wi/z8/IV9+/YjlUoRiURscnDmHbHTOpscnNdw+qf8au1f386IRCI8PaVER+9DJgu0i4KD99g1mngCA+WIxWLEmzfjIBYjcXDAQSxmg0jEOxs34iiR4OzktIqzE06OjjhKJEgkDuu94s2bEYvFyOUKNJp4VCr1iqjuD43LDQ1XMBibMDY1c/1GG+3tHXR2WbB0d2MwGDGZTIyMjDI1Nc3MzFMeT04yZrUyNDTM3f5+LJZuzOZbtLV9TVNzC1cNRq4ajNTW1QsiNze3d7ds2fKz7du3F8dpNAsxsXErcZr4lfiEJHuyNkXQ6TKWdRmHl9N1h5Z0hzKXDmVmLekOZS7pdBnLaem65YOpafZkbYo94cukFU18gv3LZO2fXV2350kkEhe1Wv3u+up0cXGR6PX6n9bW1roajcZPTSbTFxaLxWdwcDBweHhY9fDhw9/ZbLbY8fFxjc1mi7NarQdGRkai+vv71RaLRWE2m31bW1t3GAwGl5KSEsd/u6OBjcD3gPcAF+AjYAfgAfgCv13DG/gC+AT4OfA+8APAAdjwnwQb1iSbADHguCbcAmz9B7YAzoATIFnr3QRs/B/eJP89/g4EWvXUVw2aogAAAABJRU5ErkJggg==");
  425. }
  426. };
  427. $.fn.divs2slides = function( options ) {
  428. var target = $(this);
  429. var divId = target.attr("id");
  430. var slides = $("#" + divId + " .slide");//target.children();
  431. //console.log(slides)
  432. var totalSlides = slides.length;
  433. var prevBgColor;
  434. var settings = $.extend(true, {
  435. // These are the defaults.
  436. first: 1,
  437. nav: true, /** true,false : show or not nav buttons*/
  438. showPlayPauseBtn: true, /** true,false */
  439. showFullscreenBtn: true, /** true,false */
  440. navTxtColor: "black", /** color */
  441. keyBoardShortCut: true, /** true,false */
  442. showSlideNum: true, /** true,false */
  443. showTotalSlideNum: true, /** true,false */
  444. autoSlide:1, /** false or seconds (the pause time between slides) , F8 to active(condition: keyBoardShortCut: true) */
  445. randomAutoSlide: false, /** true,false ,(condition: autoSlide:true */
  446. loop: false, /** true,false */
  447. background: false, /** false or color*/
  448. transition: "default", /** transition type: "slid","fade","default","random" , to show transition efects :transitionTime > 0.5 */
  449. transitionTime: 1 /** transition time in seconds */
  450. }, options );
  451. var slideCount = settings.first
  452. pptxjslideObj.data = {
  453. nav: settings.nav,
  454. navTxtColor: settings.navTxtColor,
  455. showPlayPauseBtn: settings.showPlayPauseBtn,
  456. showFullscreenBtn: settings.showFullscreenBtn,
  457. showSlideNum: settings.showSlideNum,
  458. showTotalSlideNum: settings.showTotalSlideNum,
  459. target: target,
  460. divId: divId,
  461. slides:slides,
  462. isSlideMode: true,
  463. totalSlides:totalSlides,
  464. slideCount: slideCount,
  465. prevSlide: 0,
  466. transition: settings.transition,
  467. transitionTime: settings.transitionTime,
  468. slctdBgClr: settings.background,
  469. prevBgColor: prevBgColor,
  470. timeBetweenSlides: settings.autoSlide,
  471. isLoop: settings.loop,
  472. isLoopMode: false,
  473. isAutoSlideMode: false,
  474. randomAutoSlide: settings.randomAutoSlide,
  475. isEnbleNextBtn: true,
  476. isEnblePrevBtn: true,
  477. isInit: false
  478. }
  479. // Keyboard shortcuts
  480. if (settings.keyBoardShortCut){
  481. $(document).bind("keydown",pptxjslideObj.keyDown);
  482. }
  483. if (document.addEventListener){
  484. document.addEventListener('webkitfullscreenchange', exitHandler, false);
  485. document.addEventListener('mozfullscreenchange', exitHandler, false);
  486. document.addEventListener('fullscreenchange', exitHandler, false);
  487. document.addEventListener('MSFullscreenChange', exitHandler, false);
  488. }
  489. function exitHandler(){
  490. if (document.webkitIsFullScreen ===false || document.mozFullScreen === false || document.msFullscreenElement === null){
  491. pptxjslideObj.exitFullscreenMod();
  492. }
  493. }
  494. pptxjslideObj.init();
  495. }
  496. })(jQuery);