var Site_Root = ''; (function ($) { 'use strict'; var self = window.API = {}; self.$ = $(self); var API_PATH = '/Api/Javascript'.replace(/\/[^\/]+$/,"/"); var Member_PATH = API_PATH+"Member/"; var Data_PATH = API_PATH+"Data/"; var Absence_PATH = Data_PATH+"Absence/"; var Setting_PATH = API_PATH+"Setting/"; var Excel_PATH = API_PATH+"Excel/"; self.ROOT = Site_Root; /** * 解析格式 */ self.format = function(jsf){ return new grenalJSONFormat(jsf); } /** 登入 @param 必須 username, passwd */ self.loginWithData = function(data){ return $.post(Member_PATH+"login", data); } /** 登出 */ self.logout = function(){ return $.get(Member_PATH+"logout"); } /** * 取得表單驗證碼 * @param string formID Form 表單的 id * @return string 表單驗證碼 * 會直接將表單驗證碼該表單的放入 中 */ self.getVerificationCode = function(formID){ $.post(Data_PATH+"getVerificationCode", {'form_id': formID},function(result){ //return result.result; $('#' + formID + '_vc').val(result.result); }); return true; }/** * HEADER */ self.getFBLoginURL = function(data){ return $.post(Data_PATH+"getFBLoginURL", data); } self.getCategoryList = function(data){ return $.post(Data_PATH+"getProductCategory?type=ui", data); } self.getCategory = function(data){ return $.post(Data_PATH+"getProductCategory?type=ui_once", data); } /** * 首頁 */ self.getHomepageIndex = function(data){ return $.post(Data_PATH+"getHomepage?type=index", data); } self.getFeaturedProduct = function(data){ return $.post(Data_PATH+"getProduct?type=featured", data); } self.getPopularProduct = function(data){ return $.post(Data_PATH+"getProduct?type=popular", data); } self.getPopularNews = function(data){ return $.post(Data_PATH+"getNews?type=popular", data); } /** * 最新消息 */ self.getOpenNews = function(data){ return $.post(Data_PATH+"getNews?type=open", data); } /** * 產品 */ self.getOpenProductList = function(data){ return $.post(Data_PATH+"getProduct?type=open_list", data); } self.getOpenProduct = function(data){ return $.post(Data_PATH+"getProduct?type=open", data); } /** * 購物須知 */ self.getQA = function(data){ return $.post(Data_PATH+"getShoppingNotes?type=ui_list", data); } /** * 會員資料 */ self.getLoginMember = function(data){ return $.post(Data_PATH+"getMember?type=login", data); } self.submitMember = function(data){ return $.post(Setting_PATH+"editMember", data); } /** * 訂單 */ self.getMyOrder = function(data){ return $.post(Data_PATH+"getOrder?type=my_list", data); } self.submitOrder = function(data){ return $.post(Setting_PATH+"editOrder?m=create", data); } var code_array = '0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ/_-abcdefghijklmnopqrstuvwxyz'.split(''); var code_array_2 = 'D7jklYmIqJ034M/8Ncde_Wfg1GzHhiOUno-abPprQRSTs5KL6tXuAvwVxEy9@BFZC2'.split(''); var code_map={},code_map_2={}; var TemplateKey = self.ADMIN_ROOT+'/Template/'; var temp = localStorage.getItem('rv-template'); temp = temp? JSON.parse(temp) : {}; for(var i in code_array){ var loc = code_array[i]; var loc_2 = code_array_2[i]; code_map[loc] = loc_2; code_map_2[loc_2] = loc; } self.encode = function(code){ var ary = code.replace(TemplateKey,'').split(''); for(var i in ary){ var loc = ary[i]; ary[i] = code_map[loc]; } var result = ary.join(''); temp[result]=1; localStorage.setItem('rv-template',JSON.stringify(temp)); return result; } self.decode = function(code){ if(!temp[code]){return false;} var ary = code.replace(TemplateKey,'').split(''); for(var i in ary){ var loc = ary[i]; ary[i] = code_map_2[loc]; } return (ary.length>0) ? TemplateKey+ary.join('') : false; } self.getCode = function(){ var hash = location.hash.replace('#',''); var code = self.decode(hash); return code; } self.go = function(position, who){ if(!who) who=''; if(who == 'ej03xu3'){ location.href = self.ADMIN_ROOT+''+position; }else{ location.href = self.ROOT+''+position; } } self.reload = function(){ if(location.hash.length<=1){ location.reload(); }else{ $(window).trigger('hashchange'); } } self.ajaxPassenger = []; self.clearPassenger = function(){ var ab = API.ajaxPassenger.length-1; while(ab>=0){ var ajax = API.ajaxPassenger.splice(ab,1)[0].a; // ajax.then(function(){}); ajax.abort() && ajax==null; ab--; } return self; } $.ajaxSetup({ beforeSend:function(a,set){ // console.log(a); // console.log(set); var stamp = set.url + (typeof set.data=='string'?set.data:''); for(var i in self.ajaxPassenger){ var loc = self.ajaxPassenger[i].u; if(stamp==loc){ a.abort();return console.log('The URL Not Over [ '+loc+' ]'); } } self.ajaxPassenger.push({u:stamp,a:a}); }, complete:function(a,set){ for(var i in self.ajaxPassenger){ var loc = self.ajaxPassenger[i].a; if(loc==a){ // console.log(a); self.ajaxPassenger.splice(i,1);break; } } } }); var hook_data = {}, hook_pointer; self.hook = function(name, fn){ if(typeof self[name]!='function'){return console.log('Fail Hook Name : '+name);} if(!hook_data[name]){ hook_data[name] = [self[name]]; self[name] = function(){ hook_pointer = hook_data[name].length; // console.log(hook_data); var ret, p=0; do{ ret = (hook_data[name][ p ].apply(ret, arguments)) || ret; p++; }while(p\u8cb4\u55ae\u4f4d\u9928\u85cf\u516c\u64ad\u63a1\u8cfc\u9700\u6c42\u7684\u7d00\u9304\u7247\u3002","For Directors\/ Producers":"\u5c0e\u6f14 \/ \u88fd\u7247","For
Directors\/ Producers":"\u5c0e\u6f14 \/ \u88fd\u7247","We tailor-make distribution plans for your documentary works.":"\u70ba\u5c0e\u6f14\u3001\u88fd\u7247\u7684\u7d00\u9304\u7247\u4f5c\u54c1
\u91cf\u8eab\u5b9a\u505a<\/strong> \u767c\u884c\u8a08\u756b\u3002","For Subjects of Documentaries":"\u62cd\u651d\u5c0d\u8c61","We connect the public with our media to help share your stories in our documentaries.":"\u63d0\u4f9b\u62cd\u651d\u5c0d\u8c61\u5fd7\u696d\u5167\u5bb9\u7684\u7db2\u5740\u9023\u7d50\uff0c\u8b93\u5927\u773e\u652f\u6301\u3002","For Audiences":"\u89c0\u773e","We offer plenty of content for personal viewing or purchasing pleasure.":"\u63d0\u4f9b\u500b\u4eba\u770b\u7247\u6216\u8cfc\u8cb7\u7684\u7ba1\u9053\u3002","More than":"\u8d85\u904e","audiences, come to Spot-link Cinema.":"\u4f4d\u89c0\u773e\uff0c\u4f86\u5230\u6211\u5011\u7684\u6620\u5834","Spot-link Cinema is a space for people to better understand the world and themselves by joining together to communicate with and care for each other.":"\u6211\u5011\u5e0c\u671b\u85c9\u7531\u6620\u5834\u8b93\u66f4\u591a\u4eba\u6210\u70ba\u7a2e\u7c7d\uff0c\u767c\u63ee\u597d\u7684\u5f71\u97ff\u529b\u3002","Recent Content":"\u65b0\u9bae\u4e0a\u67b6","All":"\u5168\u90e8","Proving the power of documentaries through quality and sincerity.":"\u8173\u8e0f\u5be6\u5730\u3001\u8cea\u91cf\u517c\u5177\u7684\u767c\u63ee\u300c\u6620\u5834\u300d\u5f71\u97ff\u529b","Happy Hosts":"\u5feb\u6a02\u7684\u4e3b\u8fa6\u55ae\u4f4d","Total Screenings":"\u5b8c\u6210\u7684\u8b1b\u5ea7","Total Attendees":"\u53c3\u8207\u7684\u89c0\u773e","People Featured in Documentaries":"\u88ab\u651d\u8005\u5011","We\u2019d love to hear from you!":"\u6211\u5011\u5728\u9019\u88e1\u50be\u807d\uff01","Your Name":"\u4f60\u7684\u540d\u5b57","Phone number":"\u9023\u7d61\u96fb\u8a71","You want to tell us...":"\u60f3\u544a\u8a34\u6211\u5011...","Send":"\u9001\u51fa","Please select another category.":"\u8acb\u9078\u64c7\u5176\u4ed6\u985e\u5225\u89c0\u770b","We believe the stories featured in Spot-link Cinema reflect the joys and processes of growth in life.":"\u6211\u5011\u76f8\u4fe1\u6620\u5834\u767c\u751f\u7684\u662f\u4e00\u500b\u500b\u751f\u547d\u7684\u6536\u7a6b\u548c\u6210\u9577","Extensions":"\u89f8<\/span> \u89d2\u5ef6\u4f38","Winning":"\u5f97 \u734e<\/span> \u7d00\u9304","Video":"\u5f71\u7247\u8cc7\u6599","Length":"\u7247\u9577","Year":"\u5e74\u4efd","Display":"\u986f\u793a","Language":"\u8a9e\u8a00","Subtitles":"\u5b57\u5e55","Video Format":"\u5f71\u7247\u683c\u5f0f","Movie Type":"\u5f71\u7247\u985e\u578b","minutes":"\u5206\u9418","Director":"\u5c0e\u6f14","Producer":"\u88fd\u7247","Production Company":"\u51fa\u54c1\u55ae\u4f4d","Stills":"\u5287\u7167","Spark, Inspire, Stimulate, Act.":"\u7526\u9192\u71b1\u60c5\u3001\u5553\u767c\u77e5\u8b58\u3001\u6fc0\u76ea\u89c0\u5ff5\u3001\u5c55\u958b\u884c\u52d5","Recent News":"\u65b0\u9bae\u653e\u6620","UPCOMING EVENTS":"\u5373\u5c07\u5230\u4f86","Ordered By Date":"\u4f9d\u65e5\u671f\u6392","Ordered By Title":"\u4f9d\u6a19\u984c\u6392","Learn more":"\u77ad\u89e3\u8a73\u7d30","Session":"\u5834\u6b21","Time":"\u6642\u9593","Venue":"\u5834\u9928","Address":"\u5730\u5740","Buy tickets":"\u524d\u5f80\u5831\u540d","Choose your love and then love your choice.":"\u9078\u64c7\u4f60\u6240\u611b\u7684\uff0c\u611b\u4f60\u6240\u9078\u64c7\u7684","Desciption":"\u5546\u54c1\u4ecb\u7d39","Proceed to Checkout":"\u524d\u5f80\u7d50\u5e33","The wonderful, the joyful, and the heartwarming can happen in Spot-link Cinema.":"\u95dc\u65bc\u6211\u5011\u7684\u7cbe\u5f69\u3001\u559c\u6085\u8207\u611f\u52d5","Documentaries lead us to understand ourselves and the world more deeply than ever.":"\u4eba\u7684\u7522\u696d\u3001\u9748\u9b42\u7684\u5de5\u7a0b","Spot-link Cinema brings people together to better understand ourselves and the world through documentary screenings and post-screening discussions.":"\u300c\u5b62\u5b50\u56ca\u96fb\u5f71\u9662\u300d\u662f\u4e00\u9805\u95dc\u65bc\u4eba\u7684\u7522\u696d\u3001\u9748\u9b42\u7684\u5de5\u7a0b\u3002","The thoughts built, acquired, or enlightened through Spot-link Cinema spark actions that improve lives.":"\u5b62\u5b50\u56ca\u662f\u6620\u5834\u7684\u610f\u8c61\uff0c\u900f\u904e\u7d00\u9304\u7247\u3001\u900f\u904e\u6f14\u8b1b\uff0c\u4ea4\u6d41\u4e86\u9748\u9b42\u5c0d\u751f\u547d\u548c\u4e16\u754c\u7684\u63a2\u7d22\uff0c\u64f4\u5c55\u4e86\u95dc\u5fc3\u548c\u77ad\u89e3\uff0c\u6bcf\u500b\u9748\u9b42\u7684\u4e16\u754c\u56e0\u6b64\u66f4\u907c\u95ca\u3001\u4e92\u76f8\u7684\u4ea4\u96c6\u66f4\u5ee3\u5927\u800c\u7dca\u5bc6\u3002\u601d\u7dad\u6539\u8b8a\u3001\u884c\u52d5\u6539\u8b8a\uff0c\u66f4\u7f8e\u597d\u7684\u660e\u65e5\u9ede\u6ef4\u5275\u9020\u4e2d\u3002","Spot-link\u2019s vision for cinemas is based on the concept of the sporangium.":"\u300c\u5b62\u5b50\u56ca\u300d\u662f\u6620\u5834\u7684\u610f\u8c61","A sporangium, which produces biological tissues called spores, is a warm and dark space, just like a cinema. Though spores can reproduce and spread even in harsh environments, favorable conditions allow them to transform into a new organism. Similarly, we want audiences to become inspired within cinemas and leave as new individuals.":"\u300c\u5b62\u5b50\u300d\u662f\u4e00\u7a2e\u6709\u7e41\u6b96\u80fd\u529b\u7684\u751f\u7269\u7d44\u7e54\uff0c\u4e26\u4e14\u5177\u6709\u4f11\u7720\u4f5c\u7528\uff0c\u80fd\u5728\u60e1\u52a3\u7684\u74b0\u5883\u4e0b\u4fdd\u6301\u81ea\u6709\u7684\u50b3\u64ad\u80fd\u529b\uff0c\u7576\u6709\u5229\u689d\u4ef6\u7522\u751f\u6642\uff0c\u518d\u76f4\u63a5\u767c\u80b2\u6210\u70ba\u65b0\u500b\u9ad4\uff0c\u50b3\u905e\u672a\u4f86\u751f\u547d\u3002","Spot-link Cinema uses documentaries to tell life stories that can spread inspiration. Through the powerful sincerity of documentaries and discussions, people can become inspired to change or act for a better future.":"\u300c\u5b62\u5b50\u56ca\u96fb\u5f71\u9662\u300d\u900f\u904e\u5404\u5f0f\u4eba\u7fa4\u96c6\u805a\u7684\u751f\u6d3b\u5834\u666f\uff0c\u900f\u904e\u300c\u7d00\u5be6\u96fb\u5f71\u300d\uff0c\u6fc0\u76ea\u65e5\u5e38\u5bc2\u975c\u7684\u300c\u5b62\u5b50\u300d\uff0c\u5728\u7d00\u5be6\u96fb\u5f71\u7684\u8aa0\u646f\u5f71\u50cf\u529b\u91cf\u4e2d\uff0c\u7526\u9192\u71b1\u60c5\uff0c\u5553\u767c\u89c0\u5ff5\uff0c\u589e\u9032\u667a\u8b58\uff0c\u5c55\u958b\u884c\u52d5\uff0c\u7121\u9650\u5275\u9020\u3002","Spot-link Cinema is a face-to-face distribution channel for documentaries.":"\u300c\u5b62\u5b50\u56ca\u300d\u662f\u7d00\u9304\u7247\u9762\u5c0d\u9762\u7684\u767c\u884c\u7ba1\u9053\u3002","The documentary industry developed by generally relying on television stations as a means of funding and broadcasting. Despite Taiwan having an especially limited number of TV stations willing to broadcast documentaries, other aspects of the industry have still managed to grow.":"\u7d00\u9304\u7247\u7522\u696d\u7684\u767c\u5c55\uff0c\u4e00\u822c\u662f\u4ee5\u96fb\u8996\u53f0\u70ba\u4e3b\u8981\u51fa\u8cc7\u6a5f\u69cb\u548c\u64ad\u6620\u7ba1\u9053\u3002\u53f0\u7063\u7684\u7d00\u9304\u7247\u7522\u696d\u74b0\u5883\uff0c\u76f8\u8f03\u8207\u5176\u4ed6\u570b\u5bb6\uff0c\u653e\u6620\u7d00\u9304\u7247\u7684\u96fb\u8996\u53f0\u975e\u5e38\u6709\u9650\uff0c\u537b\u4e5f\u56e0\u6b64\u5275\u9020\u4e86\u53f0\u7063\u7d00\u9304\u7247\u53e6\u985e\u7684\u7522\u696d\u767c\u5c55\u3002","As such, there are plenty of quality filmmakers and quality documentaries in Taiwan, but a continuous lack of quality broadcasting and distribution channels. Opportunities for screening are scattered and unorganized, while television channels only broadcast once a week.":"\u53f0\u7063\u6709\u8a31\u591a\u52aa\u529b\u4e0d\u61c8\u7684\u7d00\u9304\u7247\u5de5\u4f5c\u8005\uff0c\u597d\u7684\u7d00\u9304\u7247\u4e0d\u7f3a\uff0c\u597d\u7684\u64ad\u6620\u548c\u767c\u884c\u7ba1\u9053\u537b\u5341\u5206\u77ed\u7f3a\uff0c\u96fb\u8996\u983b\u9053\u53ea\u6709\u4e00\u5468\u4e00\u6b21\uff0c\u5176\u4ed6\u653e\u6620\u5834\u5408\uff0c\u975e\u5e38\u5206\u6563\u800c\u4e0d\u6b63\u5f0f\u3002","Spot-link Cinema wants to use its concept of the sporangium\u2014of multiplying ideas\u2014as a model for the documentary industry. By reaching schools, caf\u00e9s, businesses, and other groups by word of mouth, we can pass on the messages found within documentaries and overall fulfill the social responsibility of these films: to \u201cSpark Enthusiasm, Inspire Ideas, Stimulate Minds, and Compel Actions.\u201d":"\u56e0\u6b64\u6211\u5011\u7528\u300c\u5b62\u5b50\u56ca\u96fb\u5f71\u9662\u300d\u4f86\u70ba\u7d00\u9304\u7247\u653e\u6620\u627e\u5230\u7522\u696d\u578b\u614b\uff0c\u8d70\u9032\u5b78\u6821\u3001\u5496\u5561\u9928\u3001\u4f01\u696d\u3001\u5404\u5f0f\u5718\u9ad4\u7b49\uff0c\u4ee5\u53e3\u8033\u76f8\u50b3\u7684\u65b9\u5f0f\uff0c\u5c07\u7d00\u9304\u7247\u5de5\u4f5c\u8005\u60f3\u900f\u904e\u7d00\u9304\u7247\u50b3\u9054\u7684\u7406\u5ff5\u50b3\u905e\u51fa\u53bb\uff0c\u505a\u5230\u7d00\u9304\u7247\u7684\u793e\u6703\u8cac\u4efb\u2014\u300c\u7526\u9192\u71b1\u60c5\u3001\u5553\u767c\u77e5\u8b58\u3001\u6fc0\u76ea\u89c0\u5ff5\u3001\u5c55\u958b\u884c\u52d5\u300d\u3002","Our Services<\/span>":"\u6211\u5011\u7684 \u670d\u52d9<\/span>","We provide what you<\/span> need. Together, we can spread inspiration<\/span>!":"\u7d66 \u4f60<\/span> \u6240\u9700\uff0c\u4e00\u8d77\u50b3\u64ad \u71b1\u60c5<\/span> \uff01","Hosts":"\u4e3b\u8fa6\u65b9","Contact":"\u53f0\u7063\u5730\u5340\u6d3d\u8a62\u96fb\u8a71","Contact (for hosts outside Taiwan)\uff1a":"\u6d77\u5916\u5730\u5340\u6d3d\u8a62\u7ba1\u9053\uff1a\u5b62\u5b50\u56ca\u79c1\u8a0a\u3001","For Hosts Outside Taiwan":"\u6d77\u5916\u5730\u5340\u8209\u8fa6\u65b9\u5f0f","Web-link for Screening and Online Q&A":"\u7dda\u4e0a\u64ad\u653e\uff0b\u8996\u8a0aQ & A","Theater\/Festival Screening + Director\/Producer Post-Screening Discussion In-Person":"\u6232\u9662\u6216\u5f71\u5c55\u898f\u683c\u653e\u6620\uff0b\u6620\u5f8c\u8b1b\u8005\u5230\u73fe\u5834","Other Services":"\u670d\u52d9\u9805\u76ee","We can design event concepts, handle invitations, arrange venues, manage promotions, record event videos, develop satisfaction surveys, and publish promotional web-pages.":"\u4e3b\u984c\u7b56\u5283\u3001\u9080\u7247\u57f7\u884c\u3001\u5834\u5730\u5b89\u6392\u3001\u5ba3\u50b3
\u6d3b\u52d5\u5f71\u50cf\u7d00\u9304\u3001\u6eff\u610f\u5ea6\u8abf\u67e5\u3001\u7db2\u9801\u5c08\u9801\u6210\u679c\u767c\u8868\u3002","Under Spot-link Cinema, we awaken our souls to live, communicate, and understand through documentaries.":"\u900f\u904e\u5404\u5f0f\u4eba\u7fa4\u96c6\u805a\u7684\u751f\u6d3b\u5834\u666f\uff0c
\u900f\u904e\u300c\u7d00\u5be6\u96fb\u5f71\u300d\uff0c
\u6fc0\u76ea\u65e5\u5e38\u5bc2\u975c\u7684\u300c\u5b62\u5b50\u300d\u3002","In their powerful portrayal of truth, documentaries can spark our enthusiasm, inspire ideas, stimulate our minds, compel us to act, and drive unlimited creativity.":"\u5728\u7d00\u5be6\u96fb\u5f71\u7684\u8aa0\u646f\u5f71\u50cf\u529b\u91cf\u4e2d\uff0c
\u7526\u9192\u71b1\u60c5\uff0c\u5553\u767c\u89c0\u5ff5\uff0c\u589e\u9032\u667a\u8b58\uff0c\u5c55\u958b\u884c\u52d5\uff0c\u7121\u9650\u5275\u9020\u3002","WE ARE HERE":"\u6211\u5011\u5728\u9019\u88e1","Come find us !":"\u4f86\u627e\u6211\u5011\u5427\uff01","in a small island country":"\u6211\u5011\u4f86\u81ea\u5c0f\u6d77\u5cf6\u570b\u5bb6","TAIWAN":"\u53f0\u7063","KEEP IN TOUCH":"\u8207\u6211\u5011\u4fdd\u6301\u9023\u7e6b","Subscribe to Our Newsletter to get Important News & Offers":"\u8a02\u95b1\u6211\u5011\u7684\u96fb\u5b50\u5831\uff0c\u4f86\u53d6\u5f97\u6700\u65b0\u8cc7\u8a0a\u548c\u512a\u60e0","Enter your Email":"\u8f38\u5165\u4f60\u7684\u96fb\u5b50\u90f5\u4ef6","Subscribe":"\u8a02\u95b1","All Rights Reserved,":"\u7248\u6b0a\u6240\u6709\uff0c","Terms & Conditions":"\u670d\u52d9\u689d\u6b3e","Privacy":"\u96b1\u79c1\u653f\u7b56","Website design, ":"\u7db2\u7ad9\u7dad\u8b77\u8207\u88fd\u4f5c\uff0c","CarCode.":"\u5361\u5361\u8a2d\u8a08\u5de5\u574a","The following fields must be filled in: ":"\u4ee5\u4e0b\u6b04\u4f4d\u5fc5\u9808\u586b\u5beb\uff1a","Missing required parameters":"\u7f3a\u5c11\u5fc5\u8981\u53c3\u6578","No data.":"\u6c92\u6709\u8cc7\u6599","You do bad things.":"\u4f60\u4e82\u4e82\u4f86","Read More":"\u66f4\u591a","admin_login":"\u767b\u5165 Login","login":"\u767b\u5165","account":"\u5e33\u865f Account","password":"\u5bc6\u78bc Password","account_remark":"\u8acb\u8f38\u5165\u4f60\u7684\u5e33\u865f","password_remark":"\u6211\u5011\u4e4b\u9593\u7684\u79d8\u5bc6\uff0c\u795e\u99ac\u4eba\u90fd\u4e0d\u80fd\u77e5\u9053","password_error":"\u6211\u5011\u7684\u79d8\u5bc6\u90fd\u80fd\u5fd8\u8a18\uff0c\u6211\u4e5f\u662f\u9189\u4e86...","who_are_you":"\u9006 4 \u96a8 !!"}}; var get = self.get = function(key, file='common'){ var str = ''; if(key && data[file][key]){ str+= data[file][key]; }else{ str='[[]]'; } return str; } w.i18 = get; return self; })(window.LANG||{}, window, jQuery); function setting(s){ var dm = s.developMode = true; s.when = $.when.all = function(deferreds){ var deferred = new $.Deferred(); $.when.apply($, deferreds).then( function(){ deferred.resolve(Array.prototype.slice.call(arguments)); }, function(){ deferred.fail(Array.prototype.slice.call(arguments)); }); return deferred; } var cache_data, cache_key = 'HR_API_CACHE'; s.cache = function(key,val){ if(!window.localStorage){return null;} if(val){//set cache_data[key] = val; var time = new Date().getTime(); cache_data.update_time = time; localStorage.setItem(cache_key, JSON.stringify(cache_data) ); }else{//get return cache_data[key]; }return this; } try{ cache_data= localStorage.getItem(cache_key); cache_data= JSON.parse(cache_data) || {}; if((cache_data.update_time + (1000*60*30)) < new Date().getTime()){ throw ''; } }catch(e){console.log(e);cache_data={};s.cache('update_time',1);} s.create={ year : 2017, month : 4, day : 20 } } function grenalJSONFormat(json){ switch(typeof json){ case "undefined": json={}; break; case "string": try{ json = JSON.parse(json); }catch(e){ json = {}; } break; case "function": try{ json = json.apply(this); }catch(e){ json = {}; } break; case "default": } var contain = { result : json.result, status : json.status, msg : json.msg } var successCode = 200; if(typeof contain.status==="undefined"){ contain.status = 0; contain.msg = "Error, Format Not Match."; contain.result = null; } if(Object.defineProperty){ Object.defineProperty(this,"is",{ value:contain.status==successCode, writable:false, configurable:false }); }else{ this.is = contain.status==successCode; } this.get = function(param){ var res; switch(param){ case "msg": res=contain.msg; break; case "status": res=contain.status; break; default: if(contain.status!=successCode){ res=contain.msg; }else if(contain.result){ if(contain.result.length == 1 && contain.result[0]){ res=contain.result[0]; }else{ res=contain.result; } } } return res; } this.res = function(){ if(!this.is){ console.log(this); } return contain.result; } this.set = function(data){ contain.result = data; } var maps; this.map = function(){ if(!maps){ maps={}; for(var i in contain.result){ var loc = contain.result[i]; if(loc.id){maps[loc.id]=loc;}else{break;} } } return maps; } } var locale = {}; function Lang(key) { var split = key.split('.'); var model = split[0]; var item = (split[1]) ? split[1] : null; if (locale.model === undefined) { var url = Site_Root+'/Lang/tw/'+model+'.json'; $.ajax({ url: url, dataType: 'json', async: false, success: function(json){ locale.model =json; } }); } if (item) { return (locale.model[item]) ? locale.model[item] : item; } else { return locale.model; } } function test100(cbFn){ var time1 = new Date(); for(var i = 0; i <= 10000;i++){ cbFn(); } var time2 = new Date(); return time2 - time1; } function clone(inn){ var newi; if(Array.isArray(inn)){ newi = inn.slice(); }else{ newi = JSON.parse( JSON.stringify(inn)); } return newi; } //cookie (function (factory) { factory(jQuery); }(function ($) { var pluses = /\+/g; function encode(s) { return config.raw ? s : encodeURIComponent(s); } function decode(s) { return config.raw ? s : decodeURIComponent(s); } function stringifyCookieValue(value) { return encode(config.json ? JSON.stringify(value) : String(value)); } function parseCookieValue(s) { if (s.indexOf('"') === 0) { s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); } try { s = decodeURIComponent(s.replace(pluses, ' ')); return config.json ? JSON.parse(s) : s; } catch(e) {} } function read(s, converter) { var value = config.raw ? s : parseCookieValue(s); return $.isFunction(converter) ? converter(value) : value; } var config = $.cookie = function (key, value, options) { if (value !== undefined && !$.isFunction(value)) { options = $.extend({}, config.defaults, options); if (typeof options.expires === 'number') { var days = options.expires, t = options.expires = new Date(); t.setTime(+t + days * 864e+5); } return (document.cookie = [ encode(key), '=', stringifyCookieValue(value), options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE options.path ? '; path=' + options.path : '', options.domain ? '; domain=' + options.domain : '', options.secure ? '; secure' : '' ].join('')); } var result = key ? undefined : {}; var cookies = document.cookie ? document.cookie.split('; ') : []; for (var i = 0, l = cookies.length; i < l; i++) { var parts = cookies[i].split('='); var name = decode(parts.shift()); var cookie = parts.join('='); if (key && key === name) { result = read(cookie, value); break; } if (!key && (cookie = read(cookie)) !== undefined) { result[name] = cookie; } } return result; }; config.defaults = {}; $.removeCookie = function (key, options) { if ($.cookie(key) === undefined) { return false; } $.cookie(key, '', $.extend({}, options, { expires: -1 })); return !$.cookie(key); }; var current = { year : $.cookie('rv-kpi-year') || new Date().getFullYear(), month : $.cookie('rv-kpi-month') || new Date().getMonth() + 1 } $.ym = { get : function(){ return current; }, save : function(ym){ if(ym){ if(ym.year){current.year=ym.year;} if(ym.month){current.month=ym.month;} } $.cookie('rv-kpi-year',current.year); $.cookie('rv-kpi-month',current.month); }, reset : function(){ current.year = new Date().getFullYear(); current.month = new Date().getMonth() + 1; } } })); if(!$.fn.TableScrollbarY){ $.fn.TableScrollbarY = function(options){ var set = $.extend({ height : 500, rang : 8 },options); var $$ = this, innerTR = $$.q('tbody').length==0 ? $$.q('tr') : $$.q('tbody tr'), count = innerTR.length; return this; }; }