$(document).ready(function() { var pagetop = $('.pagetop'); $(window).scroll(function () { if ($(this).scrollTop() > 100) { pagetop.fadeIn(); } else { pagetop.fadeOut(); } }); pagetop.click(function () { $('body, html').animate({ scrollTop: 0 }, 500); return false; }); }); $(function(){ /*var $last_modal_target; var is_login_success = false; $(document).on('show.bs.modal', '.modal', function(e){ $last_modal_target = $(e.relatedTarget); }); $(document).on('hidden.bs.modal', '.modal', function(){ if (is_login_success) { is_login_success = false; setTimeout(function() {$last_modal_target.click()}, 500); } });*/ $(document).on('hidden.bs.modal', '.modal', function(){ $(this).removeData('bs.modal'); $('.modal-content', this).empty(); }); $(document).on('submit', "#signin-form,#signin-form-article", function(e) { var fd = { auto_login: $(this).find("input[name=auto_login]:checked").val(), }; $(this).find("input").each(function() { if ($(this).attr("type") != "checkbox") { fd[$(this).attr("name")] = $(this).val(); } }); $.ajax({ type: "POST", url: $(this).attr("action"), data: fd, dataType: "text", beforeSend: function() { //$file_form.closest(".img-form-box").find(".img-form-thumb").html(""); }, success: function(data, dataType) { if (data) { $(e.target).find(".signin-message").addClass("alert alert-danger").html(data); } else { /*if ($(e.target).attr("id") == "signin-form-article") { is_login_success = true; $('#greetingModal').modal('hide'); } else { location.reload(); }*/ $.ajax({ type: "POST", url: "../../session_share.php", xhrFields: { withCredentials: true }, data: {PHPSESSID: $.cookie("PHPSESSID")}, dataType: "text", complete: function(data, dataType) { location.reload(); }, }); } }, error: function() { }, complete: function() { } }); return false; }); }); /*--------------------------------------------------------------------------* * jQuery Textresizer *--------------------------------------------------------------------------*/ jQuery(document).ready( function() {   $(document).ready(function(){ jQuery( "#fontSwitch a" ).textresizer({ target: "#wrapper", type: "cssClass", sizes: [ "f1", "f2", "f3" ] });   }); }); /*--------------------------------------------------------------------------* * Telephone *--------------------------------------------------------------------------*/ $(function(){ var ua = navigator.userAgent; if(ua.indexOf('iPhone') > 0 || ua.indexOf('Android') > 0){ $('.tel-link').each(function(){ var str = $(this).text(); $(this).html($('').attr('href', 'tel:' + str.replace(/-/g, '')).append(str + '')); }); } });