- function STwriteCookie (key, value, hours) {
- var date = new Date();
- // Get milliseconds at current time plus number of hours*60 minutes*60 seconds* 1000 milliseconds
- date.setTime(+ date + (hours * 3600000)); //60 * 60 * 1000
- window.document.cookie = key + "=" + value + "; expires=" + date.toGMTString() + "; path=/";
- return value;
- };
- function STgetCookie(cname) {
- var name = cname + "=";
- var decodedCookie = decodeURIComponent(document.cookie);
- var ca = decodedCookie.split(';');
- for(var i = 0; i <ca.length; i++) {
- var c = ca[i];
- while (c.charAt(0) == ' ') {
- c = c.substring(1);
- }
- if (c.indexOf(name) == 0) {
- return c.substring(name.length, c.length);
- }
- }
- return "";
- }
- // The purpose of this code is to fix the height of overflow: auto blocks, because some browsers can't figure it out for themselves.
- function smf_codeBoxFix()
- {
- var codeFix = document.getElementsByTagName('code');
- for (var i = codeFix.length - 1; i >= 0; i--)
- {
- if (is_webkit && codeFix[i].offsetHeight < 20)
- codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + 'px';
- else if (is_ff && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
- codeFix[i].style.overflow = 'scroll';
- else if ('currentStyle' in codeFix[i] && codeFix[i].currentStyle.overflow == 'auto' && (codeFix[i].currentStyle.height == '' || codeFix[i].currentStyle.height == 'auto') && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0))
- codeFix[i].style.height = (codeFix[i].offsetHeight + 24) + 'px';
- }
- }
- // Add a fix for code stuff?
- if ((is_ie && !is_ie4) || is_webkit || is_ff)
- addLoadEvent(smf_codeBoxFix);
- function selectText(node) {
- var to = node;
- node = document.getElementById(node);
- if (document.body.createTextRange) {
- const range = document.body.createTextRange();
- range.moveToElementText(node);
- range.select();
- $('#'+to).animatedScroll({easing: "easeOutExpo"});
- } else if (window.getSelection) {
- const selection = window.getSelection();
- const range = document.createRange();
- range.selectNodeContents(node);
- selection.removeAllRanges();
- selection.addRange(range);
- $('#'+to).animatedScroll({easing: "easeOutExpo"});
- } else {
- console.warn("Could not select text in node: Unsupported browser.");
- }
- }
- // Toggles the element height and width styles of an image.
- function smc_toggleImageDimensions()
- {
- var oImages = document.getElementsByTagName('IMG');
- for (oImage in oImages)
- {
- // Not a resized image? Skip it.
- if (oImages[oImage].className == undefined || oImages[oImage].className.indexOf('bbc_img resized') == -1)
- continue;
- oImages[oImage].style.cursor = 'pointer';
- oImages[oImage].onclick = function() {
- this.style.width = this.style.height = this.style.width == 'auto' ? null : 'auto';
- };
- }
- }
- // Add a load event for the function above.
- addLoadEvent(smc_toggleImageDimensions);
- // Adds a button to a certain button strip.
- function smf_addButton(sButtonStripId, bUseImage, oOptions)
- {
- var oButtonStrip = document.getElementById(sButtonStripId);
- var aItems = oButtonStrip.getElementsByTagName('span');
- // Remove the 'last' class from the last item.
- if (aItems.length > 0)
- {
- var oLastSpan = aItems[aItems.length - 1];
- oLastSpan.className = oLastSpan.className.replace(/\s*last/, 'position_holder');
- }
- // Add the button.
- var oButtonStripList = oButtonStrip.getElementsByTagName('ul')[0];
- var oNewButton = document.createElement('li');
- setInnerHTML(oNewButton, '<a href="' + oOptions.sUrl + '" ' + ('sCustom' in oOptions ? oOptions.sCustom : '') + '><span class="last"' + ('sId' in oOptions ? ' id="' + oOptions.sId + '"': '') + '>' + oOptions.sText + '</span></a>');
- oButtonStripList.appendChild(oNewButton);
- }
- // Adds hover events to list items. Used for a versions of IE that don't support this by default.
- var smf_addListItemHoverEvents = function()
- {
- var cssRule, newSelector;
- // Add a rule for the list item hover event to every stylesheet.
- for (var iStyleSheet = 0; iStyleSheet < document.styleSheets.length; iStyleSheet ++)
- for (var iRule = 0; iRule < document.styleSheets[iStyleSheet].rules.length; iRule ++)
- {
- oCssRule = document.styleSheets[iStyleSheet].rules[iRule];
- if (oCssRule.selectorText.indexOf('LI:hover') != -1)
- {
- sNewSelector = oCssRule.selectorText.replace(/LI:hover/gi, 'LI.iehover');
- document.styleSheets[iStyleSheet].addRule(sNewSelector, oCssRule.style.cssText);
- }
- }
- // Now add handling for these hover events.
- var oListItems = document.getElementsByTagName('LI');
- for (oListItem in oListItems)
- {
- oListItems[oListItem].onmouseover = function() {
- this.className += ' iehover';
- };
- oListItems[oListItem].onmouseout = function() {
- this.className = this.className.replace(new RegExp(' iehover\\b'), '');
- };
- }
- }
- // Add hover events to list items if the browser requires it.
- if (is_ie7down && 'attachEvent' in window)
- window.attachEvent('onload', smf_addListItemHoverEvents);
- $(document).on('click',function(){
- $('.collapse').collapse('hide');
- })
- jQuery(document).ready(function(){
- jQuery(".increment_qty").click(function() {
- var oldVal = jQuery(this).parent().find("input").val();
- if ( parseFloat(oldVal) >= 1 ) {
- var newVal = parseFloat(oldVal) + 1;
- jQuery(this).parent().find("input").val(newVal);
- }
- });
- jQuery(".decrement_qty").click(function() {
- var oldVal = jQuery(this).parent().find("input").val();
- if ( parseFloat(oldVal) >= 2 ) {
- var newVal = parseFloat(oldVal) - 1;
- jQuery(this).parent().find("input").val(newVal);
- }
- });
- });
- jQuery(document).ready(function(){
- $(".scroll-to-top").click(function() {
- $("html, body").animate({ scrollTop: 0 }, 600);
- return false;
- });
- $(window).scroll(function(){
- var position = $(window).scrollTop();
- var uzunluk=$(document).height();
- if(position < uzunluk-705)
- {
- $(".safari_bildirim_view_click").addClass("active")
- $(".safari_bildirim_view").addClass("active")
- }
- else {
- $(".safari_bildirim_view_click").removeClass("active")
- $(".safari_bildirim_view").removeClass("active")
- }
- if(position >= 200) {
- $(".scroll-to-top").addClass("active")
- }
- else {
- $(".scroll-to-top").removeClass("active")
- }
- });
- });
- $(document).ready(function(){
- $('.popper').popover({
- trigger: 'hover',
- placement: 'left',
- container: 'body',
- html: true,
- content: function () {
- return $(this).next('.popper-content').html();
- }
- });
- $(function () {
- $('[data-toggle="tooltip"]').tooltip()
- })
- });
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.timeago=e()}(this,function(){"use strict";var t="second_minute_hour_day_week_month_year".split("_"),e="?_??_??_?_?_?_?".split("_"),n=[60,60,24,7,365/7/12,12],r={en:function(e,n){if(0===n)return["just now","right now"];var r=t[parseInt(n/2)];return e>1&&(r+="s"),[e+" "+r+" ago","in "+e+" "+r]},zh_CN:function(t,n){if(0===n)return["??","???"];var r=e[parseInt(n/2)];return[t+" "+r+"?",t+" "+r+"?"]}},a=function(t){return parseInt(t)},i=function(t){return t instanceof Date?t:!isNaN(t)||/^\d+$/.test(t)?new Date(a(t)):(t=(t||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"),new Date(t))},o=function(t,e,i){e=r[e]?e:r[i]?i:"en";for(var o=0,u=t<0?1:0,c=t=Math.abs(t);t>=n[o]&&o<n.length;o++)t/=n[o];return(t=a(t))>(0===(o*=2)?9:1)&&(o+=1),r[e](t,o,c)[u].replace("%s",t)},u=function(t,e){return((e=e?i(e):new Date)-i(t))/1e3},c=function(t,e){return t.getAttribute?t.getAttribute(e):t.attr?t.attr(e):void 0},f=function(t){return c(t,"data-timeago")||c(t,"datetime")},d=[],l=function(t){t&&(clearTimeout(t),delete d[t])},s=function(t){if(t)l(c(t,"data-tid"));else for(var e in d)l(e)},h=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var p=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.nowDate=e,this.defaultLocale=n||"en"}return h(t,[{key:"setLocale",value:function(t){this.defaultLocale=t}},{key:"doRender",value:function(t,e,r){var a=this,i=u(e,this.nowDate);t.innerHTML=o(i,r,this.defaultLocale);var c=function(t,e){var n=setTimeout(function(){l(n),t()},e);return d[n]=0,n}(function(){a.doRender(t,e,r)},Math.min(1e3*function(t){for(var e=1,r=0,a=Math.abs(t);t>=n[r]&&r<n.length;r++)t/=n[r],e*=n[r];return a=(a%=e)?e-a:e,Math.ceil(a)}(i),2147483647));!function(t,e){t.setAttribute?t.setAttribute("data-tid",e):t.attr&&t.attr("data-tid",e)}(t,c)}},{key:"render",value:function(t,e){void 0===t.length&&(t=[t]);for(var n=void 0,r=0,a=t.length;r<a;r++)n=t[r],s(n),this.doRender(n,f(n),e)}},{key:"format",value:function(t,e){return o(u(t,this.nowDate),e,this.defaultLocale)}}]),t}(),v=function(t,e){return new p(t,e)};return v.register=function(t,e){r[t]=e},v.cancel=s,v});