| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- function getUrl(value)
- {
- return location.protocol + '//' + location.host + '/' + value;
- }
- $(document).ready(function(){
- $(window).scroll(function(){
- var pos = $(window).scrollTop();
- if(pos >= 30){
- $('.main-header').css('position','fixed');
- $('.main-header').css('top','0');
-
- }else{
- $('.main-header').css('position','relative');
- $('.main-header').css('top','0');
- }
- });
-
- //login
- $('.login-system, .btn-login-system, .signup-system').click(function(){
- var isSignUp = $(this).attr('signup');
- if( $('#modal-sign-in').length ) {
- if(isSignUp == undefined){
- $('#modal-sign-in').modal();
- }else{
- $('#modal-sign-up').modal();
- }
- }else{
- $.ajaxSetup({
- headers: {
- 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
- }
- });
-
- $.ajax({
- url: getUrl('get-login'),
- type: "POST",
- data: {
-
- },
- success: function(result){
- console.log(result);
- $('body').append(result);
- if(isSignUp == undefined){
- $('#modal-sign-in').modal();
- }else{
- $('#modal-sign-up').modal();
- }
-
- }
- });
- }
-
- });
-
- });
- function open_login_g(){
- var curUrl = $('#current-url').val();
- if(curUrl == undefined){
- curUrl = "";
- }
- fb_login=window.open(getUrl("login-google?l="+curUrl),'name','width='+screen.width+',height='+screen.height+',top=0,left=0'+',fullscreen=yes');
- };
- function open_login_f(){
- var curUrl = $('#current-url').val();
- if(curUrl == undefined){
- curUrl = "";
- }
- fb_login=window.open(getUrl("login-facebook?l="+curUrl),'name','width='+screen.width+',height='+screen.height+',top=0,left=0'+',fullscreen=yes');
- }
- function open_f_login(){
- var curUrl = $('#current-url').val();
- if(curUrl == undefined){
- curUrl = "";
- }
- fb_login=window.open(getUrl("facebook-login?l="+curUrl),'name','width='+screen.width+',height='+screen.height+',top=0,left=0'+',fullscreen=yes');
- }
- function redirect()
- {
- fb_login.close();
- self.location = getUrl('library');
- }
- function redirectFacebook(link)
- {
- fb_login.close();
- open_f_login();
- }
- $(document).on('click', '.main-header-cover .header-language .dropdown-menu li a', function(){
- var lang = $(this).attr('val');
- $('#input-set-language').val(lang);
- $('#form-set-language').submit();
- });
- $(document).on('click', '.header-middle', function(){
- amimateUpDown($('.main-header-cover .header-menu'));
- amimateUpDown($('.main-header-cover .header-right'));
- });
- function amimateUpDown(element){
- if($(element).hasClass('menu-show')){
- $(element).slideUp('fast',function(){
- $(element).removeClass('menu-show');
- });
- }else{
- $(element).slideDown('fast',function(){
- $(element).addClass('menu-show');
- });
- }
- }
|