PageSourceSearch

https://www.ricoh-imaging.co.jp/common/js/header-footer.js

js ricoh-imaging.co.jp collected 2026-10-02 02:55:29 UTC 11,697 bytes, 355 lines download raw bytes

1// JavaScript Document
2
3
4/* url() v1.7.6 - http://github.com/websanova/js-url */
5window.url=(function(){function b(c){return !isNaN(parseFloat(c))&&isFinite(c)}return function a(p,d){var c=d||window.location.toString();if(c.substring(0,2)==="//"){c="http:"+c}else{if(c.split("://").length===1){c="http://"+c}}d=c.split("/");var g={auth:""},o=d[2].split("@");if(o.length===1){o=o[0].split(":")}else{g.auth=o[0];o=o[1].split(":")}g.protocol=d[0],g.hostname=o[0],g.port=(o[1]||"80"),g.pathname="/"+d.slice(3,d.length).join("/").split("?")[0].split("#")[0];var e=g.pathname;if(e.split(".").length===1&&e[e.length-1]!=="/"){e+="/"}var k=g.hostname,l=k.split("."),m=e.split("/");if(!p){return c}else{if(p==="hostname"){return k}else{if(p==="domain"){return l.slice(-2).join(".")}else{if(p==="tld"){return l.slice(-1).join(".")}else{if(p==="sub"){return l.slice(0,l.length-2).join(".")}else{if(p==="port"){return g.port||"80"}else{if(p==="protocol"){return g.protocol.split(":")[0]}else{if(p==="auth"){return g.auth}else{if(p==="user"){return g.auth.split(":")[0]}else{if(p==="pass"){return g.auth.split(":")[1]||""}else{if(p==="path"){return e}else{if(p[0]==="."){p=p.substring(1);if(b(p)){p=parseInt(p);return l[p<0?l.length+p:p-1]||""}}else{if(b(p)){p=parseInt(p);return m[p<0?m.length-1+p:p]||""}else{if(p==="file"){return m.slice(-1)[0]}else{if(p==="filename"){return m.slice(-1)[0].split(".")[0]}else{if(p==="fileext"){return m.slice(-1)[0].split(".")[1]||""}else{if(p[0]==="?"||p[0]==="#"){var h=c,f=null;if(p[0]==="?"){h=(h.split("?")[1]||"").split("#")[0]}else{if(p[0]==="#"){h=(h.split("#")[1]||"")}}if(!p[1]){return h}p=p.substring(1);h=h.split("&");for(var j=0,n=h.length;j<n;j++){f=h[j].split("=");if(f[0]===p){return f[1]}}return null}}}}}}}}}}}}}}}}}return""}})();
6
7
8/*
9skOuterClick - A simple event-binder-plugin to handle click events of outside elements.
10Copyright (c) 2012 SUKOBUTO All rights reserved.
11*/
12
13(function(jQuery){
14
15	jQuery.fn.skOuterClick = function(method) {
16		var methods = {
17			init : function (handler) {
18				var inners = new Array();
19				if (arguments.length > 1) for (i = 1; i < arguments.length; i++) {
20					inners.push(arguments[i]);
21				}
22				return this.each(function() {
23					var self = jQuery(this);
24					var _this = this;
25					var isInner = false;
26					// Bind click event to suppress
27					function onInnerClick(e){
28						isInner = true;
29					};
30					self.click(onInnerClick);
31					for (var idx in inners) inners[idx].click(onInnerClick);
32					// Bind click elsewhere
33					jQuery(document).click(function(e){
34						if (!isInner) handler.call(_this, e);
35						else isInner = false;
36					});
37				});
38			}
39		};
40		if (methods[method]) {
41			return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
42		} else if (typeof method === 'function') {
43			return methods.init.apply(this, arguments);
44		} else {
45			jQuery.error('Method "' + method + '" does not exist in skOuterClick plugin!');
46		}
47	};
48})(jQuery);
49
50
51/**
52 * Flatten height same as the highest element for each row.
53 *
54 * Copyright (c) 2011 Hayato Takenaka
55 * Dual licensed under the MIT and GPL licenses:
56 * http://www.opensource.org/licenses/mit-license.php
57 * http://www.gnu.org/licenses/gpl.html
58 * @author: Hayato Takenaka (http://urin.take-uma.net)
59 * @version: 0.0.2
60**/
61(function(a){a.fn.tile=function(b){var c,d,e,f,g=this.length-1,h;if(!b)b=this.length;this.each(function(){h=this.style;if(h.removeProperty)h.removeProperty("height");else if(h.removeAttribute)h.removeAttribute("height")});return this.each(function(h){e=h%b;if(e==0)c=[];c[e]=a(this);f=c[e].height();if(e==0||f>d)d=f;if(h==g||e==b-1)a.each(c,function(){this.height(d)})})}})(jQuery)
62
63
64jQuery(function(){
65
66	/*-------------
67	Ga _trackEvent
68	--------------*/
69	jQuery("a[href^=http]").click(function(){
70		var url = jQuery(this).attr('href');
71			if( url.indexOf(location.hostname)<0){
72			_gaq.push(['_trackEvent','_blank','Click',url]);
73			}
74	});
75
76	/*-------------
77	Copyright year
78	--------------*/
79	function chgYear(){
80		var myDate=new Date();
81		var nowYear=myDate.getFullYear();
82		return nowYear;
83	}
84	jQuery("#rim-tpl-copyright span").text(chgYear());
85
86	/*-------------
87	Language change
88	--------------*/
89	function chgLang(){
90		var _lang=jQuery("#rim-tpl-langauge");
91
92		_lang.find(".rim-tpl-first > a").click(function(){
93			if(_lang.find("ul").hasClass("active")){
94				_lang.find("ul").removeClass("active");
95			}else{
96				_lang.find("ul").addClass("active");
97			}
98
99			return false;
100		});
101
102
103		/* close */
104		_lang.skOuterClick(function() {
105			_lang.find("ul").removeClass("active");
106		});
107		jQuery(window).scroll(function(){
108			_lang.find("ul").removeClass("active");
109		});
110
111	}
112	chgLang();
113
114
115
116	/*-------------
117	hover_opacity
118	--------------*/
119	jQuery(".hover_opacity").hover(function(){
120		jQuery(this)	.css("opacity","0.75");
121	},function(){
122		jQuery(this)	.css("opacity","1.00");
123	});
124
125
126	/*-------------
127	pulldown
128	--------------*/
129
130	//UA
131	var agent = navigator.userAgent;
132
133	//pulldown parent
134	var _pullDownBtn = $("#rim-tpl-categorynav > li > a");
135
136	function pullDown_open(_elem){
137		// _elemはボタンのa想定
138		_elem.attr('aria-expanded','true');
139		_elem.parent().addClass("active");
140		_elem.siblings(".rim-tpl-sub-box").addClass("active");
141		_elem.siblings(".rim-tpl-sub-box").removeAttr('hidden');
142		_elem.siblings(".rim-tpl-sub-others").addClass("active");
143		_elem.siblings(".rim-tpl-sub-others").removeAttr('hidden');
144
145		//inner img
146		_elem.parent().find("a").hover(function(){
147			$(this).find("img").css("opacity","0.75");
148		},function(){
149			$(this).find("img").css("opacity","1.00");
150		});
151
152		//#rim-tpl-categorynav .rim-tpl-sub-upper li a
153		setTimeout(function(){
154			$("#rim-tpl-categorynav .rim-tpl-sub-upper li a").tile();
155		},10);
156	}
157
158	function pullDown_close(_elem){
159		_elem.attr('aria-expanded','false');
160		_elem.parent().removeClass("active");
161		_elem.siblings(".rim-tpl-sub-box").removeClass("active");
162		_elem.siblings(".rim-tpl-sub-box").attr('hidden','true');
163		_elem.siblings(".rim-tpl-sub-others").removeClass("active");
164		_elem.siblings(".rim-tpl-sub-others").attr('hidden','true');
165	}
166
167	//SP and tablet
168	if(agent.search(/(iPhone)|(iPad)|(iPod)|(Android)|(SC-01C)|(BlackBerry)|(Symbian)|((IEMobile)|(Windows Phone))/) != -1){
169
170		// 二度押すと遷移する
171		_pullDownBtn.click(function(){
172			if($(this).hasClass("selected")){
173				location.href = $(this).attr("href");
174			}else{
175				// 一度全部リセット
176				_pullDownBtn.siblings(".rim-tpl-sub-box").removeClass("active");
177				_pullDownBtn.siblings(".rim-tpl-sub-others").removeClass("active");
178				_pullDownBtn.removeClass("selected");
179
180				// 押されたフラグ
181				$(this).addClass("selected");
182
183				// 開く
184				$(this).siblings('.rim-tpl-sub-box').addClass("active");
185				$(this).siblings('.rim-tpl-sub-others').addClass("active");
186
187				//#rim-tpl-categorynav .rim-tpl-sub-upper li a
188				setTimeout(function(){
189					$("#rim-tpl-categorynav .rim-tpl-sub-upper li a").tile();
190				},10);
191			}
192		});
193
194		_pullDownBtn.click(function(){
195			return false;
196		});
197
198	}else{
199		//PC
200		const _pullDownBtns = [...document.querySelectorAll('#rim-tpl-categorynav > li > a')];
201
202		_pullDownBtns.forEach(btn => {
203			let btn_wrap = btn.parentElement;
204			btn.addEventListener('mouseenter',function(){
205				pullDown_open($(this));
206			});
207
208			btn_wrap.addEventListener('mouseleave',function(){
209				pullDown_close($(btn));
210			});
211
212			btn_wrap.addEventListener('focusin',function(){
213				pullDown_open($(btn));
214			});
215
216			btn_wrap.addEventListener('focusout',function(){
217				setTimeout(function(){
218					if(!btn_wrap.contains(document.activeElement)){
219						pullDown_close($(btn));
220					}
221				},0);
222			});
223		});
224
225	}
226
227
228
229	//#rim-tpl-categorynav .rim-tpl-sub-bottom li
230	$("#rim-tpl-categorynav .rim-tpl-sub-bottom li:nth-child(5),#rim-tpl-categorynav .rim-tpl-sub-bottom li:nth-child(6)").addClass("no-border");
231
232
233
234	//close btn
235	$(".rim-tpl-btn-close a").click(()=>{
236		_pullDownBtn.removeClass("active");
237		_pullDownBtn.siblings(".rim-tpl-sub-box").removeClass("active");
238		_pullDownBtn.siblings(".rim-tpl-sub-others").removeClass("active");
239		_pullDownBtn.removeClass("selected");
240		return false;
241	});
242
243
244	/*-------------
245	ナビのプルダウン時の閉じるボタンなどのwrapperの高さを定義
246	-------------- */
247	// DOMの構造上こうせざるを得ない
248	// 定義しないとSP時に出る下の閉じるが設置できない
249	$(window).bind('load resize orientationchange',function(){
250		_pullDownBtn.parent().each(function(){
251			let sub_box_height = $(this).find('.rim-tpl-sub-box').outerHeight();
252			$(this).find('.rim-tpl-sub-others').height(sub_box_height);
253		})
254	}).trigger('resize');
255
256
257
258	/*-------------
259	ナビのカレント表示
260	-------------- */
261	// 既存のものはbodyについているclassで出し分けている処理なã
261®ã§æº–拠する
262	// [.category-brand] = ブランド
263	// [.category-products] = 製品
264	// [.category-school] = フォトアカデミー
265	// [.category-community] = コミュニティ
266	// [.category-support] = サポート
267
268	function nav_isCurrent(){
269		// bodyについているclassの配列
270		let bodyClasses = ($('body').attr('class').split(' ').filter(Boolean))
271
272		// 配列に含んでいるかチェック
273		if(bodyClasses.includes('category-brand')){
274			$('.rim-tpl-btn-brand > a').attr('aria-current','page');
275		}
276		if(bodyClasses.includes('category-products')){
277			$('.rim-tpl-btn-products > a').attr('aria-current','page');
278		}
279		if(bodyClasses.includes('category-school')){
280			$('.rim-tpl-btn-school > a').attr('aria-current','page');
281		}
282		if(bodyClasses.includes('category-community')){
283			$('.rim-tpl-btn-community > a').attr('aria-current','page');
284		}
285		if(bodyClasses.includes('category-support')){
286			$('.rim-tpl-btn-support > a').attr('aria-current','page');
287		}
288
289	}
290	nav_isCurrent();
291
292
293	/*-------------
294	category btn auto activate
295	--------------*/
296	var _nowURL=url(2);
297	function _BodyAddClass(className){
298		jQuery("body").addClass(className);
299	}
300	if(_nowURL){
301		if(_nowURL=="products"){
302			_BodyAddClass("category-products");
303		}else if(_nowURL=="store"){
304			_BodyAddClass("category-store");
305		}else if(_nowURL=="community"){
306			_BodyAddClass("category-community");
307		}else if(_nowURL=="support"){
308			_BodyAddClass("category-support");
309		}
310	}
311
312
313	/*-------------
314	search-box action
315	-------------- */
316	//path
317	var _searchForm=$("#rim-tpl-header form"),
318		_pathname=document.location.pathname;
319
320	_pathname=_pathname.split("/");
321	_pathname=_pathname[1]
322
323	//set action
324	if(agent.search(/(iPhone)|(iPad)|(iPod)|(Android)|(SC-01C)|(BlackBerry)|(Symbian)|((IEMobile)|(Windows Phone))/) != -1){
325		if(_pathname=="english"){
326			_searchForm.attr("action","//search.ricoh.jp/en_imaging_sp/search.x");
327		}else{
328			_searchForm.attr("action","//search.ricoh.jp/ja_imaging_sp/search.x");
329		}
330	}
331
332
333
334	/*-------------
335	how to 写真 置換
336	--------------*/
337	var howtoReplace = function (){
338		var URL ='/japan/photo-life/';
339		$('#rim-tpl-footer a[href="/japan/community/howto/"]').attr('href',URL).text('Beautiful Photo-life') ;
340		$('#rim-tpl-footer').addClass('is-active');
341	};
342	howtoReplace();
343
344
345	// 「PEMTAXオンライン相談室」表示/非表示
346		var pathname = location.pathname;
347
348		if (pathname.match("/products/gr")) {
349		}else {
350			if($('.consultation').length){
351				$('.consultation').addClass('is-show');
352			}
353		}
354
355});

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.