$.ajaxSetup({ cache: false }); $(document).ready(function() { $("#butmobisearch_toggle").click(function() // Mobil Suchebutton { console.log("Toggle Search"); $( "#searcheintrag" ).toggleClass("hidden-xs"); $( "#searcheintrag" ).toggleClass("hidden-sm"); $( "#butmobisearch_toggle" ).toggleClass("active"); }); $(".mnavu").hover(function() // Dropdown Navigation laden { var menuload = $(this).attr("data-menu"); var loadmenu = { 'loadid' : menuload }; console.log(menuload); $.ajax( { type: "GET", url: "verwaltung/"+menuload+".php", data : loadmenu, cache:false, success: function(antwort){ $("#"+menuload+"").html(antwort); } } ); }); $.slidebars({ siteClose: true, // true or false disableOver: 650, // integer or false hideControlClasses: true, // true or false scrollLock: true // true or false }); });/* ========================================================= * bootstrap-tabdrop.js * http://www.eyecon.ro/bootstrap-tabdrop * ========================================================= * Copyright 2012 Stefan Petre * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ========================================================= */ !function( $ ) { var WinReszier = (function(){ var registered = []; var inited = false; var timer; var resize = function(ev) { clearTimeout(timer); timer = setTimeout(notify, 100); }; var notify = function() { for(var i=0, cnt=registered.length; i'+options.text+' ') .prependTo(this.element); if (this.element.parent().is('.tabs-below')) { this.dropdown.addClass('dropup'); } WinReszier.register($.proxy(this.layout, this)); this.layout(); }; TabDrop.prototype = { constructor: TabDrop, layout: function() { var collection = []; this.dropdown.removeClass('hide'); this.element .append(this.dropdown.find('li')) .find('>li') .not('.tabdrop') .each(function(){ if(this.offsetTop > 0) { collection.push(this); } }); if (collection.length > 0) { collection = $(collection); this.dropdown .find('ul') .empty() .append(collection); if (this.dropdown.find('.active').length == 1) { this.dropdown.addClass('active'); } else { this.dropdown.removeClass('active'); } } else { this.dropdown.addClass('hide'); } } } $.fn.tabdrop = function ( option ) { return this.each(function () { var $this = $(this), data = $this.data('tabdrop'), options = typeof option === 'object' && option; if (!data) { $this.data('tabdrop', (data = new TabDrop(this, $.extend({}, $.fn.tabdrop.defaults,options)))); } if (typeof option == 'string') { data[option](); } }) }; $.fn.tabdrop.defaults = { text: '' }; $.fn.tabdrop.Constructor = TabDrop; }( window.jQuery );// ----------------------------------- // Slidebars // Version 0.10.3 // http://plugins.adchsm.me/slidebars/ // // Written by Adam Smith // http://www.adchsm.me/ // // Released under MIT License // http://plugins.adchsm.me/slidebars/license.txt // // --------------------- // Index of Slidebars.js // // 001 - Default Settings // 002 - Feature Detection // 003 - User Agents // 004 - Setup // 005 - Animation // 006 - Operations // 007 - API // 008 - User Input ;( function ( $ ) { $.slidebars = function ( options ) { // ---------------------- // 001 - Default Settings var settings = $.extend( { siteClose: true, // true or false - Enable closing of Slidebars by clicking on #sb-site. scrollLock: false, // true or false - Prevent scrolling of site when a Slidebar is open. disableOver: false, // integer or false - Hide Slidebars over a specific width. hideControlClasses: false // true or false - Hide controls at same width as disableOver. }, options ); // ----------------------- // 002 - Feature Detection var test = document.createElement( 'div' ).style, // Create element to test on. supportTransition = false, // Variable for testing transitions. supportTransform = false; // variable for testing transforms. // Test for CSS Transitions if ( test.MozTransition === '' || test.WebkitTransition === '' || test.OTransition === '' || test.transition === '' ) supportTransition = true; // Test for CSS Transforms if ( test.MozTransform === '' || test.WebkitTransform === '' || test.OTransform === '' || test.transform === '' ) supportTransform = true; // ----------------- // 003 - User Agents var ua = navigator.userAgent, // Get user agent string. android = false, // Variable for storing android version. iOS = false; // Variable for storing iOS version. if ( /Android/.test( ua ) ) { // Detect Android in user agent string. android = ua.substr( ua.indexOf( 'Android' )+8, 3 ); // Set version of Android. } else if ( /(iPhone|iPod|iPad)/.test( ua ) ) { // Detect iOS in user agent string. iOS = ua.substr( ua.indexOf( 'OS ' )+3, 3 ).replace( '_', '.' ); // Set version of iOS. } if ( android && android < 3 || iOS && iOS < 5 ) $( 'html' ).addClass( 'sb-static' ); // Add helper class for older versions of Android & iOS. // ----------- // 004 - Setup // Site container var $site = $( '.sb-site-container' ); // Cache the selector. var $sitemain = $( '#sb-site' ); // Left Slidebar if ( $( '.sb-left' ).length ) { // Check if the left Slidebar exists. var $left = $( '.sb-left' ), // Cache the selector. leftActive = false; // Used to check whether the left Slidebar is open or closed. } // Right Slidebar if ( $( '.sb-right' ).length ) { // Check if the right Slidebar exists. var $right = $( '.sb-right' ), // Cache the selector. rightActive = false; // Used to check whether the right Slidebar is open or closed. } var init = false, // Initialisation variable. windowWidth = $( window ).width(), // Get width of window. $controls = $( '.sb-toggle-left, .sb-toggle-right, .sb-open-left, .sb-open-right, .sb-close' ), // Cache the control classes. $slide = $( '.sb-slide' ); // Cache users elements to animate. // Initailise Slidebars function initialise () { if ( ! settings.disableOver || ( typeof settings.disableOver === 'number' && settings.disableOver >= windowWidth ) ) { // False or larger than window size. init = true; // true enabled Slidebars to open. $( 'html' ).addClass( 'sb-init' ); // Add helper class. if ( settings.hideControlClasses ) $controls.removeClass( 'sb-hide' ); // Remove class just incase Slidebars was originally disabled. css(); // Set required inline styles. } else if ( typeof settings.disableOver === 'number' && settings.disableOver < windowWidth ) { // Less than window size. init = false; // false stop Slidebars from opening. $( 'html' ).removeClass( 'sb-init' ); // Remove helper class. if ( settings.hideControlClasses ) $controls.addClass( 'sb-hide' ); // Hide controls $site.css( 'minHeight', '' ); // Remove minimum height. if ( leftActive || rightActive ) close(); // Close Slidebars if open. } } initialise(); // Inline CSS function css() { // Site container height. $site.css( 'minHeight', '' ); var siteHeight = parseInt( $site.css( 'height' ), 10 ), htmlHeight = parseInt( $( 'html' ).css( 'height' ), 10 ); if ( siteHeight < htmlHeight ) $site.css( 'minHeight', $( 'html' ).css( 'height' ) ); // Test height for vh support.. // Custom Slidebar widths. if ( $left && $left.hasClass( 'sb-width-custom' ) ) $left.css( 'width', $left.attr( 'data-sb-width' ) ); // Set user custom width. if ( $right && $right.hasClass( 'sb-width-custom' ) ) $right.css( 'width', $right.attr( 'data-sb-width' ) ); // Set user custom width. // Set off-canvas margins for Slidebars with push and overlay animations. if ( $left && ( $left.hasClass( 'sb-style-push' ) || $left.hasClass( 'sb-style-overlay' ) ) ) $left.css( 'marginLeft', '-' + $left.css( 'width' ) ); if ( $right && ( $right.hasClass( 'sb-style-push' ) || $right.hasClass( 'sb-style-overlay' ) ) ) $right.css( 'marginRight', '-' + $right.css( 'width' ) ); // Site scroll locking. if ( settings.scrollLock ) $( 'html' ).addClass( 'sb-scroll-lock' ); } // Resize Functions $( window ).resize( function () { var resizedWindowWidth = $( window ).width(); // Get resized window width. if ( windowWidth !== resizedWindowWidth ) { // Slidebars is running and window was actually resized. windowWidth = resizedWindowWidth; // Set the new window width. initialise(); // Call initalise to see if Slidebars should still be running. if ( leftActive ) open( 'left' ); // If left Slidebar is open, calling open will ensure it is the correct size. if ( rightActive ) open( 'right' ); // If right Slidebar is open, calling open will ensure it is the correct size. } } ); // I may include a height check along side a width check here in future. // --------------- // 005 - Animation var animation; // Animation type. // Set animation type. if ( supportTransition && supportTransform ) { // Browser supports css transitions and transforms. animation = 'translate'; // Translate for browsers that support it. if ( android && android < 4.4 ) animation = 'side'; // Android supports both, but can't translate any fixed positions, so use left instead. } else { animation = 'jQuery'; // Browsers that don't support css transitions and transitions. } // Animate mixin. function animate( object, amount, side ) { // Choose selectors depending on animation style. var selector; if ( object.hasClass( 'sb-style-push' ) ) { selector = $site.add( object ).add( $slide ); // Push - Animate site, Slidebar and user elements. } else if ( object.hasClass( 'sb-style-overlay' ) ) { selector = object; // Overlay - Animate Slidebar only. } else { selector = $site.add( $slide ); // Reveal - Animate site and user elements. } // Apply animation if ( animation === 'translate' ) { if ( amount === '0px' ) { removeAnimation(); } else { selector.css( 'transform', 'translate( ' + amount + ' )' ); // Apply the animation. } } else if ( animation === 'side' ) { if ( amount === '0px' ) { removeAnimation(); } else { if ( amount[0] === '-' ) amount = amount.substr( 1 ); // Remove the '-' from the passed amount for side animations. selector.css( side, '0px' ); // Add a 0 value so css transition works. setTimeout( function () { // Set a timeout to allow the 0 value to be applied above. selector.css( side, amount ); // Apply the animation. }, 1 ); } } else if ( animation === 'jQuery' ) { if ( amount[0] === '-' ) amount = amount.substr( 1 ); // Remove the '-' from the passed amount for jQuery animations. var properties = {}; properties[side] = amount; selector.stop().animate( properties, 400 ); // Stop any current jQuery animation before starting another. } // Remove animation function removeAnimation () { selector.removeAttr( 'style' ); css(); } } // ---------------- // 006 - Operations // Open a Slidebar function open( side ) { // Check to see if opposite Slidebar is open. if ( side === 'left' && $left && rightActive || side === 'right' && $right && leftActive ) { // It's open, close it, then continue. close(); setTimeout( proceed, 400 ); } else { // Its not open, continue. proceed(); } // Open function proceed() { if ( init && side === 'left' && $left ) { // Slidebars is initiated, left is in use and called to open. $( 'html' ).addClass( 'sb-active sb-active-left' ); // Add active classes. $left.addClass( 'sb-active' ); animate( $left, $left.css( 'width' ), 'left' ); // Animation setTimeout( function () { leftActive = true; }, 400 ); // Set active variables. } else if ( init && side === 'right' && $right ) { // Slidebars is initiated, right is in use and called to open. $( 'html' ).addClass( 'sb-active sb-active-right' ); // Add active classes. $right.addClass( 'sb-active' ); animate( $right, '-' + $right.css( 'width' ), 'right' ); // Animation setTimeout( function () { rightActive = true; }, 400 ); // Set active variables. } } } // Close either Slidebar function close( url, target ) { if ( leftActive || rightActive ) { // If a Slidebar is open. if ( leftActive ) { animate( $left, '0px', 'left' ); // Animation leftActive = false; } if ( rightActive ) { animate( $right, '0px', 'right' ); // Animation rightActive = false; } setTimeout( function () { // Wait for closing animation to finish. $( 'html' ).removeClass( 'sb-active sb-active-left sb-active-right' ); // Remove active classes. if ( $left ) $left.removeClass( 'sb-active' ); if ( $right ) $right.removeClass( 'sb-active' ); if ( typeof url !== 'undefined' ) { // If a link has been passed to the function, go to it. if ( typeof target === undefined ) target = '_self'; // Set to _self if undefined. window.open( url, target ); // Open the url. } }, 400 ); } } // Toggle either Slidebar function toggle( side ) { if ( side === 'left' && $left ) { // If left Slidebar is called and in use. if ( ! leftActive ) { open( 'left' ); // Slidebar is closed, open it. } else { close(); // Slidebar is open, close it. } } if ( side === 'right' && $right ) { // If right Slidebar is called and in use. if ( ! rightActive ) { open( 'right' ); // Slidebar is closed, open it. } else { close(); // Slidebar is open, close it. } } } // --------- // 007 - API this.slidebars = { open: open, // Maps user variable name to the open method. close: close, // Maps user variable name to the close method. toggle: toggle, // Maps user variable name to the toggle method. init: function () { // Returns true or false whether Slidebars are running or not. return init; // Returns true or false whether Slidebars are running. }, active: function ( side ) { // Returns true or false whether Slidebar is open or closed. if ( side === 'left' && $left ) return leftActive; if ( side === 'right' && $right ) return rightActive; }, destroy: function ( side ) { // Removes the Slidebar from the DOM. if ( side === 'left' && $left ) { if ( leftActive ) close(); // Close if its open. setTimeout( function () { $left.remove(); // Remove it. $left = false; // Set variable to false so it cannot be opened again. }, 400 ); } if ( side === 'right' && $right) { if ( rightActive ) close(); // Close if its open. setTimeout( function () { $right.remove(); // Remove it. $right = false; // Set variable to false so it cannot be opened again. }, 400 ); } } }; // ---------------- // 008 - User Input function eventHandler( event, selector ) { event.stopPropagation(); // Stop event bubbling. event.preventDefault(); // Prevent default behaviour. if ( event.type === 'touchend' ) selector.off( 'click' ); // If event type was touch, turn off clicks to prevent phantom clicks. } // Toggle left Slidebar $( '.sb-toggle-left' ).on( 'touchend click', function ( event ) { eventHandler( event, $( this ) ); // Handle the event. toggle( 'left' ); // Toggle the left Slidbar. $( "#sidebarmenue" ).load( "/verwaltung/mobile-sidebar.php" ); // HIER AJAX REQUEST!!!! } ); // Toggle right Slidebar $( '.sb-toggle-right' ).on( 'touchend click', function ( event ) { eventHandler( event, $( this ) ); // Handle the event. toggle( 'right' ); // Toggle the right Slidbar. } ); // Open left Slidebar $( '.sb-open-left' ).on( 'touchend click', function ( event ) { eventHandler( event, $( this ) ); // Handle the event. open( 'left' ); // Open the left Slidebar. } ); // Open right Slidebar $( '.sb-open-right' ).on( 'touchend click', function ( event ) { eventHandler( event, $( this ) ); // Handle the event. open( 'right' ); // Open the right Slidebar. } ); // Close Slidebar $( '.sb-close' ).on( 'touchend click', function ( event ) { if ( $( this ).is( 'a' ) || $( this ).children().is( 'a' ) ) { // Is a link or contains a link. if ( event.type === 'click' ) { // Make sure the user wanted to follow the link. event.stopPropagation(); // Stop events propagating event.preventDefault(); // Stop default behaviour var link = ( $( this ).is( 'a' ) ? $( this ) : $( this ).find( 'a' ) ), // Get the link selector. url = link.attr( 'href' ), // Get the link url. target = ( link.attr( 'target' ) ? link.attr( 'target' ) : '_self' ); // Set target, default to _self if not provided close( url, target ); // Close Slidebar and pass link target. } } else { // Just a normal control class. eventHandler( event, $( this ) ); // Handle the event. close(); // Close Slidebar. } } ); // Extra Buts $('.sb-gohome').on( 'touchend click', function ( event ) { console.log("Home"); location.href=('//www.gold.de/'); }); $('.sb-goforum').on( 'touchend click', function ( event ) { console.log("Home"); location.href=('//forum.gold.de/'); }); $('.sb-gocalc').on( 'touchend click', function ( event ) { console.log("Home"); location.href=('//www.gold.de/rechner/'); }); // Close Slidebar via site $sitemain.on( 'touchend click', function ( event ) { if ( settings.siteClose && ( leftActive || rightActive ) ) { // If settings permit closing by site and left or right Slidebar is open. eventHandler( event, $( this ) ); // Handle the event. close(); // Close it. } } ); }; // End Slidebars function. } ) ( jQuery );console.log('g21'); ;(function($) { $.fn.unveil = function(threshold, callback) { var $w = $(window), th = threshold || 0, retina = window.devicePixelRatio > 1, attrib = retina? "data-src-retina" : "data-src", images = this, loaded; this.one("unveil", function() { var source = this.getAttribute(attrib); source = source || this.getAttribute("data-src"); if (source) { this.setAttribute("src", source); if (typeof callback === "function") callback.call(this); } }); function unveil() { var inview = images.filter(function() { var $e = $(this); if ($e.is(":hidden")) return; var wt = $w.scrollTop(), wb = wt + $w.height(), et = $e.offset().top, eb = et + $e.height(); return eb >= wt - th && et <= wb + th; }); loaded = inview.trigger("unveil"); images = images.not(loaded); } $w.on("scroll.unveil resize.unveil lookup.unveil", unveil); unveil(); return this; }; })(window.jQuery || window.Zepto); // Nummern formatieren function xformatNumber(number, options) { /** @type {Array.} */ var result = (options['fraction'] ? number.toFixed(options['fraction']) : '' + number).split('.'); return options['prefix'] + result[0].replace(/\B(?=(\d{3})+(?!\d))/g, /** @type {string} */ (options['grouping'])) + (result[1] ? options['decimal'] + result[1] : '') + options['suffix']; } // Div Ladebox var showloadingOV = '

Lade Daten
'; // Wird für die neue Linke Navigation gebraucht var navidata; // Auflösung Nutzer bestimmen window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; function getDevice(){var width=$(window).width();if(width<768){return"mobile";} return"desktop";} var g_device=getDevice(); // Navibar oben für Touch function touchNavigation() { if( $( 'html' ).hasClass( 'touch' ) === true ) { console.log("no-touch"); $('.uebersicht').removeClass("hidden"); $('.uebersicht').addClass("show"); $('.mainNavItem').click( function(e){ e.preventDefault(); }); } } // Echtzeitpreise auf der Seite ausgeben function metallpreise(){ var response = ""; $.ajax({ type: "GET", url: "//www.gold.de/ajax/data.php?func=json", dataType: "json", crossDomain: true, cache: false, async : true, timeout: 10000, success: function(response){ $.each(response, function (index, data) { $("."+index+"").html(data); }) } }) } // Scripte Nachladen function loadscript(src, callback, attrs){ if(!document.querySelector('script[src="' + src + '"]')){ var script = document.createElement('script'); // if an array is provided => add custom attributes if(attrs && attrs.length > 0){ for(var i=0; i 0) { $('#content_lightbox').html(''); $('#gold_lightbox').show(); } else { var gold_lightbox = '
' + '
' + '' + '
' + '

Fenster schließen' +'

'; $('body').append(gold_lightbox); } }); $('body').on('click', '#gold_lightbox', function() {$('#gold_lightbox').hide();}); // Lazy IMG Funktion, bilder nachladen $("img").unveil(); // Teaser Slider etc. starten $('.carousel').carousel({ interval: 3000 }); //////////////////////////////// // Navigation Links //////////////////////////////// $(".nav_epfall").click(function(){ var epfall_filter = $(this).attr("data-filter"); var navileftid = $('#navi-left-id').val(); $('.fanavlinks').addClass('hidden'); $('#fanavlinks'+epfall_filter).removeClass('hidden'); $('.nav_epfall').removeClass('fw700'); $(this).addClass('fw700'); if (epfall_filter == "1") { var datafilter = "0"; } if (epfall_filter == "0") { var datafilter = "2"; } setnavdata(epfall_filter,navileftid); }); $(".neu_nav_epfall").click(function(){ var epfall_filter = $(this).attr("data-filter"); var navileftid = $('#navi-left-id').val(); $('.fanavlinks').addClass('hidden'); $('#fanavlinks'+epfall_filter).removeClass('hidden'); $('.neu_nav_epfall').removeClass('fw600'); $(this).addClass('fw600'); $(".neu_nav_epfall").removeClass( "tabweiss_on"); $(".neu_nav_epfall").removeClass( "tabweiss_off"); $(".neu_nav_epfall").addClass( "tabweiss_off"); $(this).removeClass( "tabweiss_off"); $(this).addClass( "tabweiss_on"); if (epfall_filter == "1") { var datafilter = "0"; } if (epfall_filter == "0") { var datafilter = "2"; } $('#navi-left-search').val(''); setnavdata(epfall_filter,navileftid); }); $('#navi-left-search').keyup(function(){ var navileftid = $('#navi-left-id').val(); loadnavdata(navileftid); var searchField = $(this).val(); var regex = new RegExp(searchField, "i"); var output = ''; var count = 1; $('.neu_nav_epfall').removeClass('tabweiss_on'); $('.neu_nav_epfall').addClass('tabweiss_off'); $(".neu_nav_epfall[data-filter='2']").removeClass("tabweiss_off").addClass("tabweiss_on"); if(searchField === '') { $('.neu_nav_epfall').removeClass('tabweiss_on'); $('.neu_nav_epfall').addClass('tabweiss_off'); $(".neu_nav_epfall[data-filter='0']").removeClass("tabweiss_off").addClass("tabweiss_on"); $.each(navidata, function(key, val){ if (val.beschriftung != ""){ output += ''; } }); $('#nav_ul_list_neu').html(output); $('.fanavlinks').addClass('hidden'); $('#fanavlinks2').removeClass('hidden'); $('.nav_epfall').removeClass('fw700'); $('#neu_navi_link_2').addClass('fw700'); setnavdata("0",navileftid); return; } $.each(navidata, function(key, val){ if ((val.link.search(regex) != -1) || (val.beschriftung.search(regex) != -1)) { output += ''; count++; } }); if (count > 0) { $('.fanavlinks').addClass('hidden'); $('#fanavlinks2').removeClass('hidden'); $('.nav_epfall').removeClass('fw700'); $('#neu_navi_link_2').addClass('fw700'); } if (output == "") { output=''; } $('#nav_ul_list_neu').html(output); }); function setnavdata(epfall_filter, navileftid) { const ratePV = { 'navid': navileftid, 'func': "jsonnavi" }; let output = ''; $.ajax({ type: "GET", url: "//www.gold.de/ajax/data.php", data: ratePV, cache: false, async: true, success: function(antwort) { if (Array.isArray(antwort) || (typeof antwort === 'object' && antwort !== null)) { $.each(antwort, function(key, val) { if (val.empfehlung != Number(epfall_filter)) { output += ``; } }); $('#nav_ul_list_neu').html(output); } else { console.error('Unerwartetes Format der Antwort:', antwort); } } }); } function loadnavdata(navileftid) { if(navidata === undefined){ var ratePV = { 'navid' : navileftid, 'func' : "jsonnavi" }; $.ajax( { type: "GET", url: "//www.gold.de/ajax/data.php", data: ratePV, cache:false, async: true, success: function(antwort) { navidata = antwort; } } ) } return navidata; } // Form Händler für Stad. Formulare $("#stdform").submit(function(e){ e.preventDefault(); $('#stdform').before(showloadingOV); $.get("//www.gold.de/ajax/data.php",$("#stdform").serialize(),function(msg) { document.getElementById('stdform_result').innerHTML = msg; $("#stdform_result").removeClass( "hidden" ); $( "#showloadingajax" ).remove(); }); }); // Form Kommentare auf allen Seiten $('#postForm').submit(function(event) { var comment_dataschutz; $("#sub_com_but").prop('disabled', true); if($('input[name="comment_dataschutz"]').is(':checked')){ comment_dataschutz = "ok"; } var postForm = { 'comment_name' : $('input[name=comment_name]').val(), 'comment_text' : $('textarea[name=comment_text]').val(), 'artikel_id' : $('input[name=artikel_id]').val(), 'page' : $('input[name=page]').val(), 'comment_dataschutz' : comment_dataschutz, 'comment_safecode' : $('input[name=comment_safecode]').val() }; $.ajax({ type : 'POST', url : '//www.gold.de/ajax/add-comment.php', data : postForm, dataType : 'json', cache:false, success : function(data) { $('#throw_error').fadeOut('fast'); if (!data.success) { console.log("error"); if (!data.errors.name) { console.log("show error"); $('#throw_error').show("fast"); $('#throw_error').html(data.errors); $("#sub_com_but").prop('disabled', false); } } else { $("#combox_form").fadeOut("fast"); $('#commbox').fadeOut('fast'); $('#success').fadeIn(1000).append('

' + data.posted + '

'); $("#sub_com_but").prop('disabled', false); } } }); event.preventDefault(); }); $('.comantort').click(function () { $(".anfwortform")/(""); var selectb = $(this).attr("data-id"); $("#antwortformid"+selectb+"")/("Lade Daten"); $("#antwortformid"+selectb+"").load('//www.gold.de/templates/kommentar-antwort-form.php', { 'pid': selectb, 'seite_id': $('input[name=seite_id]').val() } ); }); // Mini Ankaufsrechner $("#miniankaufrechner").submit(function(e){ e.preventDefault(); $.post("//www.gold.de/ajax/ankaufsrechner.php",$("#miniankaufrechner").serialize(),function(msg) { $( "#loadingbox" ).show(); $( "#loadingbox" ).hide(); document.getElementById('calcresult').innerHTML = msg; $("#calcresult").removeClass( "hidden" ) }); }); // Funktion zum anzeigen der Bootstrap popover $('.popoverhoverBewertung').popover({ "html": true, "trigger": "hover", "placement":"right", "content": function(){ var div_id = "tmp-id-" + $.now(); return bewertung_in_popup($(this).attr('data-id'), $(this).attr('data-func'), div_id); } }); function bewertung_in_popup(id, func, div_id){ return '
'; } // Bootstrap Modal öffnen und iframe laden $(".modalframe").click(function(){ if ($(this).attr("data-iframe") !== ""){ $('#IframeModal').modal('show'); $('#IframeModal').find('iframe').attr('src',"https://www.gold.de/"+$(this).attr("data-iframe")); // CSS um den offset zu setzen $('#IframeModal').on('shown.bs.modal', function () { var modalDialog = $(this).find('.modal-dialog'); modalDialog.css('top', '80px'); }); } }); $("#searchInputTable").keyup(function() { var value = $(this).val(); $("#searchThisTable").find("tbody tr").each(function() { if ($(this).text().search(new RegExp(value, "i")) > -1) { $(this).show(); } else { $(this).hide(); } }); }); if(g_device==='mobile') { $('.mainNavItem').click(function(e) { e.preventDefault(); }); } if(g_device==='desktop') { // Tabs Responsive Funktion $('.nav-pills, .nav-tabs').tabdrop('layout'); } $("#q").focusin(function() { $("#dd_autocomp_search").load("https://www.gold.de/ajax/data.php?func=searchmega"); $("#dd_autocomp_search").show(); if(g_device==='mobile') { $('#dd_autocomp_search').width("90%"); } }); $('html').click(function() { if(!$(event.target).is('#q') & !$(event.target).is('#dd_autocomp_search')) { $('#dd_autocomp_search').hide(); } }); // Touch Navigation aktiviren touchNavigation(); // Umrechner $( "#calc_ip_gramm" ).keyup(function() { var ip_gramm = $('#calc_ip_gramm').val(); ip_gramm=ip_gramm.replace(",", "."); $('#calc_ip_oz').val(xformatNumber((ip_gramm/31.103),{'decimal': ',','grouping': '.','fraction': 4,'prefix': '','suffix': ''})); $('#calc_ip_kilo').val(xformatNumber((ip_gramm/1000),{'decimal': ',','grouping': '.','fraction': 4,'prefix': '','suffix': ''})); }); $( "#calc_ip_oz" ).keyup(function() { var ip_oz = $('#calc_ip_oz').val(); ip_oz=ip_oz.replace(",", "."); $('#calc_ip_gramm').val(xformatNumber((ip_oz*31.103),{'decimal': ',','grouping': '.','fraction': 4,'prefix': '','suffix': ''})); $('#calc_ip_kilo').val(xformatNumber(((ip_oz*31.103)/1000),{'decimal': ',','grouping': '.','fraction': 4,'prefix': '','suffix': ''})); }); $( "#calc_ip_kilo" ).keyup(function() { var ip_kilo = $('#calc_ip_kilo').val(); ip_kilo=ip_kilo.replace(",", "."); $('#calc_ip_gramm').val(xformatNumber((ip_kilo/1000),{'decimal': ',','grouping': '.','fraction': 4,'prefix': '','suffix': ''})); $('#calc_ip_oz').val(xformatNumber(((ip_kilo/1000)*31.103),{'decimal': ',','grouping': '.','fraction': 4,'prefix': '','suffix': ''})); }); // Ausgehende Klick auf Klasse mit data-gotoid $(".btn-gotoid").click(function(){ var gotid = $(this).attr("data-gotoid"); if (gotid !== undefined){ window.open("//www.gold.de/goto/index.php?"+ $(this).attr("data-gotoid") +"", '_blank'); } }); $('.mobiletoggle').click(function (event) { event.preventDefault(); var target = $(this).attr('href'); $(target).toggleClass('hidden-xs visible-xs-block'); $(this).toggleClass('hidden-xs visible-xs-block'); }); // Mobil Suche ein und ausblenden $(".hiconlink_search").click(function() { $("#hmidsearch").css("display", "block"); $("#searcheintrag").css("float", "left"); $("#searcheintrag").css("width", "85%"); $(".hiconlink_search").css("display", "none"); $("#hiconsearch_hide").css("display", "block"); $("#hiconsearch_hide_but").css("display", "block"); $('.hiconlink').addClass('hidden'); }); $("#hiconsearch_hide_but").click(function() { $("#hmidsearch").css("display", "none"); $(this).css("display", "none"); $(".hiconlink_search").css("display", "block"); $("#hiconsearch_hide").css("display", "none"); $('.hiconlink').removeClass('hidden'); }); // Favoriten Button $("#favbut").click(function() // Favoritenliste laden { $("#FAVreport").html("Lade..."); $.ajax( { type: "GET", cache:false, url: "//www.gold.de/ajax/favoriten.php", success: function(antwort){ $("#FAVreport").html(antwort); } } ); }); // Slidebar für das Mobile Burgermenue $.slidebars({ siteClose: true, scrollLock: true, disableOver: 767, hideControlClasses: true // true or false }); // Charts Auswahl in der Sidebar // Tabs $(document).on('click', '.tab_minichart', function(e) { $(".tab_minichart").removeClass('active'); $(this).addClass('active'); var mini_chart_cur = $(this).attr("data-id"); $.ajax( { type: "GET", cache:false, url: "//www.gold.de/ajax/data.php?func=minicharts&do=" + encodeURIComponent(mini_chart_cur), success: function(antwort){ $("#chart_test").html(antwort); liveXmetallpreise(); } } ); }); // GFX Charts $(document).on('click', '.ButMinichart', function() { var $this = $(this); var $allButtons = $(".ButMinichart"); $allButtons.removeClass("cbraun").addClass("cgrau"); $this.removeClass("cgrau").addClass("cbraun"); var imgTime = $this.attr("data-time"); var imgCur = $this.attr("data-cur"); var imgMetall = $this.attr("data-metall"); var imgTarget = $this.attr("data-target"); var newIMG = "//charts.gold.de/mini/" + imgMetall + "kurs_" + imgTime + "_" + imgCur + ".jpg"; var currentTime = new Date().getTime(); $("#" + imgTarget).attr("src", newIMG + "?t=" + currentTime); }); function youtube_parser(url){ var regExp = /^https?\:\/\/(?:www\.youtube(?:\-nocookie)?\.com\/|m\.youtube\.com\/|youtube\.com\/)?(?:ytscreeningroom\?vi?=|youtu\.be\/|vi?\/|user\/.+\/u\/\w{1,2}\/|embed\/|watch\?(?:.*\&)?vi?=|\&vi?=|\?(?:.*\&)?vi?=)([^#\&\?\n\/<>"']*)/i; var match = url.match(regExp); return (match && match[1].length==11)? match[1] : false; } var xYT = 1; $('gvideo[data*="youtu"],gvideo[data*="vimeo"]').each(function(){ var video = $(this); video.addClass('video_object'+xYT); var sourceLink = video.attr('data-src').replace('-nocookie', ''); var sourceLinkShort = jQuery.trim(sourceLink).substring(0, 30) + "..."; video.wrap('
'); video.parent('.video_objectoverlay').append('

Ich bin damit einverstanden, dass mir externe Inhalte angezeigt werden. Damit können personenbezogene Daten an Drittplattformen übermittelt werden.
Video abspielen

'); var videoIMG = 'https://thumbs.gold.de/ytimage.php?w=1200&img=' + youtube_parser(video.attr('data-src')) + ''; $('#vidDiv'+xYT).css('background-image', 'url(' + videoIMG + ')'); xYT++; }); // Bei Klick auf einen Unlock-Button ... $('#unlockobject[class*=video_object]').on('click', function () { var relatediframe = $(this).attr('class'); var videosource = $('gvideo.'+relatediframe).attr('data-src'); var videoID = youtube_parser(videosource); $('gvideo.'+relatediframe).attr('data',$('gvideo.'+relatediframe).attr('data-src')); $('gvideo.'+relatediframe).html('
'); $('gvideo.'+relatediframe).unwrap(); $('gvideo.'+relatediframe+' + div').remove(); }); var cls = document.getElementsByClassName('antiCls'), i = cls.length; for (i = 0; i < cls.length; i++) { cls[i].style.visibility = "visible"; } });