1/* script.js for BiND7 2 - Setting global variables - These variables are used in other scripts as well. 3 - Selecting js files to be loaded - For app use. 4 151109 5--------------------------------------------------------- */ 6////////// global variables 7var PRTCL = document.location.protocol; 8if (PRTCL == 'file:') PRTCL = 'http:'; 9 10// for FREESPACE 11var fsURL = PRTCL + '//module.bindsite.jp/'; 12var fsModule = '_module151109-2200_bd8'; 13 14var SYNC_SVR = PRTCL + '//sync5-res.digitalstage.jp/'; 15 16// bindobj 17var bindobj = new Object(); 18 19// BiNDCLD or BiNDPKG 20bindobj.isCloud = false; 21var bindAry = ['localhost' 22 ,'edit.bindcloud.jp' 23 ,'edit2.bindcloud.jp' 24 ,'edit.blks.jp' 25 ,'hgkmng.bindcloud.jp' 26 ,'at.bindcloud.jp' 27 ,"bizmw-hp.jp" 28 ,"temp.bindcloud.jp" 29 ,'demo.bindcloud.jp' 30 ]; 31for (var i = 0; i<bindAry.length; i++) { 32 if (window.location.hostname.indexOf(bindAry[i]) > -1) { 33 bindobj.isCloud = true; 34 break; 35 } 36} 37 38bindobj.isCloudEditer = (bindobj.isCloud && window.frameElement && window.frameElement.id=='preview-area') ? true : false; 39 40bindobj.ua = navigator.userAgent.toLowerCase(); 41bindobj.win = bindobj.ua.indexOf('windows')>-1 || bindobj.ua.indexOf('win32')>-1 ? true : false; 42bindobj.win7 = bindobj.win && bindobj.ua.indexOf('nt 6.1')>-1 ? true : false; 43bindobj.vista = bindobj.win && bindobj.ua.indexOf('nt 6.0')>-1 ? true : false; 44bindobj.xp = bindobj.win && (bindobj.ua.indexOf('nt 5.1')>-1 || bindobj.ua.indexOf('windows xp')>0) ? true : false; 45bindobj.mac = bindobj.ua.indexOf('macintosh')>-1 || bindobj.ua.indexOf('mac_power')>-1 ? true : false; 46bindobj.opr = bindobj.ua.indexOf('opera')>-1 ? true : false; 47bindobj.ie = (bindobj.ua.indexOf('msie')>-1 || bindobj.ua.indexOf('trident')>-1) && !bindobj.opr ? true : false; 48bindobj.ffx = bindobj.ua.indexOf('firefox')>0 ? true : false; 49bindobj.chr = bindobj.ua.indexOf('chrome/')>0 ? true : false; 50bindobj.ie110 = bindobj.ua.indexOf('trident/7')>0 && !bindobj.opr ? true : false; 51bindobj.ie100 = bindobj.ua.indexOf('msie 10')>0 && !bindobj.opr ? true : false; 52bindobj.ie90 = bindobj.ua.indexOf('msie 9')>0 && !bindobj.opr ? true : false; 53bindobj.ie80 = bindobj.ua.indexOf('msie 8')>0 && !bindobj.opr ? true : false; 54bindobj.ie70 = bindobj.ua.indexOf('msie 7')>0 && !bindobj.opr ? true : false; 55bindobj.ie60 = bindobj.ua.indexOf('msie 6.0')>0 && !bindobj.opr && bindobj.ua.indexOf('safari')<0 ? true : false; 56bindobj.ie55 = bindobj.ua.indexOf('msie 5')>0 && !bindobj.opr ? true : false; 57bindobj.ie52 = bindobj.ua.indexOf('msie 5')>0 && bindobj.mac ? true : false; 58bindobj.ie40 = bindobj.ua.indexOf('msie 4')>0 ? true : false;
59bindobj.wff = bindobj.ffx && bindobj.win ? true : false; 60bindobj.mff = bindobj.ffx && bindobj.mac ? true : false; 61bindobj.ff1 = bindobj.ua.indexOf('firefox/1.0')>0 ? true : false; 62bindobj.sf1 = bindobj.ua.indexOf('safari/85')>0 ? true : false; 63bindobj.sf = (bindobj.ua.indexOf('safari')>0); 64bindobj.msf = (bindobj.sf || bindobj.ua.indexOf('applewebkit')>0) && bindobj.mac ? true : false; 65bindobj.wsf = bindobj.sf && bindobj.win ? true : false; 66bindobj.op8 = bindobj.ua.indexOf('opera/8')>0 || bindobj.ua.indexOf('opera 8')>0 ? true : false; 67bindobj.op7 = bindobj.ua.indexOf('opera/7')>0 || bindobj.ua.indexOf('opera 7')>0 ? true : false; 68bindobj.op6 = bindobj.ua.indexOf('opera 6')>0 ? true : false; 69bindobj.ns7 = bindobj.ua.indexOf('netscape/7')>0 ? true : false; 70bindobj.ns6 = bindobj.ua.indexOf('netscape6')>0 ? true : false; 71bindobj.ipad = (bindobj.ua.indexOf('ipad')>0 && bindobj.ua.indexOf('safari')>0) ? true : false; 72bindobj.iphone = (bindobj.ua.indexOf('iphone')>0 && bindobj.ua.indexOf('safari')>0) ? true : false; 73bindobj.android = bindobj.ua.indexOf('android')>0 ? true:false; 74bindobj.isMobileOS = (bindobj.ipad || bindobj.iphone || bindobj.android); 75 76bindobj.printstate = window.location.search.indexOf('printstate=true')>-1 ? true : false; 77bindobj.disablecss = function() { 78 document.getElementById('theme-css').disabled = true; 79 document.getElementById('page-css').disabled = true; 80}; 81bindobj.isLegacy = false; 82bindobj.isLocal = false; 83if ((document.URL.indexOf('file://')==0 || bindobj.isCloud) && location.search.indexOf('bindapp=1')>-1) bindobj.isLocal = true; 84bindobj.level = ''; 85bindobj.textsize = ''; 86bindobj.theme = ''; 87bindobj.font = ''; 88bindobj.fontsize = ''; 89bindobj.rs = 0; 90bindobj.wf = 0; 91//***sato modified 090626 92bindobj.cornerskin = ''; 93bindobj.siteroot = ''; 94bindobj.moduleroot = ''; 95 96param = document.getElementById('script-js').src.replace(/^.*\?(.*)$/g,'$1'); 97param = param.split(','); 98for (i=0;i<param.length;i++) { 99 kv = param[i].split('='); 100 id = kv[0]; 101 val = kv[1]; 102 if (id=='l') eval('bindobj.level = ' + val); 103 if (id=='s') eval('bindobj.textsize = ' + val); 104 if (id=='t') eval('bindobj.theme = "' + val + '"'); 105 if (id=='f') eval('bindobj.font = "' + val + '"'); 106 if (id=='fs') eval('bindobj.fontsize = "' + val + '"'); 107 if (id=='rs') eval('bindobj.rs = ' + val); 108 if (id=='wf') eval('bindobj.wf = ' + val); 109//***sato modified 090626 110 if (id=='c') eval('bindobj.cornerskin = "' + val + '"'); 111} 112 113// for BiND4WP 114var pagecss = document.getElementById('page-css').href; 115if (pagecss.indexOf('/wp-content/themes/BiND6Theme/') > -1) { 116 var pagecssPos = pagecss.indexOf('/BiND6Theme/') + 12; 117 bindobj.siteroot = pagecss.substring(0, pagecssPos); 118} else { 119 for (i=0;i<bindobj.level;i++) bindobj.siteroot += '../'; 120} 121 122bindobj.dir = ''; 123var moduleDir = '_module'; 124if (bindobj.rs == 0) { 125 bindobj.dir = bindobj.siteroot; 126} else { 127 bindobj.dir = fsURL; 128 moduleDir = fsModule; 129} 130 131//for BiND4WPâ¡ 132var page_css = document.getElementById('page-css'); 133var wp_folder = 'wp-content/themes/BiND%20for%20WordPress/'; 134 135if ((page_css.href).indexOf(wp_folder) != -1) { 136 bindobj.siteroot = document.baseURI + wp_folder; 137 bindobj.dir = bindobj.siteroot; 138 moduleDir = '_module'; 139} 140 141bindobj.moduleroot = bindobj.dir + moduleDir; 142 143bindobj.isJQueryMobile = (bindobj.theme=="jquerymobile"); 144 145/* include view.js start */ 146/* view.js 147 - Browser Optimization 148 - Print setting - Checking if the page is for print. 149 - Legacy browser view - Setting for IE5.5, IE5.2, Netscape 6, Netscape 7, Opera 8, Safari 1.03. 150 Cuts the theme style off from default setting. 151--------------------------------------------------------- */ 152var optionscss = document.getElementById('options-css') ? true : false; 153 154////////// browser optimization 155////////// legacy browser view 156if (bindobj.ie52 || bindobj.ie55 || bindobj.ns7 || bindobj.ff1 || bindobj.op8) { 157 bindobj.disablecss(); 158 bindobj.isLegacy = true; 159 ///// options 160 if (optionscss) document.getElementById('options-css').href = bindobj.moduleroot + '/layout/legacy.css';
161 else document.write('<link rel="stylesheet" type="text/css" href="' + bindobj.moduleroot + '/layout/legacy.css" />'); 162 163////////// modern browser view 164} else { 165 var optcss = bindobj.moduleroot + '/layout/'; 166//*** 090626 modified 167 if (bindobj.cornerskin) optcss = bindobj.siteroot + '_cnskin/' + bindobj.cornerskin + '/css/'; 168 169 if (bindobj.ie70) { 170 if (bindobj.win7 || bindobj.vista) optcss += '_ie7v.css'; 171 else optcss += '_ie7x.css'; 172 } 173 else if (bindobj.ie80) { 174 if (bindobj.win7 || bindobj.vista) optcss += '_ie8v.css'; 175 else optcss += '_ie8x.css'; 176 } 177//*** 090825 modified 178 else if (bindobj.ie60) { 179 optcss += '_ie6.css'; 180 if (bindobj.cornerskin) document.write('<link rel="stylesheet" type="text/css" href="' + bindobj.moduleroot + '/layout/cnskin-ie6.css" />'); 181 } 182 else if (bindobj.msf) optcss += '_msf.css'; 183 else if (bindobj.mff) optcss += '_mff.css'; 184 else if (bindobj.wff || bindobj.ie80) { 185 if (bindobj.win7 || bindobj.vista) optcss += '_wffv.css'; 186 else optcss += '_wffx.css'; 187 } 188 else if (bindobj.chr) optcss += '_chr.css'; 189 else if (bindobj.mac) optcss += '_mac.css'; 190 else optcss += '_else.css'; 191 if (optionscss) document.getElementById('options-css').href = optcss; 192 else addCSS(optcss); 193 194 ///// overwrite.css on BiNDServer 195 if (bindobj.rs == 1) { 196 addCSS(bindobj.moduleroot + '/layout/overwrite.css'); 197 } 198 199 ///// bindicon 200 addCSS(bindobj.moduleroot + '/bindicon/style.css'); 201 202 ///// font 203 if (bindobj.font != '' && bindobj.fontsize != '') { 204 205 ///// directory 206 var fcss = bindobj.moduleroot + '/layout/font/'; 207 switch (bindobj.font) { 208 case 'm': fcss += 'mincho/'; break; 209 case 'g': fcss += 'gothic/'; break; 210 } 211 switch (bindobj.fontsize) { 212 case 'l': fcss += 'l/'; break; 213 case 'm': fcss += 'm/'; break; 214 case 's': fcss += 's/'; break; 215 } 216 217 ///// filename 218 if (bindobj.ie70) { 219 if (bindobj.win7 || bindobj.vista) fcss += '_ie7v.css'; 220 else fcss += '_ie7x.css'; 221 } 222//*** 090825 modified 223 else if (bindobj.ie60) { 224 optcss += '_ie6.css';
225 if (bindobj.cornerskin) document.write('<link rel="stylesheet" type="text/css" href="' + bindobj.moduleroot + '/layout/cnskin-ie6.css" />'); 226 } 227 else if (bindobj.msf) fcss += '_msf.css'; 228 else if (bindobj.mff) fcss += '_mff.css'; 229 else if (bindobj.wff) { 230 if (bindobj.win7 || bindobj.vista) fcss += '_wffv.css'; 231 else fcss += '_wffx.css'; 232 } 233 else if (bindobj.mac) fcss += '_mac.css'; 234 else fcss += '_else.css'; 235 236 addCSS(fcss); 237 } 238} 239 240////////// print setting 241if (bindobj.printstate) { 242 bindobj.disablecss(); 243 startcss = '<style type="text/css"><!-- '; 244 endcss = ' --></style>'; 245 printcss = ''; 246 if (bindobj.ffx) printcss += startcss + '#area-print * { font-weight:normal !important;}' + endcss; 247 if (bindobj.ie60) printcss += '<link rel="stylesheet" type="text/css" href="' + bindobj.moduleroot + '/layout/printlayout-ie6.css" />'; 248 document.write(printcss); 249} 250 251function legacyCheck() { 252 if (bindobj.ns6 || bindobj.op7 || bindobj.op6) { 253 bindobj.disablecss(); 254 bindobj.isLegacy = true; 255 } 256 257 if (bindobj.ie52 || bindobj.ie40) { 258 bindobj.disablecss(); 259 bindobj.isLegacy = true; 260 pick = function(e) { 261 if (e.className.indexOf(' ')) { 262 cN = e.className.split(' '); 263 e.className = cN[0]; 264 } 265 }; 266 erace = function() { 267 divs = document.getElementsByTagName('div'); 268 for (i=0;i<divs.length;i++) pick(divs[i]); 269 }; 270 erace(); 271 } 272 273//*** 090825 added 274 if (bindobj.ie60 && bindobj.cornerskin) { 275 document.getElementById('area-header').style.background = "url(" + bindobj.moduleroot + "/layout/img/ie6.gif) no-repeat center top"; 276 document.getElementById('area-header').style.paddingTop = "30px"; 277 } 278} 279/* include view.js end */ 280 281function addCSS(csssrc) {
282 document.write('<link rel="stylesheet" type="text/css" href="' + csssrc + '" />'); 283} 284function addJS(src, id) { 285 document.write('<script type="text/javascript" src="' + src + '" charset="utf-8" id="' + id + '"></script>'); 286} 287 288////////// view port 289if (bindobj.isJQueryMobile) { 290 var mt = document.createElement('meta'); 291 mt.name = 'viewport'; mt.content = 'width=device-width, initial-scale=1'; 292 var h = document.getElementsByTagName('head')[0]; 293 h.appendChild(mt); 294} 295 296////////// load js files 297bindobj.js = new Array(); 298var pt = ['fontplus', 'script', 'accessor', 'webfont-pub.weblife.me']; 299if (!bindobj.ie52) { 300 bindobj.js = [ 301 ['jquery-1.8.3.min.js','jquery-js'],['jquery.easing.1.3.js','jquery-easing-js'],['head.load.min.js','head-js'], 302 ['movie.js','movie-js'],['parts.js','parts-js'],['fx.js','fx-js'] 303 ]; 304 if (bindobj.ie60) bindobj.js.push(['png.js','png-js']); ///for IE6 305 if (bindobj.isLocal) { 306 bindobj.js.push(['blockeditor/blockeditor.js','blockeditor-js']); ///Works only on local. 307 } 308 if (!bindobj.ie && bindobj.wf && (location.protocol=='file:' || bindobj.isCloud)) addJS(PRTCL+'//'+pt.reverse().join('/')+'.js?gBaf4X~siMM%3D&aa=1','wf'); 309 for (i=0;i<bindobj.js.length;i++) addJS(bindobj.moduleroot + '/js/' + bindobj.js[i][0], bindobj.js[i][1]); 310 311 // jQuery Mobile 312 if (bindobj.isJQueryMobile) { 313 addJS(bindobj.moduleroot + '/js/jqm-config.js', 'jqm-config'); 314 addJS(bindobj.moduleroot + '/js/jquery.mobile-1.2.0.min.js', 'jquery.mobile-js'); 315 addCSS(bindobj.moduleroot + '/js/photoswipe/photoswipe.css'); 316 addJS(bindobj.moduleroot + '/js/photoswipe/klass.min.js', 'klass-js'); 317 addJS(bindobj.moduleroot + '/js/photoswipe/code.photoswipe.jquery-3.0.5.min.js', 'photoswipe-js'); 318 } 319 320 // corner js 321 if (bindobj.cornerskin) addJS(bindobj.siteroot + '_cnskin/' + bindobj.cornerskin + '/js/override.js', 'override-js'); 322 323 // load js 324 addJS(bindobj.moduleroot + '/js/load.js', 'load-js'); 325 326} else { 327 legacyCheck(); 328 329} 330 331/* common.js 332 - Popup window control 333 HTML: onclick="popup(this.href,this.target,500,600,0,1);return false;" 334 Parameter order: url,target,width,height,scrollbars,resizable 335--------------------------------------------------------- */ 336////////// popup 337function popup(u,t,w,h,s,r) { 338 if (bindobj.isCloudEditer) return false; 339 var param = ''; 340 if (w>0) param += 'width=' + w + ','; 341 if (h>0) param += 'height=' + h + ','; 342 if (!t) t = '_blank'; 343 param += 'scrollbars=' + s + ',resizable=' + r; 344 var popwin = window.open(u,t,param); 345 popwin.focus(); 346}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.