1/* 2 * @author Tomas Opekar <[email protected]> 3 * 4 */ 5 6var BS = BS || {}; 7 8BS.Design = { 9 /** 10 *Ukazatel na tento objekt 11 */ 12 $this: null, 13 14 /** 15 *Nova sablona 16 */ 17 $new_template: null, 18 19 $new_menu_templates: ["uranium","platinum"], 20 21 $third_generation_templates: ["titanium","platinum","uranium"], 22 23 /** 24 *Zjisti typ sablony /stara/nova/ 25 **/ 26 is_new_template: function(){ 27 if(this.$new_template == null) 28 { 29 if(jQuery("body").hasClass("old_template")) 30 { 31 this.$new_template = false; 32 } 33 else 34 { 35 this.$new_template = true; 36 } 37 return this.$new_template; 38 } 39 else 40 { 41 return this.$new_template; 42 } 43 }, 44 /** 45 * Funkce vezme barvu (css=color) z jednoho elementu a nastavi ho druhemu 46 */ 47 recolor: function(orig_el, target_el){ 48 var orig_css = orig_el.css("color"); 49 target_el.css("color", orig_css); 50 return true; 51 }, 52 /** 53 * zobrazuje Älánkové menu na mobilu (skryté) v nových Å¡ablonách 2022 54 * @param {string} $templateName 55 * @returns {boolean} 56 */ 57 is_new_menu_tmpl: function($templateName) 58 { 59 return this.$new_menu_templates.includes($templateName); 60 61 }, 62 third_generation: function () // nové Å¡ablony 3 generace 63 { 64 if(BS.Design.template !== undefined) 65 { 66 return this.$third_generation_templates.includes(BS.Design.template.name); 67 } 68 return false; 69 }, 70 enableTouchSupportForSlider: function (id) { 71 // Najdi prvek podle ID 72 var sliderHandle = document.getElementById(id); 73 if (!sliderHandle) { 74 return; 75 } 76 77 var isDragging = false; 78 var startX = 0; 79 80 var onTouchStart = function(event) { 81 if (event.touches.length !== 1) return; // Ignoruj vÃce prstů 82 var touch = event.touches[0]; 83 startX = touch.clientX; 84 isDragging = true; 85 86 // Simuluj mousedown 87 var mouseEvent = new MouseEvent("mousedown", { 88 bubbles: true, 89 cancelable: true, 90 clientX: touch.clientX, 91 clientY: touch.clientY 92 }); 93 sliderHandle.dispatchEvent(mouseEvent); 94 }; 95 96 var onTouchMove = function(event) { 97 if (!isDragging) return; 98 99 var touch = event.touches[0]; 100 101 // Simuluj mousemove 102 var mouseEvent = new MouseEvent("mousemove", { 103 bubbles: true, 104 cancelable: true, 105 clientX: touch.clientX, 106 clientY: touch.clientY 107 }); 108 sliderHandle.dispatchEvent(mouseEvent); 109 }; 110 111 var onTouchEnd = function() { 112 if (!isDragging) return; 113 isDragging = false; 114 115 // Simuluj mouseup 116 var mouseEvent = new MouseEvent("mouseup", { 117 bubbles: true, 118 cancelable: true 119 }); 120 sliderHandle.dispatchEvent(mouseEvent); 121 }; 122 123 // PÅidej touch event posluchaÄe 124 sliderHandle.addEventListener("touchstart", onTouchStart, { passive: false }); 125 sliderHandle.addEventListener("touchmove", onTouchMove, { passive: false }); 126 sliderHandle.addEventListener("touchend", onTouchEnd, { passive: false }); 127 } 128 129 130}
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.