| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529 |
- var vocaConfig = {
- 'isLogin':false,
- 'loginPage' : 'my-library'
- };
- function urlConfig(link){
- return window.location.protocol+'//'+window.location.host+'/'+link;
- }
- // check rule email
- function checkEmail(email) {
- var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
- return re.test(email);
- };
- //get domain url
- function url($ajaxlink){
- return location.protocol+'//'+location.host+'/assets/assets-v2/js/'+$ajaxlink;
- }
- $( document ).ready(function(){
- $('#alert-message-success-default').fadeIn('slow');
- $('#alert-message-success-default').delay(2500).fadeOut('slow');
- $('#alert-message-error-default').fadeIn('slow');
- $('#alert-message-error-default').delay(2500).fadeOut('slow');
- $('.icon').click(function (a) {
- $('#side-nav').css({
- 'z-index': '-2'
- });
- a.preventDefault();
- var b = '260px';
- var c = '-280px';
- var d = '300px';
- var e = '-300px';
- var f = 200;
- if ($('body').hasClass('menu-open')) {
- var b = '0px';
- var c = '0px';
- var f = 100;
- } else $('#voca-wrap').css({
- 'position': 'fixed'
- });
- $("#side-nav").show();
- $("#side-nav").stop().animate({
- width: '600px'
- }, {
- duration: 150,
- queue: false,
- complete: function () {
- $(this).stop().animate({
- 'width': '275px','z-index':'1000'
- }, {
- duration: f,
- queue: false
- });
- $('body').addClass('menu-open');
- }
- });
-
- $("#top-nav, #voca-wrap").stop().animate({
-
- left: d,
- right: e
- }, {
- duration: 150,
- queue: false,
- complete: function () {
-
- $(this).stop().animate({
- left: b,
- right: c
- }, {
- duration: f,
- queue: false,
- complete: function () {
- if (b == '0px') {
- $('body').removeClass('menu-open');
- $('#voca-wrap').css({
- 'position': 'relative'
- });
- $('#side-nav').css({
- 'z-index': '-2'
- });
- $('#close-menu-overlay').remove();
-
- }
- }
- });
- if ($('#close-menu-overlay').length == 0) $('body').append('<a href="#" id="close-menu-overlay"></a>');
- }
- });
- $('.icon-menu').toggleClass('fa-bars').toggleClass('fa-chevron-left');
- });
-
- $(document).on("click", '#close-menu-overlay', function (a) {
- a.preventDefault();
- $('.intro-text-menu.icon').trigger('click');
- });
-
- });;
- $(document).ready(function(){
- console.log("Ready");
- /*if(vocaConfig.isLogin == false){
- $(function(){
- var dom = $('#modal-login-system');
- if(dom != undefined){
- $.ajax({
- url: urlConfig('auth/signin'),
- type: 'GET'
- }).success(function(data){
- $('#modal-login-system').html(data);
- });
- }
-
- });
- }*/
- $(document).on('keypress','#email-login, #password-login',function(e){
- if(e.keyCode == 13){
- $( "#btn-login-system" ).trigger( "click" );
- }
- });
- $('#content-login-loading').removeClass('fullwidth');
- $(document).on('click','#btn-login-system',function(){
- var email = $('#email-login').val();
- var password = $('#password-login').val();
- var curUrl = $('#current-url').val();
- if(curUrl == undefined){
- curUrl = "";
- }
- var rememberPass = 0;
- if(email == ""){
- $('.login-msg').html(emailNotEmpty);
- return false;
- }else{
- $('.login-msg').html('');
- }
- if(password == ""){
- $('.login-msg').html(passNotEmpty);
- return false;
- }else{
- $('.login-msg').html('');
- }
- if($('#login-remember-pass').is(':checked')){
- rememberPass = 1;
- }
- $('#content-login-loading').removeClass('fullwidth').queue(function(next){
- $(this).addClass('fullwidth');
- next();
- });
- $.ajax({
- url : urlConfig('auth/signin'),
- data : {
- email : email,
- password : password,
- rememberPass : rememberPass,
- curUrl: curUrl
- },
- headers: {
- 'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
- },
- type: 'POST'
- }).success(function(data){
-
- $('#content-login-loading').removeClass('fullwidth');
- $('.login-msg').html('');
- if(data.length > 2000){
- $('body').append(data);
- $('#modal-login-system').modal('hide');
- $('#register-msg-modal').modal();
- }else{
- if(data.email){
- $('.login-msg').html(data.email.toString());
- }else{
- $('.login-msg').html('');
- }
- if(data.password){
- $('.login-msg').html(data.password.toString());
- }else{
- $('.login-msg').html('');
- }
- if(!data.email && !data.password){
- if(data[0] != "success"){
- $('.login-msg').html(data);
- }else{
- $('#email-login').val('');
- $('#password-login').val('');
- $('#modal-login-system').modal('hide');
- window.location.href = urlConfig(data[1]);
- }
- }
- }
-
- });
- });
- $('#content-register-loading').removeClass('fullwidth');
-
-
- });
- function redirect()
- {
- fb_login.close();
- self.location = urlConfig(vocaConfig.loginPage);
- }
- /*function open_login_f(){
- var curUrl = $('#current-url').val();
- fb_login=window.open(urlConfig('auth/login-facebook/'+curUrl),'name');
- }
- function open_login_g(){
- var curUrl = $('#current-url').val();
- fb_login=window.open(urlConfig('auth/login-google/'+curUrl),'name');
- };*/
- $(document).ready(function(){
- //get link
- /*if(vocaConfig.isLogin == false){
- $(function(){
- var dom = $('#modal-signup-system');
- if(dom != undefined){
- $.ajax({
- url: urlConfig('auth/signup'),
- type: 'GET'
- }).success(function(data){
- $('#modal-signup-system').html(data);
- });
- }
- });
- }*/
-
- $('#slt-provinces').val(0);
-
- //when user select a any province system auto display districts of that province
- $('#slt-provinces').change(function(){
- var id = $(this).val();
- if(id!=0){
-
- //route into get-districts to get districts of a province when user select
- $.post(urlConfig('auth/get-districts'),{provinceId: id},function(data){
- $('#first-option').siblings().remove();
- for (var index = 0; index < data.length; ++index) {
- $("<option value='"+data[index]['id']+"'>"+data[index]['name']+"</option>").insertAfter("#first-option");
- }
- });
- }else{
- $('#first-option').siblings().remove();
- }
-
- });
- //verify format email
- $(document).on('blur','#email-register, #email-register-now',function(){
- /*var email = $(this).val();
- if(email == ""){
- $('.msg-email-register-error').html(emailNotEmpty);
- return false;
- }else{
- $('.msg-email-register-error').html('');
- }
- $.ajax({
- url: urlConfig('auth/verify-email-format'),
- data: {
- email:email
- },
- type:"POST",
- async: false
- }).success(function(data) {
- if(data == 0){
- $('.msg-email-register-error').html(emailWrongFormat);
- }else{
- $('.msg-email-register-error').html('');
- }
- });*/
- });
- //focus email input
- $(document).on('focus','#email-register, #email-register-now',function(){
- $('.msg-email-register-error').html(recommendEmailGoogle);
- });
-
- //refresh-register-captcha
- $(document).on('click','#refresh-register-captcha',function(){
- $.ajax({
- url: urlConfig("auth/get-captcha"),
- type:"POST"
- }).success(function( data) {
- $("#recaptcha-image").attr("src",data);
- });
- });
-
- //refresh-register-now-captcha
- $(document).on('click','#refresh-register-now-captcha',function(){
- $.ajax({
- url: urlConfig("auth/question-protect"),
- type:"POST"
- }).success(function( data) {
- $('#question-id-register-now-protect').val(data[0]);
- $('#question-register-now-protect').html(data[1]);
- });
- });
-
- $('#content-signup-loading').removeClass('fullwidth');
- //register system
- $(document).on('click','#btn-register-system',function(){
- if($('#agree-register-service').is(':checked')){
- $('.msg-agree-service-error').html('');
-
- var registerToken = $('input[name="register_token"]').val();
- var email = $('#email-register').val();
- var password = $('#password-register').val();
- var captcha = $('#captcha-register').val();
- var name = $('#full-name-register').val();
- var username = $('#username-register').val();
- var questionId = $('#question-register-protect').attr('question-id');
- var agree = 1;
- var curUrl = $('#current-url').val();
- if(curUrl == undefined){
- curUrl = "";
- }
- if(name == ""){
- $('.register-msg').html(fullNameNotEmpty);
- return false;
- }else{
- $('.register-msg').html('');
- }
- if(username == ""){
- $('.register-msg').html(userNameNotEmpty);
- return false;
- }else{
- $('.register-msg').html('');
- }
- if(email == ""){
- $('.register-msg').html(emailNotEmpty);
- return false;
- }else{
- $('.register-msg').html('');
- }
- if(password == ""){
- $('.register-msg').html(passNotEmpty);
- return false;
- }else{
- $('.register-msg').html('');
- }
- if(captcha == ""){
- $('.register-msg').html(captchaNotEmpty);
- return false;
- }else{
- $('.register-msg').html('');
- }
- $('#content-signup-loading').removeClass('fullwidth').queue(function(next){
- $(this).addClass('fullwidth');
- next();
- });
-
- $.blockUI({
- message:vocaLang.pleaseWaitVoca,
- css: {
- border: 'none',
- padding: '15px',
- backgroundColor: '#000',
- '-webkit-border-radius': '2px',
- '-moz-border-radius': '2px',
- 'z-index':'11000',
- opacity: .5,
- color: '#fff'}
- });
- $.ajax({
- url : urlConfig('auth/signup'),
- data : {
- email : email,
- password : password,
- captcha : captcha,
- full_name : name,
- username : username,
- agree : agree,
- register_token: registerToken,
- curUrl : curUrl
- },
- headers: {
- 'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
- },
- type: 'POST'
- }).success(function(data){
- $.unblockUI();
- $('#content-signup-loading').removeClass('fullwidth');
- $('.register-msg').html('');
- $('#password-register').val('');
- $('#captcha-register').val('');
- jQuery('#refresh-register-captcha').click();
- if(data.email){
- $('.register-msg').html(data.email.toString());
- return false;
- }else{
- $('.register-msg').html('');
- }
- if(data.username){
- $('.register-msg').html(data.username.toString());
- return false;
- }else{
- $('.register-msg').html('');
- }
- if(data.password){
- $('.register-msg').html(data.password.toString());
- return false;
- }else{
- $('.register-msg').html('');
- }
- if(data.captcha){
- $('.register-msg').html(data.captcha.toString());
- return false;
- }else{
- $('.register-msg').html('');
- }
- if(data.full_name){
- $('.register-msg').html(data.full_name.toString());
- return false;
- }else{
- $('.register-msg').html('');
- }
- if(!data.email && !data.password && !data.captcha && !data.full_name){
- if(data[0] != "success"){
- $('.register-msg').html(data);
- $('#password-register').val('');
- $('#captcha-register').val('');
- jQuery('#refresh-register-captcha').click();
- }else{
- $('#email-register').val('');
- $('#password-register').val('');
- $('#captcha-register').val('');
- $('#full-name-register').val('');
- $('#username-register').val('');
- if(data[1] == ""){
- window.location.href = urlConfig('my-library');
- }else{
- window.location.href = urlConfig(data[1]);
- }
-
- }
- }else{
- $('#password-register').val('');
- $('#captcha-register').val('');
- jQuery('#refresh-register-captcha').click();
- }
- });
- }else{
- $('.msg-agree-service-error').html(selectAgreeService);
- }
-
- });
-
- $('#month-birth').change(function(){
- var month = $('#month-birth').val();
- var date = $('#date-birth').val();
- var year = $('#year-birth').val();
- var valueMonth = 1;
- var monthThirty = ["4","6","9","11"]
- if(month == 2){
- if((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0)){
- valueMonth = 29;
- }else{
- valueMonth = 28;
- }
- }else if(monthThirty.indexOf(month) != -1){
- valueMonth = 30;
- }else{
- valueMonth = 31;
- }
- $('.flag-date').siblings().remove();
- for(var i = 1; i<= valueMonth; i++){
- if(date == i ){
- $('<option value="'+i+'" selected="selected">'+i+'</option>').insertBefore('.flag-date');
- }else{
- $('<option value="'+i+'">'+i+'</option>').insertBefore('.flag-date');
- }
- }
- });
-
- $('#year-birth').change(function(){
- var month = $('#month-birth').val();
- var date = $('#date-birth').val();
- var year = $('#year-birth').val();
- var valueMonth = 1;
- var monthThirty = ["4","6","9","11"]
- if(month == 2){
- if((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0)){
- valueMonth = 29;
- }else{
- valueMonth = 28;
- }
- }else if(monthThirty.indexOf(month) != -1){
- valueMonth = 30;
- }else{
- valueMonth = 31;
- }
- $('.flag-date').siblings().remove();
- for(var i = 1; i<= valueMonth; i++){
- if(date == i ){
- $('<option value="'+i+'" selected="selected">'+i+'</option>').insertBefore('.flag-date');
- }else{
- $('<option value="'+i+'">'+i+'</option>').insertBefore('.flag-date');
- }
- }
- });
-
- $(document).on('change','.logon',function(){
- var value = $('input[name=logon]:checked').val();
- if(value == 1){
- $('.login-now').slideUp();
- $('.register-now').slideDown();
- }else{
- $('.register-now').slideUp();
- $('.login-now').slideDown();
- }
- });
- $(document).on('click','#register-by-voca',function(e){
- e.preventDefault();
- if($(this).hasClass('show-register')){
- $(this).html(vocaLang.useSocialAccount);
- $('.register-by-voca').slideDown();
- $(this).removeClass('show-register');
- $(this).addClass('hide-register');
- }else{
- $(this).html(vocaLang.useVocaAccount);
- $('.register-by-voca').slideUp();
- $(this).removeClass('hide-register');
- $(this).addClass('show-register');
- }
- });
-
- $(document).on('click','.modal-register-system',function(){
- $('#modal-login-system').modal('hide');
- });
-
- $('#content-register-loading').removeClass('fullwidth');
- });
- function redirect(url)
- {
- fb_login.close();
- if(url == ""){
- self.location=urlConfig(vocaConfig.loginPage);
- }else{
- self.location=urlConfig(url);
- }
-
- }
- function open_login_f(){
- var curUrl = $('#current-url').val();
- if(curUrl == undefined){
- curUrl = "";
- }
- fb_login=window.open(urlConfig("auth/login-facebook/"+curUrl),'name','width='+screen.width+',height='+screen.height+',top=0,left=0'+',fullscreen=yes');
- }
- function open_login_g(){
- var curUrl = $('#current-url').val();
-
- if(curUrl == undefined){
- curUrl = "";
- }
-
- fb_login=window.open(urlConfig("auth/login-google/"+curUrl),'name','width='+screen.width+',height='+screen.height+',top=0,left=0'+',fullscreen=yes');
- };
-
- /* USER VOICE API */
- /*(function(){var uv=document.createElement('script');uv.type='text/javascript';uv.async=true;uv.src='//widget.uservoice.com/ZRfBjfeBHZzNxDpNGWisA.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(uv,s)})()
- UserVoice = window.UserVoice || [];
- UserVoice.push(['showTab', 'classic_widget', {
- mode: 'full',
- primary_color: '#133F69',
- link_color: '#FFCE0F',
- default_mode: 'feedback',
- forum_id: 241081,
- support_tab_name: vocaLang.contact,
- feedback_tab_name: vocaLang.feedback,
- tab_label: 'Feedback',
- tab_color: '#ECC21B',
- tab_position: 'bottom-right',
- tab_inverted: false
- }]);*/
- /* USER REPORT API */
- /*var _urq = _urq || [];
- _urq.push(['initSite', '8f7a2bd2-67f8-4a17-b058-9790418273f7']);
- (function() {
- var ur = document.createElement('script'); ur.type = 'text/javascript'; ur.async = true;
- ur.src = ('https:' == document.location.protocol ? 'https://cdn.userreport.com/userreport.js' : 'http://cdn.userreport.com/userreport.js');
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ur, s);
- })();
- ;*/
- $(document).ready(function(){
- function getUrl(link){
- return location.protocol+'//'+location.host+'/library/'+link;
- }
- $('.search-topic').keyup(function(e){
- var keyWord = $(this).val();
- if(e.keyCode == 13 && keyWord !=""){
- $.ajax({
- url: getUrl("search-topic"),
- data: {
- keyWord: keyWord
- },
- type: "POST"
- }).done(function(data) {
- $('.tab-content').html(data);
- $('.search-topic').val('');
- });
- }
- });
- });;
- $(document).ready(function(){
- //rating
- $('.click-rating').click(function(event){
- var topic = $(this).attr('topic');
- var id = $(this).attr('id');
- event.preventDefault();
- $.ajax({
- url: urlConfig("rating-topic"),
- data: {
- topicId:topic,
- },
-
- type:"POST"
-
- }).success(function(data) {
- $('.is_rated').html('<a href="javascript:void(0)" class="rating" onclick="return false;" ><img src="'+urlConfig('assets/imgs/star_dark.png')+'"/></a><p>Ðánh giá</p>')
- });
- });
-
-
- //click to learn
- /*$('.learn-question').click(function(){
- var childrenTopic = $(this).attr('childrenTopic');
- var parentTopic = $(this).attr('parentTopic');
- $('#learn-unknow').attr('href',urlConfig('learning/'+childrenTopic+'-'+parentTopic+'-unknow'));
- $('#learn-all').attr('href',urlConfig('learning/'+childrenTopic+'-'+parentTopic));
- $('#learn-question').modal('show');
- });*/
-
-
- });
- ;
- $(document).ready(function(){
- $('.warning-alert').fadeIn(5000);
- $('.active-product-button').click(function(){
- $.blockUI(
- {
- message: vocaLang.pleaseWaitVoca,
- css: {
- border: 'none',
- padding: '15px',
- backgroundColor: '#000',
- '-webkit-border-radius': '2px',
- '-moz-border-radius': '2px',
- opacity: .5,
- color: '#fff'
- }}
- );
- });
- });
- ;
- $(document).ready(function(){
- $('.speaker').click(function(){
- var val = $(this).attr('attr');
- $('.audio-'+val).get(0).play();
- });
-
- });;
- $(document).ready(function(){
- //get domain url
- function url($ajaxlink){
- return location.protocol+'//'+location.host+'/'+$ajaxlink;
- }
- $('.show-more-user').click(function(){
- var topicId = $(this).attr('showId');
- var parentTopic = $(this).attr('parentTopic');
- var start = $(this).attr('count');
- var index = parseInt(start)+10;
- $('.show-more-user').attr('count',index);
- $.ajax({
- url: url("show-more-user-topic-child"),
- data: {
- topicId:topicId,
- start: start,
- parentTopic:parentTopic
- },
- type:"POST"
- }).success(function(data) {
- if(data!=""){
- $(data).insertBefore('.flag-show-more');
- }else{
- $('.show-more').html('');
- }
-
- });
- });
-
- $('.show-more-user-parent').click(function(){
- var topicId = $(this).attr('showId');
- var start = $(this).attr('count');
- var index = parseInt(start)+10;
- $('.show-more-user-parent').attr('count',index);
- $.ajax({
- url: url("show-more-user"),
- data: {
- topicId:topicId,
- start: start
- },
- type:"POST"
- }).success(function(data) {
-
- if(data!=""){
- $('.list-user-learn').append(data);
- //$(data).insertBefore('.flag-show-more');
- }else{
- $('.show-more-user-parent').css('display','none');
- }
- });
- });
-
- //click to learn
- $('.learn-question').click(function(){
- var childrenTopic = $(this).attr('childrenTopic');
- var parentTopic = $(this).attr('parentTopic');
- var isDontKnowWord = $(this).attr('isDontKnowWord');
- var isLearContext = parseInt($(this).attr('learn_context'));
- if(isLearContext == 1){
- $('.learning-context-btn').css('display','inline-block');
- }else{
- $('.learning-context-btn').css('display','none');
- }
- $('.learning-flashcard-btn').attr('url',urlConfig('learning/'+childrenTopic+'-'+parentTopic));
- $('.learning-writing-btn').attr('url',urlConfig('learning-writing/'+childrenTopic+'-'+parentTopic));
- $('.learning-speaking-btn').attr('url',urlConfig('learning-speaking/'+childrenTopic+'-'+parentTopic));
- $('.learning-context-btn').attr('url',urlConfig('learning-context/'+childrenTopic+'-'+parentTopic));
- if(isDontKnowWord == 1){
- $('.flashcard-unknow').attr('href',urlConfig('learning/'+childrenTopic+'-'+parentTopic+'-unknow'));
- $('.flashcard-unknow').html('<button type="button" class="btn-learn-new learn-unknow-word-btn" >'+vocaLang.learn_unknow+'</button>');
- $('.writing-unknow').attr('href',urlConfig('learning-writing/'+childrenTopic+'-'+parentTopic+'-unknow'));
- $('.writing-unknow').html('<button type="button" class="btn-learn-new learn-unknow-word-btn" >'+vocaLang.learn_unknow+'</button>');
- $('.speaking-unknow').attr('href',urlConfig('learning-speaking/'+childrenTopic+'-'+parentTopic+'-unknow'));
- $('.speaking-unknow').html('<button type="button" class="btn-learn-new learn-unknow-word-btn" >'+vocaLang.learn_unknow+'</button>');
- $('.context-unknow').attr('href',urlConfig('learning-context/'+childrenTopic+'-'+parentTopic+'-unknow'));
- $('.context-unknow').html('<button type="button" class="btn-learn-new learn-unknow-word-btn" >'+vocaLang.learn_unknow+'</button>');
- }else{
- $('.flashcard-unknow').attr('href','');
- $('.flashcard-unknow').html('');
- $('.writing-unknow').attr('href','');
- $('.writing-unknow').html('');
- $('.speaking-unknow').attr('href','');
- $('.speaking-unknow').html('');
- $('.context-unknow').attr('href','');
- $('.context-unknow').html('');
- }
- $('.flashcard-learn-all').attr('href',urlConfig('learning/'+childrenTopic+'-'+parentTopic));
- $('.writing-learn-all').attr('href',urlConfig('learning-writing/'+childrenTopic+'-'+parentTopic));
- $('.speaking-learn-all').attr('href',urlConfig('learning-speaking/'+childrenTopic+'-'+parentTopic));
- $('.context-learn-all').attr('href',urlConfig('learning-context/'+childrenTopic+'-'+parentTopic));
- $('.choose-learn-words').attr('topic',childrenTopic);
- $('.choose-learn-words').attr('parent',parentTopic);
- $('#diary-form-choose-learn-words').attr('action',urlConfig('learning/'+childrenTopic+'-'+parentTopic))
- $('#learn-question').modal('show');
- });
- //click to test review
- $('#btn-test-review').click(function(){
- document.cookie = "testReview=testReview;path=/";
- });
- });;
- $( document ).ready(function() {
- // open video in learning guide page
- $(".voca-video-features-video").click(function(){
- var id = $(this).attr('video');
- $("#voca-overlay-box-"+id+",#voca-overlay-"+id).css("display","block");
- });
- // close video and stop video in learning guide page
- $(".voca-overlay-wrapper .close").click(function(){
- var id = $(this).attr('wrapper');
- $("#voca-overlay-box-"+id+",#voca-overlay-"+id).css("display","none");
- var video = $("#player-video-"+id).attr("src");
- $("#player-video-"+id).attr("src","");
- $("#player-video-"+id).attr("src",video);
- });
- // open video in library detail page
- $(".voca-video-features-video-a").click(function(){
- $("#voca-overlay-box,#voca-overlay").css("display","block");
- $('#ground-span').fadeIn();
- });
- // close video and stop video in library detail page
- $(".voca-overlay-wrapper .close,#ground-span").click(function(){
- $("#voca-overlay-box,#voca-overlay").css("display","none");
- $('#ground-span').fadeOut();
- var video = $("#player-video").attr("src");
- $("#player-video").attr("src","");
- $("#player-video").attr("src",video);
-
- });
- });;
- $(document).ready(function(){
- /*$(function(){
- var discount = $("input[name='payment_method']:checked").attr('discount');
- var totalMoney = $('#total-money').val();
- var discountvalue = $('#total-money').attr('discountvalue');
- var discountPromotion = $('#promotion_code').attr('discount');
- if(discountPromotion == 0){
- discountPromotion = discountvalue;
- if($('#discount-reference').length){
- var domDiscountReference = $('#discount-reference')[0].outerHTML;
- }
- }
- if(discount){
- if(discount > 0){
- if(discountPromotion > 0){
- var discountMoney = parseInt(discount) + parseInt(discountPromotion);
- }else{
- var discountMoney = discount;
- }
- var payMoney = totalMoney - discountMoney;
- if(domDiscountReference){
- $('.total-value-item').html(domDiscountReference+'<div><span class="value-text">'+vocaLang.money+' </span><span class="value-number total-money">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.discountMoney+'</span><span class="value-number discount-money">'+discountMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+payMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }else{
- $('.total-value-item').html('<div><span class="value-text">'+vocaLang.money+' </span><span class="value-number total-money">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.discountMoney+'</span><span class="value-number discount-money">'+discountMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+payMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }
-
- }else{
- if(discountPromotion > 0){
- var payMoney = totalMoney - discountPromotion;
- if(domDiscountReference){
- $('.total-value-item').html(domDiscountReference+'<div><span class="value-text">'+vocaLang.money+' </span><span class="value-number total-money">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.discountMoney+'</span><span class="value-number discount-money">'+discountPromotion.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+payMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }else{
- $('.total-value-item').html('<div><span class="value-text">'+vocaLang.money+' </span><span class="value-number total-money">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.discountMoney+'</span><span class="value-number discount-money">'+discountPromotion.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+payMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }
-
- }else{
- $('.total-value-item').html('<div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }
- }
- }
- });
- $(function(){
- var promotionCodeValue = $('#promotion_code').val();
- if(promotionCodeValue != "" && promotionCodeValue!= undefined) {
- $('#promotion-code').attr('checked','checked');
- $('.div-promotion').css('display','block');
- var promotionCode = $('#promotion_code').val();
- var productId = $('#product_id').val();
- if(promotionCode !=""){
- $.ajax({
- url: urlConfig("check-promotion-code"),
- data: {
- promotionCode:promotionCode,
- productId:productId
- },
- type:"POST"
- }).success(function(data) {
- // var discountGateway = $("input[name='payment_method']:checked").attr('discount');
- discountGateway = 0;
- var totalMoney = $('#total-money').val();
- if(data == "not exist"){
- $('#promotion_code').attr('discount',0);
- var discountValue = $('#total-money').attr('discountvalue');
- if(discountValue > 0){
- var payMoney = totalMoney - discountValue - discountGateway ;
- $('.total-value-item').html('<div><span class="value-text">'+vocaLang.money+' </span><span class="value-number total-money">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.discountMoney+'</span><span class="value-number discount-money">'+(parseInt(discountGateway) + parseInt(discountValue)).toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+payMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }else{
- if(discountGateway > 0){
- var payMoney = totalMoney - discountGateway ;
- $('.total-value-item').html('<div><span class="value-text">'+vocaLang.money+' </span><span class="value-number total-money">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.discountMoney+'</span><span class="value-number discount-money">'+discountGateway.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+payMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }else{
- $('.total-value-item').html('<div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }
- }
-
- $('.apply-promotion-code-result').text(vocaLang.promotionNotExist);
- $('.apply-promotion-code-result').css('color','#F00');
- }else{
-
- var discountMoney = data;
- $('#promotion_code').attr('discount',discountMoney);
- var payMoney = totalMoney - discountMoney - discountGateway;
- $('.total-value-item').html('<div><span class="value-text">'+vocaLang.money+' </span><span class="value-number total-money">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.discountMoney+'</span><span class="value-number discount-money">'+(parseInt(discountGateway) + parseInt(discountMoney )).toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+payMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }
- });
- }
- }
- });
-
-
-
- // payment method change
- $('#payment_method').change(function(){
- var method = $(this).val();
- if(method == 1){
- $('.payment_method').html('<input type="radio" name="provider_name" id="provider-name-1" value="Mobifone" checked/> MobiFone <input type="radio" name="provider_name" id="provider-name-2" value="Viettel" /> Viettel <input type="radio" name="provider_name" id="provider-name-3" value="Vinaphone" /> Vinaphone');
- }else{
- $('.payment_method').html('<input type="radio" name="provider_name" id="provider-name-1" value="Vietcombank" checked/> Vietcombank <input type="radio" name="provider_name" id="provider-name-2" value="DongA Bank" /> DongABank <input type="radio" name="provider_name" id="provider-name-3" value="Sacombank" /> Sacombank </br> <input type="radio" name="provider_name" id="provider-name-4" value="Agribank" /> Agribank <input type="radio" name="provider_name" id="provider-name-5" value="Eximbank" /> Eximbank <input type="radio" name="provider_name" id="provider-name-6" value="Viettinbank" /> Viettinbank');
- }
- });*/
-
- // check promotion code
- /*$('.apply-promotion-code').click(function(){
- var promotionCode = $('#promotion_code').val();
- var productId = $('#product_id').val();
- if(promotionCode !=""){
- $.ajax({
- url: urlConfig("check-promotion-code"),
- data: {
- promotionCode:promotionCode,
- productId:productId
- },
- type:"POST"
- }).success(function(data) {
- //var discountGateway = $("input[name='payment_method']:checked").attr('discount');
- discountGateway = 0;
- var totalMoney = $('#total-money').val();
- if(data == "not exist"){
- $('#promotion_code').attr('discount',0);
- var discountValue = $('#total-money').attr('discountvalue');
- if(discountValue > 0){
- var payMoney = totalMoney - discountValue - discountGateway ;
- $('.total-value-item').html('<div><span class="value-text">'+vocaLang.money+' </span><span class="value-number total-money">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.discountMoney+'</span><span class="value-number discount-money">'+(parseInt(discountGateway) + parseInt(discountValue)).toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+payMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }else{
- if(discountGateway > 0){
- var payMoney = totalMoney - discountGateway ;
- $('.total-value-item').html('<div><span class="value-text">'+vocaLang.money+' </span><span class="value-number total-money">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.discountMoney+'</span><span class="value-number discount-money">'+discountGateway.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+payMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }else{
- $('.total-value-item').html('<div><span class="value-text payment-money">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number ">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }
-
- }
- $('.apply-promotion-code-result').text(vocaLang.promotionNotExist);
- $('.apply-promotion-code-result').css('color','#F00');
- }else{
- var discountMoney = data;
- $('#promotion_code').attr('discount',discountMoney);
- var payMoney = totalMoney - discountMoney - discountGateway;
- $('.total-value-item').html('<div><span class="value-text">'+vocaLang.money+' </span><span class="value-number total-money">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.discountMoney+'</span><span class="value-number discount-money">'+(parseInt(discountGateway) + parseInt(discountMoney )).toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+payMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- $('.apply-promotion-code-result').text(vocaLang.promotionValid);
- $('.apply-promotion-code-result').css('color','#00F');
- }
- });
- }
- });*/
- /* $('.apply-promotion-code').click(function(){
- var promotionCode = $('#promotion_code').val();
- var productId = $('#product_id').val();
-
-
- if(promotionCode !=""){
- $.ajax({
- url: urlConfig("check-promotion-code"),
- data: {
- promotionCode:promotionCode,
- productId:productId
- },
- type:"POST"
- }).success(function(data) {
- console.log(data);
- discountGateway = 0;
- var totalMoney = $('#total-money').val();
- if(data == "not exist"){
- $('#promotion_code').attr('discount',0);
- var discountValue = $('#total-money').attr('discountvalue');
- if(discountValue > 0){
- var payMoney = totalMoney - discountValue - discountGateway ;
- $('.total-value-item').html('<div><span class="value-text">'+vocaLang.money+' </span><span class="value-number total-money">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.discountMoney+'</span><span class="value-number discount-money">'+(parseInt(discountGateway) + parseInt(discountValue)).toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+payMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }else{
- if(discountGateway > 0){
- var payMoney = totalMoney - discountGateway ;
- $('.total-value-item').html('<div><span class="value-text">'+vocaLang.money+' </span><span class="value-number total-money">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.discountMoney+'</span><span class="value-number discount-money">'+discountGateway.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+payMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }else{
- $('.total-value-item').html('<div><span class="value-text payment-money">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number ">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }
-
- }
- $('.apply-promotion-code-result').text(vocaLang.promotionNotExist);
- $('.apply-promotion-code-result').css('color','#F00');
- }else{
- var discountMoney = data;
- $('#promotion_code').attr('discount',discountMoney);
- var payMoney = totalMoney - discountMoney - discountGateway;
- $('.total-value-item').html('<div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+payMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- $('.apply-promotion-code-result').text(vocaLang.promotionValid);
- $('.apply-promotion-code-result').css('color','#00F');
- }
- });
- }
- });
-
-
-
- // check promotion code radio button
- $('#promotion-code').change(
- function(){
- if ($(this).val() == "checkpromotioncode") {
- $('.div-promotion').fadeIn(1000);
- }
- });
- // click into pament button
- $('.payment-now').click(function(){
- $.blockUI(
- {
- message: vocaLang.pleaseWaitVoca,
- css: {
- border: 'none',
- padding: '15px',
- backgroundColor: '#000',
- '-webkit-border-radius': '2px',
- '-moz-border-radius': '2px',
- opacity: .5,
- color: '#fff'
- }}
- );
- });
-
- // change payment gateway
- $('input[name="select_method"]').change(function(){
- var discount = $(this).attr('discount');
- var totalMoney = $('#total-money').val();
- var discountvalue = $('#total-money').attr('discountvalue');
- var discountPromotion = $('#promotion_code').attr('discount');
- if(discountPromotion == 0){
- discountPromotion = discountvalue;
- if($('#discount-reference').length){
- var domDiscountReference = $('#discount-reference')[0].outerHTML;
- }
- }
- if(discount > 0){
- if(discountPromotion > 0){
- var discountMoney = parseInt(discount) + parseInt(discountPromotion);
- }else{
- var discountMoney = discount;
- }
- var payMoney = totalMoney - discountMoney;
- if(domDiscountReference){
- $('.total-value-item').html(domDiscountReference+'<div><span class="value-text">'+vocaLang.money+' </span><span class="value-number total-money">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.discountMoney+'</span><span class="value-number discount-money">'+discountMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+payMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }else{
- $('.total-value-item').html('<div><span class="value-text">'+vocaLang.money+' </span><span class="value-number total-money">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.discountMoney+'</span><span class="value-number discount-money">'+discountMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+payMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }
-
- }else{
- if(discountPromotion > 0){
- var payMoney = totalMoney - discountPromotion;
- if(domDiscountReference){
- $('.total-value-item').html(domDiscountReference+'<div><span class="value-text">'+vocaLang.money+' </span><span class="value-number total-money">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.discountMoney+'</span><span class="value-number discount-money">'+discountPromotion.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+payMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }else{
- $('.total-value-item').html('<div><span class="value-text">'+vocaLang.money+' </span><span class="value-number total-money">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.discountMoney+'</span><span class="value-number discount-money">'+discountPromotion.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div><div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+payMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }
-
- }else{
- $('.total-value-item').html('<div><span class="value-text">'+vocaLang.paymentMoney+'</span><span class="value-number real-value-number payment-money">'+totalMoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")+' VND</span></div>');
- }
-
- }
- });
-
- $('.tab-payment-transfer').click(function(){
- $('#chk-payment-transfer').prop("checked", true);
- $('#chk-payment-transfer').trigger('change');
- if($('#alert-payment-method').length){
- $('#alert-payment-method').fadeIn();
- $('#alert-payment-method').delay(15000).fadeOut();
- }
- });
-
- $('.tab-payment-banking').click(function(){
- $('#chk-payment-banking').prop("checked", true);
- $('#chk-payment-banking').trigger('change');
- if($('#alert-payment-method').length){
- $('#alert-payment-method').fadeIn();
- $('#alert-payment-method').delay(15000).fadeOut();
- }
- });
-
- $('.tab-payment-card').click(function(){
- $('#chk-payment-card').prop("checked", true);
- $('#chk-payment-card').trigger('change');
- });
- $('.tab-payment-viettel').click(function(){
- $('#chk-payment-viettel').prop("checked", true);
- $('#chk-payment-viettel').trigger('change');
- });
- $('.tab-payment-nl').click(function(){
- $('#chk-payment-nl').prop("checked", true);
- $('#chk-payment-nl').trigger('change');
- if($('#alert-payment-method').length){
- $('#alert-payment-method').fadeIn();
- $('#alert-payment-method').delay(15000).fadeOut();
- }
- });*/
- $('.choose-learn-words').click(function(){
- var topic = $(this).attr('topic');
- var parent = $(this).attr('parent');
- $.ajax({
- url: urlConfig("choose-learn-words"),
- data: {
- topic : topic,
- parent: parent
- },
- type:"POST"
- }).success(function(data) {
- if(data[0] !=0) {
- $('.show-choose-learn-words').modal();
- $('.modal-dialog-choose-word').html(data);
- }
- });
- });
-
- //update bell notification
- $('.bell-has-notification').click(function(){
- var countNotification = $('.bell-has-notification .count-notification span').html();
- $.ajax({
- url: urlConfig("update-user-notification"),
- type:"POST"
- }).success(function(data){
- if(data > 0){
- var notifyRemain = countNotification - data;
- if(notifyRemain > 0){
- $('.bell-has-notification .count-notification span').html(notifyRemain);
- }else{
- $('.bell-has-notification .count-notification').css('background','#003366');
- $('.bell-has-notification .count-notification span').css('color','#003366');
- $('.bell-has-notification').addClass('bell-flag');
- //$('.bell-has-notification a img').attr("src",urlConfig("assets/imgs/bell-logo-disable.png"));
- }
- }
- });
- });
- //click btn review
- $('.btn-remind-review').click(function(){
- var topicId = $(this).attr('topic_id');
- var urlRedirect = $(this).attr('url');
- document.cookie='remindTopic='+topicId+';path=/';
- window.location.href = urlRedirect;
- return false;
- });
-
- //close learning video
- $('.learning-video-modal .close').click(function(){
- $('.learning-video-modal-src').attr('src','');
- });
- //close learning music
- $('.learning-music-modal .close').click(function(){
- $('.learning-music-modal-src').attr('src','');
- });
- //close video modal
- $("#video-modal, .close").click(function(){
- $('.learning-video-modal-src').attr('src','');
- });
- //close music modal
- $("#music-modal, .close").click(function(){
- $('.learning-music-modal-src').attr('src','');
- });
- //view full or few story content
- $(document).on('click','.view-learning-content',function(){
- var storyContent = $(this).attr('content');
- if($(this).hasClass('view-learning-content-full')){
- $('#story-modal .learning-story-content').html(storyContent);
- $(this).removeClass('view-learning-content-full');
- $(this).addClass('view-learning-content-few');
- $(this).html(vocaLang.viewStoryShort);
- }else{
- $('#story-modal .learning-story-content').html(storyContent.substring(0,500)+'...');
- $(this).removeClass('view-learning-content-few');
- $(this).addClass('view-learning-content-full');
- $(this).html(vocaLang.viewStoryFull);
- }
- });
- //change fault content
- $(".fault-content").keyup(function(){
- var faultContent = $(this).val();
- if(faultContent != ""){
- $(".btn-send-fault").css({
- 'background':'#008DF6',
- 'color':'#FFF'
- });
- }else{
- $(".btn-send-fault").css({
- 'background':'#D8EEF9',
- 'color':'#555'
- });
- }
- });
- //cancel send fault
- $(".btn-cancel-fault").click(function(){
- $(".fault-content").val("");
- $('.slt-fault').get(0).selectedIndex = 0;
- $('.fault-content-error').html("");
- $('#feedback-modal').modal('hide');
- });
- //send fault
- $(".btn-send-fault").click(function(){
- var contentFault = $('.fault-content').val();
- var fault = $('.slt-fault').val();
- var topic = $(this).attr('topic');
- var word = $(this).attr('word');
- var synset = $(this).attr('definition');
- if(contentFault == ""){
- $('.fault-content-error').html(vocaLang.faultContentNotEmpty);
- return false;
- }else{
- $('.fault-content-error').html("");
- }
- $(".fault-content").val("");
- $('.slt-fault').get(0).selectedIndex = 0;
- $('.fault-menu').slideUp();
- $('.fault-content-error').html("");
- $.ajax({
- url: urlConfig("report-fault"),
- data: {
- topic: topic,
- fault: fault,
- synset: synset,
- word: word,
- faultContent: contentFault
- },
- type: "POST"
- }).success(function(data) {
-
- if(data[0] != 0){
- $('.fault-content-error').html(data[1]);
- $('.fault-content-error').css('color','green');
- }else{
- $('.fault-content-error').css('color','red');
- $('.fault-content-error').html(data[1]);
- }
- /* setTimeout(function(){
- $(".message-feedback-result").slideUp();
- },2000);*/
- });
- });
-
- //put avatar
- $(document).on('click','.btn-put-avatar',function(e){
- var data = new FormData();
- jQuery.each(jQuery('#file-upload')[0].files, function(i, file) {
- data.append('file_'+i, file);
- });
- $.ajax({
- url: urlConfig("update-avatar"), // Url to which the request is send
- type: "POST", // Type of request to be send, called as method
- data: data, // Data sent to server, a set of key/value pairs (i.e. form fields and values)
- contentType: false, // The content type used when sending data to the server.
- cache: false, // To unable request pages to be cached
- processData:false, // To send DOMDocument or non processed data file it is set to false
- success: function(data) // A function to be called if request succeeds
- {
-
- if(data[0] == 1){
- $('.avatar-picture').attr('src',data[1]);
- $('.btn-edit-avatar.avatar-picture.avatar-picture-item').attr('src',data[1]);
- $('.avatar-picture-item').attr('src',data[1]);
- $('.img-avatar').attr('src',data[1]);
- $('.img-student img').attr('src',data[1]);
- $('.span-avatar .avatar-img').attr('src',data[1]);
- $('.box-img-absolute.btn-edit-avatar img.user-img').attr('src',data[1]);
- $('#change-avatar-modal').modal('hide');
- }else{
-
- $('.avt-msg').text(data[1]);
- }
-
- }
- });
- });
-
- //put avatar
- $(document).on('click','.btn-put-avatar-link',function(){
- var avt = $(this).attr('avatar');
- if(avt !=""){
- $('.img-avatar').attr('src',urlConfig('assets/imgs/loading.gif'));
- $.ajax({
- url: urlConfig("update-avatar-link"),
- data: {
- url : avt
- },
- type: "POST"
- }).success(function(data) {
- $('.avatar-picture').attr('src',avt);
- $('.btn-edit-avatar.avatar-picture.avatar-picture-item').attr('src',avt);
- $('.img-avatar').attr('src',avt)
- $('.user-img').attr('src',avt)
- $('.img-student img').attr('src',avt)
- $('.span-avatar .avatar-img').attr('src',avt);
- $('#change-avatar-modal').modal('hide');
- });
- }
- });
-
- $(document).on('submit','.upload-form',function(e){
- /*var avt = $(this).attr('avatar');
- if(avt !=""){
- $('.img-avatar').attr('src',urlConfig('assets/imgs/loading.gif'));
- $.ajax({
- url: urlConfig("update-avatar"),
- data: {
- url : avt
- },
- type: "POST"
- }).success(function(data) {
- $('.avatar-picture').attr('src',avt);
- $('.btn-edit-avatar.avatar-picture.avatar-picture-item').attr('src',avt);
- $('.btn-edit-avatar.avatar-picture.avatar-picture-item').addClass('srctttttt');
- $('.img-avatar').attr('src',avt)
- $('.img-student img').attr('src',avt)
- $('.span-avatar .avatar-img').attr('src',avt);
- $('#change-avatar-modal').modal('hide');
- });
- }*/
-
- e.preventDefault();
- $.ajax({
- url: urlConfig("update-avatar"), // Url to which the request is send
- type: "POST", // Type of request to be send, called as method
- data: new FormData(this), // Data sent to server, a set of key/value pairs (i.e. form fields and values)
- contentType: false, // The content type used when sending data to the server.
- cache: false, // To unable request pages to be cached
- processData:false, // To send DOMDocument or non processed data file it is set to false
- success: function(data) // A function to be called if request succeeds
- {
- $('#loading').hide();
- $("#message").html(data);
- }
- });
- });
- //cancel avatar
- $(document).on('click','.btn-cancel-avatar',function(){
- $('.btn-put-avatar').attr('avatar','');
- $('#change-avatar-modal').modal('hide');
- });
- //change full name info in profile
- $(".profile-full-name").keyup(function(){
- var val = $(this).val();
- if(val != ""){
- $(".btn-update-info").css({
- 'background':'rgb(0, 141, 246)',
- 'color':'#FFF'
- });
- }else{
- $(".btn-update-info").css({
- 'background':'#EBEBEB',
- 'color':'#AEBAC6'
- });
- }
- });
-
- $(document).click(function() {
- $('.span-avatar .tooltip').css('display','none');
- $('.avatar-picture').tooltip('hide');
- });
- $('.span-avatar').click(function(event){
- event.stopPropagation();
- $('.btn-bell.open').removeClass('open');
- });
- $('.span-avatar .tooltip-inner').click(function(event) {
- event.stopPropagation();
- });
- $('.btn-bell').click(function(){
- $('.span-avatar .tooltip').css('display','none');
- $('.avatar-picture').tooltip('hide');
- });
-
- //hover level icon
- $('.dashboard-level-link').mouseover(function() {
- $('.dashboard-level-link span').css('text-decoration','underline');
- $('.dashboard-level-link img').attr('src',urlConfig('assets/imgs/level-icon.png'));
- });
- //mouseout level icon
- $('.dashboard-level-link').mouseout(function() {
- $('.dashboard-level-link span').css('text-decoration','none');
- $('.dashboard-level-link img').attr('src',urlConfig('assets/imgs/level-disable-icon.png'));
- });
-
- //hover invite friends icon
- $('.dashboard-invite-friends').mouseover(function(){
- $('.dashboard-invite-friends .fa-info-circle').css('color','#3C599B');
- });
- //mouseout invite friends icon
- $('.dashboard-invite-friends').mouseout(function(){
- $('.dashboard-invite-friends .fa-info-circle').css('color','#7b7979');
- });
- //hover ranking icon
- $('.dashboard-ranking-link').mouseover(function() {
- $('.dashboard-ranking-link span').css('text-decoration','underline');
- $('.dashboard-ranking-link img').attr('src',urlConfig('assets/imgs/ranking-icon.png'));
- });
- //mouseout ranking icon
- $('.dashboard-ranking-link').mouseout(function() {
- $('.dashboard-ranking-link span').css('text-decoration','none');
- $('.dashboard-ranking-link img').attr('src',urlConfig('assets/imgs/ranking-disable-icon.png'));
- });
- //click support items
- $('.support-items').click(function(){
- var id = $(this).attr('id');
- var supportId = $(this).attr('support-id');
- if($('#'+id+' ul .support-child-item').length){
- $('#'+id+' ul .support-child-item').slideToggle();
- $('#'+id).siblings().find('ul .support-child-item').slideUp();
- $('#'+id).siblings().find('.flag-caret').removeClass('fa-caret-down');
- $('#'+id).siblings().find('.flag-caret').addClass('fa-caret-right');
- if($('#'+id +' span .flag-caret').hasClass('fa-caret-right')){
- $('#'+id +' span .flag-caret').removeClass('fa-caret-right');
- $('#'+id +' span .flag-caret').addClass('fa-caret-down');
- }else{
- $('#'+id +' span .flag-caret').removeClass('fa-caret-down');
- $('#'+id +' span .flag-caret').addClass('fa-caret-right');
- }
- }else{
- var supportLink = urlConfig('support/'+supportId);
- window.location.href = supportLink;
- return false;
- }
- });
- $('.support-child-item').click(function(event) {
- event.stopPropagation();
- });
- //
- $('.support-post-item').click(function(){
- var id = $(this).attr('support-post-id');
- if($('.support-post-item-'+id +' .flag-caret-post').hasClass('fa-caret-right')){
- $('.support-post-item-'+id +' .flag-caret-post').removeClass('fa-caret-right');
- $('.support-post-item-'+id +' .flag-caret-post').addClass('fa-caret-down');
- $(this).css('font-family','OpenSansBold');
- }else{
- $('.support-post-item-'+id +' .flag-caret-post').removeClass('fa-caret-down');
- $('.support-post-item-'+id +' .flag-caret-post').addClass('fa-caret-right');
- $(this).css('font-family','OpenSansRegular');
- }
- $(this).siblings().slideToggle();
- });
-
- /*Begin zopim chat*/
-
- /*window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s=
- d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.
- _.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute('charset','utf-8');
- $.src='//v2.zopim.com/?2aBFL1eRpDl1lE0Hgc3RCZeLw9Vo2Hiu';z.t=+new Date;$.
- type='text/javascript';e.parentNode.insertBefore($,e)})(document,'script');
-
-
- $zopim(function() {
- $zopim.livechat.theme.setColor('#003366');
- $zopim.livechat.prechatForm.setGreetings('Please introduce yourself.');
- });*/
- /*End zopim chat*/
-
- /*Begin vchat*/
-
- /*(function() {var _h1= document.getElementsByTagName('title')[0] || false;
- var product_name = ''; if(_h1){product_name= _h1.textContent || _h1.innerText;}var ga = document.createElement('script'); ga.type = 'text/javascript';
- ga.src = '//live.vnpgroup.net/js/web_client_box.php?hash=6b555e3d0733f04c8ebfa88e57d89cd8&data=eyJoYXNoIjoiMTE3M2UxODdjMjMxZTA2Y2VhNzc2OGYwMTEwMTdhNGEiLCJzc29faWQiOjI4MDc1OTd9&pname='+product_name;
- var s = document.getElementsByTagName('script');s[0].parentNode.insertBefore(ga, s[0]);})();*/
- /*End vchat*/
-
- $('.library-add-vocabulary').click(function(){
- event.preventDefault();
- });
- $('.library-share-fb').click(function(){
- event.preventDefault();
- });
- $('.hide-vocabulary-temp').click(function(){
- event.preventDefault();
- });
- $('.stop-receive-remind-vocabulary').click(function(){
- event.preventDefault();
- });
- $('.receive-remind-vocabulary').click(function(){
- event.preventDefault();
- });
- //add vocabulary to personal page
- var objaddVocabulary;
- $('.library-add-vocabulary').click(function(){
- objaddVocabulary = $(this);
- var val = $(this).attr('value');
- $.ajax({
- url: urlConfig("library/app-vocabulary-to-personal-page"),
- data: {
- vocabulary_id : val
- },
- type: "POST"
- }).success(function(data) {
- objaddVocabulary.css("display","none");
- objaddVocabulary.siblings().removeClass("library-share-fb-margin-top");
- $("body").append('<span class="toast-msg">'+data[1]+'</span>');
- $(".toast-msg").fadeIn(400,function(){
- setTimeout(function(){
- $(".toast-msg").fadeOut(function(){
- $(".toast-msg").remove();
- });
- }, 2000);
- });
-
- });
- });
- //click buy now in library page
- $('.library-buy-now').click(function(){
- var val = $(this).attr('value');
- window.location.href = urlConfig("buy-product/"+val);
- });
- //hide vocabulary from personal page
- var objHideVocabulary;
- $('.hide-vocabulary-temp').click(function(){
- var val = $(this).attr('value');
- objHideVocabulary = $(this);
- $.ajax({
- url: urlConfig("hide-vocabulary"),
- data: {
- vocabulary_id : val
- },
- type: "POST"
- }).success(function(data) {
- if(data[0] == 0){
- $("body").append('<span class="toast-msg">'+data[1]+'</span>');
- $(".toast-msg").fadeIn(400,function(){
- setTimeout(function(){
- $(".toast-msg").fadeOut(function(){
- $(".toast-msg").remove();
- });
- }, 2000);
- });
- }else{
-
- objHideVocabulary.parents('.personal-library-product').remove();
-
- }
- });
- });
- //hide remind of vocabulary set
- var objHideRemind;
- $(document).on('click','.stop-receive-remind-vocabulary',function(){
- var val = $(this).attr('value');
- objHideRemind = $(this);
-
- $.ajax({
- url: urlConfig("hide-vocabulary-remind"),
- data: {
- vocabulary_id : val
- },
- type: "POST"
- }).success(function(data) {
- if(data[0] == 0){
- $("body").append('<span class="toast-msg">'+data[1]+'</span>');
- $(".toast-msg").fadeIn(400,function(){
- setTimeout(function(){
- $(".toast-msg").fadeOut(function(){
- $(".toast-msg").remove();
- });
- }, 2000);
- });
- }else{
- $("body").append('<span class="toast-msg">'+vocaLang.updateSuccess+'</span>');
- $(".toast-msg").fadeIn(400,function(){
- setTimeout(function(){
- $(".toast-msg").fadeOut(function(){
- $(".toast-msg").remove();
- });
- }, 2000);
- });
- }
- });
- });
- //visible remind of vocabulary set
- var objHideRemind;
- $(document).on('click','.receive-remind-vocabulary',function(){
- var val = $(this).attr('value');
- objHideRemind = $(this);
- $.ajax({
- url: urlConfig("visible-vocabulary-remind"),
- data: {
- vocabulary_id : val
- },
- type: "POST"
- }).success(function(data) {
- if(data[0] == 0){
- $("body").append('<span class="toast-msg">'+data[1]+'</span>');
- $(".toast-msg").fadeIn(400,function(){
- setTimeout(function(){
- $(".toast-msg").fadeOut(function(){
- $(".toast-msg").remove();
- });
- }, 2000);
- });
- }else{
- $("body").append('<span class="toast-msg">'+vocaLang.updateSuccess+'</span>');
- $(".toast-msg").fadeIn(400,function(){
- setTimeout(function(){
- $(".toast-msg").fadeOut(function(){
- $(".toast-msg").remove();
- });
- }, 2000);
- });
- }
- });
- });
- var checkBox = 1;
- $(window).click(function(){
- if(checkBox == 1){
- $('.box-search-vocabulary-result').css('display','none');
- }
-
- });
- $(document).on('click','.box-search-vocabulary-result .box-the-word-change-tab',function(){
- var value = $(this).attr('link');
-
-
- window.location.href = urlConfig('library#'+value);
-
- var seg = $(location).attr('pathname');
- seg.indexOf(1);
- seg.toLowerCase();
- seg1 = seg.split("/")[2];
- seg = seg.split("/")[1];
-
- if(seg == "library" && seg1 == undefined ){
- window.location.reload(true);
- }
-
-
- });
- //search library
- $('.txt-search').click(function(){
- checkBox = 0;
- var value = $(this).val();
-
- if(value.length < 1){
- var content = $('.box-search-result-item').html();
-
- if(content == ""){
- $.ajax({
- url: urlConfig("search-cate"),
- type:"POST"
-
- }).success(function(data) {
-
- $('.box-search-result-item').html(data);
- $('.box-search-vocabulary-result').css('display','block');
- $('.box-search-result-item').css('display','block');
- $('.box-search-result-item').next().remove();
- });
- }else{
- $('.box-search-vocabulary-result').css('display','block');
- $('.box-search-result-item').css('display','block');
- $('.box-search-result-item').next().remove();
- }
-
- }else{
- $('.box-search-vocabulary-result').css('display','block');
- $('.box-search-result-item').css('display','none');
- }
- setTimeout(function(){
- checkBox = 1;
- },500);
- });
- $('.txt-search').keyup(function(e){
- var value = $(this).val();
- if(value.trim() != ""){
- if(e.keyCode == 13){
- window.location.href = urlConfig('library-search/'+value);
- }else{
-
- if(value.length >= 1){
- $.ajax({
- url: urlConfig("library-search"),
- data: {
- key_word : value
- },
-
- type:"POST"
-
- }).success(function(data) {
-
- $('.box-search-result-item').css('display','none');
- $('.box-search-result-item').next().remove();
- $(data).insertAfter('.box-search-result-item');
- });
- }
- }
- }else{
- $('.box-search-result-item').css('display','block');
- $('.box-search-result-item').next().remove();
- }
- });
- $('.btn-search').click(function(){
- var value = $('.txt-search').val();
- if(value.trim() != ""){
- window.location.href = urlConfig('library-search/'+value);
- }
- });
- //suggest
- //refresh-captcha
- $(document).on('click','.refresh-captcha-search',function(){
- $.ajax({
- url: urlConfig("auth/get-captcha"),
- type:"POST"
- }).success(function( data) {
- $(".img-captcha").attr("src",data);
- });
- });
- $('.put-change-two').css('display',"none");
-
- $(document).on('change','.change-cate-suggest',function(){
- if($('.change-cate-suggest').val()==1)
- {
- $('.put-change-one').css('display',"block");
- $('.put-change-two').css('display',"none");
- $('.btn-keep').addClass('btn-send-suggest-home');
- $('.btn-keep').removeClass('btn-send-suggest-idea');
- }
- else
- {
- $('.put-change-one').css('display',"none");
- $('.put-change-two').css('display',"block");
- $('.btn-keep').removeClass('btn-send-suggest-home');
- $('.btn-keep').addClass('btn-send-suggest-idea');
- }
- });
- $(document).on('click','.suggest-the-word-menu-home',function(){
- jQuery('.refresh-captcha-search').click();
- $('#suggest-the-word-modal-home').modal();
- });
- $('.btn-send-suggest-home').click(function(){
- var type = $('.change-cate-suggest').val();
- if(type == 1){
- var vocabularyName = $('.txt-name-vocabulary').val();
- var idea = $('.summary-idea-home').val();
- var source = $('.source-book-home-idea').val();
- var captcha = $('.txt-suggest-vocabulary-captcha').val();
- if(vocabularyName.trim() != "" && idea.trim() != ""){
- $('#suggest-the-word-modal-home').modal('hide');
- $.ajax({
- url: urlConfig("suggest-vocabulary"),
- data: {
- vocabulary_name : vocabularyName,
- vocabulary_idea : idea,
- vocabulary_document : source,
- captcha : captcha
- },
-
- type:"POST"
-
- }).success(function(data) {
- $("body").append('<span class="toast-msg">'+data[1]+'</span>');
- $(".toast-msg").fadeIn(400,function(){
- setTimeout(function(){
- $(".toast-msg").fadeOut(function(){
- $(".toast-msg").remove();
- });
- }, 2000);
- });
- });
- }else{
- $('.suggest-msg-search').text("Please, fill full infomation!");
- }
- }else{
-
-
- var idea = $('.summary-idea-home-tab-difference').val();
-
- var captcha = $('.txt-suggest-vocabulary-captcha').val();
- if(idea.trim() != ""){
- $('#suggest-the-word-modal-home').modal('hide');
- $.ajax({
- url: urlConfig("suggest-idea"),
- data: {
- idea : idea,
- captcha : captcha
- },
-
- type:"POST"
-
- }).success(function(data) {
-
- $("body").append('<span class="toast-msg">'+data[1]+'</span>');
- $(".toast-msg").fadeIn(400,function(){
- setTimeout(function(){
- $(".toast-msg").fadeOut(function(){
- $(".toast-msg").remove();
- });
- }, 2000);
- });
- });
- }else{
- $('.suggest-msg-search').text("Please, fill full infomation!");
- }
- }
- });
-
- //choose learning method
- $('.learning-writing-btn, .learning-speaking-btn, .learning-flashcard-btn,.learning-context-btn').click(function(){
- $('.show-choose-learn-words form').attr('action',$(this).attr('url'));
- });
-
-
- var uagent = navigator.userAgent.toLowerCase();
-
- if (navigator.userAgent.match(/iPad|iPhone|iPod|Android|Windows Phone/i) != null ){
- //var text = '<div><marquee onmouseover="this.stop();" onmouseout="this.start();">Hãy há»c VOCA trên <strong>Máy tÃnh</strong> hoặc <strong>Laptop</strong> vá»›i các trình duyệt <strong>Chrome, Cốc Cốc</strong> để được há»— trợ tốt nhất bạn nhé! ^^</marquee></div><a href="javascript:void(0)" ><span class="mobile-close-notification">×</span></a>';
- //$('.mobile-notification').html(text);
- //$('.mobile-notification').css('display','block');
- $('.notification').css('display','none');
- $('.close-notification').css('display','none');
- }
-
- $(document).on('click','.mobile-close-notification',function(){
- $('.mobile-notification').css('display','none');
- $('.mobile-close-notification').css('display','none');
- document.cookie="closeMobileNotification=closenotification;path=/";
- });
- /**begin library community general**/
- $('.library-community-back').click(function(){
- window.location = urlConfig('library-community');
- return;
- if(history.length === 1){
- window.location = urlConfig('library-community');
- } else {
- history.back();
- }
- });
- /**end library community general**/
- /**Begin pin word group**/
- //click pin word icon
- $('.pin-word').click(function(e){
- e.stopPropagation();
- var vocabulary = $(this).attr('vocabulary');
- var word = $(this).attr('word');
- var definition = $(this).attr('definition');
- $.ajax({
- url: urlConfig("pin-word"),
- data: {
- 'vocabulary' : vocabulary,
- 'word' : word,
- 'definition' : definition
- },
- type: "POST"
- }).success(function(data) {
- $('#pin-word-modal').html(data);
- $('#pin-word-modal').modal();
- });
- });
- //event modal select archive
- $(document).on("click",".item-select-archive-word",function(){
- $(".btn-acept-archive-select").removeClass("btn-acept-archive-select-active");
- if($(this).hasClass("item-select-archive-word-active")){
- $(this).removeClass("item-select-archive-word-active");
- }
- else{
- $(".item-select-archive-word").removeClass("item-select-archive-word-active");
- $(this).addClass("item-select-archive-word-active");
- }
- $('.pin-word-vocabulary-name').prop('checked', false);
- $(".item-select-archive-word").each(function(){
- if($(this).hasClass("item-select-archive-word-active")){
-
- $(this).find('.pin-word-vocabulary-name').prop('checked', true);
- $(".btn-acept-archive-select").addClass("btn-acept-archive-select-active");
- }
- });
- });
-
- //pin word button
- $(document).on('click','.btn-pin-word',function(){
-
- if ($("input[name='rad_vocabulary_name']:checked").val()) {
- var name = $("input[name='rad_vocabulary_name']:checked").val();
- var vocabulary = $('.pin-word-vocabulary-content').val();
- var word = $('.pin-word-word-content').val();
- var definition = $('.pin-word-definition-content').val();
- $('.pin-word-error').text('');
- $.ajax({
- url: urlConfig("pin-vocabulary-word"),
- data: {
- 'vocabulary' : vocabulary,
- 'word' : word,
- 'definition' : definition,
- 'name' : name
- },
- type: "POST"
-
- }).success(function(data) {
- if(data[0] == 0){
- $('.pin-word-error').text(data[1]);
- }else{
- $('#pin-word-modal').modal('hide');
- setTimeout(function(){
- $('#pin-word-modal').html(data[1]);
- $('#pin-word-modal').modal('show');
- setTimeout(function(){
- $('#pin-word-modal').modal('hide');
- },2000);
- },1000);
-
- }
- });
- }
- });
-
- //pin word add vocabulary
- $(document).on('click','.btn-pin-word-add-vocabulary',function(){
- var vocabulary = $('.pin-word-vocabulary-content').val();
- var word = $('.pin-word-word-content').val();
- var definition = $('.pin-word-definition-content').val();
- $.ajax({
- url: urlConfig("pin-word-add-vocabulary"),
- data: {
- 'vocabulary' : vocabulary,
- 'word' : word,
- 'definition' : definition,
- },
- type: "POST"
-
- }).success(function(data) {
- $('#pin-word-modal').modal('hide');
- setTimeout(function(){
- $('#pin-word-modal').html(data);
- $('#pin-word-modal').modal('show');
- },1000);
- });
- });
-
- $(document).on("click",".add-image-feature",function(){
- $(".box-select-img-word").removeClass("animated bounceOutRight");
- setTimeout(function(){
- $(".box-select-img-word").css("display","block");
- $(".box-select-img-word").addClass("animated bounceInRight");
- setTimeout(function(){
- $(".img-avatar-word").each(function() {
- var width_img_avatar=$(this).width();
- var height_img_avatar=width_img_avatar/2;
- $( this ).css("height",height_img_avatar);
- });
- },300);
- },500);
- $(window).resize(function(){
- setTimeout(function(){
- $(".img-avatar-word").each(function() {
- var width_img_avatar=$(this).width();
- var height_img_avatar=width_img_avatar/2;
- $( this ).css("height",height_img_avatar);
- });
- },300);
- });
- });
- $(document).on('click','.btn-back-pin-word',function(){
- $(".box-select-img-word").removeClass("animated bounceInRight");
- $(".box-select-img-word").addClass("animated bounceOutRight");
- setTimeout(function(){
- $(".box-select-img-word").css("display","none");
- },500);
- });
- $(document).on("click",".item-img-select.add-image-vocabulary",function(){
- $(".style-btn-update-img").removeClass("style-btn-update-img-active");
- if($(this).hasClass("checked-img")){
- $(this).removeClass("checked-img");
- }
- else{
- $(".item-img-select.add-image-vocabulary").each(function(){
- if($(this).hasClass("checked-img")){
- $(this).removeClass("checked-img");
- $(this).find(".box-opacity-when-hover").css("display","none");
- }
- });
- $(this).addClass("checked-img");
- }
-
- $(".item-img-select.add-image-vocabulary").each(function(){
- if($(this).hasClass("checked-img")){
- $(".style-btn-update-img").addClass("style-btn-update-img-active");
- }
- });
- });
- $(document).on("mouseenter",".item-img-select.add-image-vocabulary",function(){
- if(!$(this).hasClass("checked-img")){
- $(this).find(".box-opacity-when-hover").fadeIn(200);
- }
- });
- $(document).on("mouseleave",".item-img-select.add-image-vocabulary",function(){
- if(!$(this).hasClass("checked-img")){
- $(this).find(".box-opacity-when-hover").fadeOut(200);
- }
- });
- $(document).on("click","#pin-word-modal .box-input-three",function(){
- if ($(this).find(".check-box-opacity").is(':checked')) {
- $(this).find(".check-box-opacity").prop('checked', false);
- $(this).find(".content-check-agree").css("display","inline-block");
- $(this).find(".content-check-agreeed").css("display","none");
- $(this).find(".box-check-style").css("background","none");
- $(this).find(".box-check-style").css("border","solid 1px #c3c3c3");
- }
- else{
- $(this).find(".check-box-opacity").prop('checked', true);
- $(this).find(".content-check-agree").css("display","none");
- $(this).find(".content-check-agreeed").css("display","inline-block");
- $(this).find(".box-check-style").css("background","#00bdfd");
- $(this).find(".box-check-style").css("border","none");
- }
- });
- $(document).on("click",".btn-pin-update-img",function(){
- if($(this).hasClass("style-btn-update-img-active")){
-
- var srcImgSelect = "";
- $(".item-img-select.add-image-vocabulary").each(function(){
- if($(this).hasClass("checked-img")){
- srcImgSelect = $(this).find(".img-avatar-word").attr("src");
- return;
- }
- });
- $(".pin-add-vocabulary-image-content").attr("src",srcImgSelect);
- $(".box-select-img-word").removeClass("animated bounceInRight");
- $(".box-select-img-word").addClass("animated bounceOutRight");
- setTimeout(function(){
- $(".box-select-img-word").css("display","none");
- },500);
-
- if($(".pin-word-vocabulary-name").val().length > 0 && $(".pin-word-vocabulary-name").val().length <= 35 && $(".pin-word-vocabulary-description").val().length > 0 && $(".pin-word-vocabulary-description").val().length <= 300 && $(".pin-add-vocabulary-image-content").attr("src") != ""){
- $(".a-pin-word-add-vocabulary").addClass("style-btn-create-active");
- }else{
- $(".a-pin-word-add-vocabulary").removeClass("style-btn-create-active");
- }
- }
- else{
- alert("Vui lòng ch?n hình b? t?.");
- }
- });
- $(document).on("keyup",".pin-word-vocabulary-name,.pin-word-vocabulary-description",function(){
- if($(".pin-word-vocabulary-name").val().length > 0 && $(".pin-word-vocabulary-name").val().length <= 35 && $(".pin-word-vocabulary-description").val().length > 0 && $(".pin-word-vocabulary-description").val().length <= 300 && $(".pin-add-vocabulary-image-content").attr("src") != ""){
- $(".a-pin-word-add-vocabulary").addClass("style-btn-create-active");
- }else{
- $(".a-pin-word-add-vocabulary").removeClass("style-btn-create-active");
- }
-
- });
- var isAdded = 0;
- $(document).on('click','.a-pin-word-add-vocabulary',function(){
- if(isAdded == 1){
- return;
- }
- isAdded = 1;
- var vocabulary = $('.pin-word-vocabulary-content').val();
- var word = $('.pin-word-word-content').val();
- var definition = $('.pin-word-definition-content').val();
- var name = $('.pin-word-vocabulary-name').val();
- var cate = $('.pin-word-vocabulary-cate').val();
- var imgLink = $('.pin-add-vocabulary-image-content').attr('src');
- var description = $('.pin-word-vocabulary-description').val();
- var quantity = $('.pin-word-community-quantity').val();
-
- var isPublic = 0;
- if($('.pin-word-community-public').is(':checked')){
- isPublic = 1;
- }
-
- $.ajax({
- url: urlConfig("pin-word-and-add-vocabulary"),
- data: {
- 'vocabulary' : vocabulary,
- 'word' : word,
- 'definition' : definition,
- 'name' : name,
- 'cate' : cate,
- 'img_link' : imgLink,
- 'description' : description,
- 'quantity' : quantity,
- 'is_public' : isPublic
- },
- type: "POST"
-
- }).success(function(data) {
-
- if(data[0] == 0){
- $('.pin-word-error').text(data[1]);
- isAdded = 0;
- }else{
- $('#pin-word-modal').modal('hide');
- setTimeout(function(){
- $('#pin-word-modal').html(data[1]);
- $('#pin-word-modal').modal('show');
- isAdded = 0;
- },1000);
-
- }
- });
- });
- $(document).on('change','.slt-topic-cate',function(){
- var id = $(this).val();
- $('.slt-topic-cate').val(id);
- $(".pin-add-vocabulary-image-content").attr("src","");
- $.ajax({
- url: urlConfig("get-image-by-product-cate/"+id),
-
- type: "POST"
- }).success(function(data) {
- $('.image-community-group').html(data);
- });
- });
- /**End pin word group**/
-
- /**begin pin word search**/
- $(document).on('keyup','.txt-search-pin-word',function(){
- var keyword = $(this).val();
- if(keyword.trim() != ""){
- $('.remove-search').addClass('remove-search-active');
- if(localStorage['pin_key_'+keyword] != undefined){
-
- $('.search-pin-item').next().remove();
- $(localStorage['pin_key_'+keyword]).insertAfter('.search-pin-item');
- return;
- }
- }else{
- $('.search-pin-item').next().remove();
- $('.remove-search').removeClass('remove-search-active');
- return;
- }
- clearTimeout($.data(this, 'timersearch'));
-
- var id = $(this).attr('vocabulary');
- $(this).data('timersearch', setTimeout(function(){
- if(keyword.trim() != ""){
- //$('.remove-search').addClass('remove-search-active');
- $.ajax({
- url: urlConfig("search-pin-word-key/"+id),
- data: {
- 'keyword' : keyword
- },
- type: "POST"
-
- }).success(function(data) {
- if(data[0] == 1){
- $('.search-pin-item').next().remove();
- $(data[1]).insertAfter('.search-pin-item');
- localStorage['pin_key_'+keyword] = data[1];
- }
- });
- }else{
- $('.search-pin-item').next().remove();
- $('.remove-search').removeClass('remove-search-active');
- }
- }, 500));
-
-
-
- });
- $(document).on('click','.remove-search-active',function(){
- $('.txt-search-pin-word').val('');
- $('.txt-search-pin-word').focus();
- $('.search-pin-item').next().remove();
- $(this).fadeOut();
- });
- $(document).on('click','.btn-pin-word-icon',function(){
- var name = $("#search-pin-word-modal").attr('vocabulary');
- var vocabulary = $(this).attr('vocabulary');
- var word = $(this).attr('word');
- var definition = $(this).attr('def');
- $.ajax({
- url: urlConfig("pin-vocabulary-word-search"),
- data: {
- 'vocabulary' : vocabulary,
- 'word' : word,
- 'definition' : definition,
- 'name' : name
- },
- type: "POST"
-
- }).success(function(data) {
- $('#search-pin-word-modal').modal('hide');
- if(data[0] == 1){
- if($('.title-vocabulary-all').siblings().hasClass('box-empty-word')){
- $('.box-empty-word').remove();
- $('<div class="box-list-vocabulary"><div class="row">'+data[2]+'</div></div>').insertAfter('.title-vocabulary-all');
- $('.add-pin-word').fadeIn();
- }else{
- $('.box-list-vocabulary').children('.row').prepend(data[2]);
- }
- var quantity = $('.title-vocabulary-all .style-badge-number-word').html();
- quantity = parseInt(quantity);
- if(!isNaN(quantity)){
- $('.title-vocabulary-all .style-badge-number-word').html(quantity + 1);
- var limit = $('.add-pin-word').attr('limit');
- limit = parseInt(limit);
- if(limit <= (quantity + 1)){
- $('.add-pin-word').fadeOut();
- setTimeout(function(){
- location.reload();
- },3000);
- }
-
- }
- }
- setTimeout(function(){
- if(data[0] == 0){
- $('#search-pin-word-modal').html(data[1]);
- $('#search-pin-word-modal').modal('show');
- }
-
- setTimeout(function(){
- $('#search-pin-word-modal').modal('hide');
- setTimeout(function(){
- $('.add-pin-word').trigger('click');
- },500);
- },1000);
- },1000);
- });
- });
-
- $('.msg-pin-word-btn').click(function(){
- $('#learning-msg-modal').modal('hide');
- setTimeout(function(){
- $('.add-pin-word').trigger('click');
- },500);
- });
- /**end pin word search**/
-
- /**Begin rating voca community**/
- var isRated = 0;
- $('.star-rating').mouseover(function(){
- if(isRated == 1){
- return false;
- }
- $('.star-rating').removeClass('fa-star');
- $('.star-rating').addClass('fa-star-o');
- $(this).addClass('fa-star');
- $(this).removeClass('fa-star-o');
- $(this).prevAll('.fa').addClass('fa-star');
- $(this).prevAll('.fa').removeClass('fa-star-o');
- });
- $('.star-rating').mouseout(function(){
- $('.star-rating').removeClass('fa-star');
- $('.star-rating').addClass('fa-star-o');
- });
- $(document).on('click','.star-rating.fa-star',function(){
-
- var c = confirm(ratingMsg);
- if(c == false){
- return false;
- }
- // $('.star-rating').removeClass('star-rating');
-
-
- var rate = $(this).index();
- var vocabulary = $(this).parent().attr('vocabulary');
- isRated = 1;
- $('.library-community-rating').nextAll().remove();
- $('<i class="fa fa-star star-rated"></i> <span>'+rate+'</span>').insertAfter($('.library-community-rating'));
-
- $.ajax({
- url: urlConfig("rating-voca-community/"+vocabulary),
- data: {
- 'rate' : rate
- },
- type: "POST"
-
- });
- });
-
-
- $('.s-rate').mouseover(function(){
- var i = $('.s-rate').index(this);
- $('.s-rate').each(function(index){
-
- if(index <= i){
- $(this).addClass('s-rating');
- }
- });
- });
- $('.s-rate').mouseout(function(){
- $('.s-rate').removeClass('s-rating');
- });
- $(document).on('click','.s-rate.s-rating',function(){
-
- $('#rating-msg-modal').modal('hide');
-
-
- var rate = parseInt($(this).index()) + 1;
- var vocabulary = $('.btn-library-community-rating').attr('vocabulary');
- $('.rating-vocabulary, .txt-library-community-rating').addClass('rated-vocabulary');
- $.ajax({
- url: urlConfig("rating-voca-community/"+vocabulary),
- data: {
- 'rate' : rate
- },
- type: "POST"
-
- }).success(function(){
- $('#rated-msg-modal').modal();
- setTimeout(function(){
- $('#rated-msg-modal').modal('hide');
- },1000)
- });
- });
- $('.rating-vocabulary, .txt-library-community-rating').click(function(){
- if(!$(this).hasClass('rated-vocabulary')){
- $('#rating-msg-modal').modal();
- }else{
- $('#rated-msg-modal').modal();
- }
-
- });
- /**End rating voca community**/
-
- /**Begin learning community**/
- //choose learning method
- $('.learning-community').click(function(){
- $('.choose-learn-community-words form').attr('action',$(this).attr('url'));
- });
- $('.learning-writing-community').click(function(){
- $('.choose-learn-community-words form').attr('action',$(this).attr('url'));
- });
-
- $('.learning-speaking-community').click(function(){
- $('.choose-learn-community-words form').attr('action',$(this).attr('url'));
- });
-
- $('.choose-learning-community-words').click(function(){
- console.log(12345);
- var topic = $(this).attr('topic');
- $.ajax({
- url: urlConfig("choose-learning-commuinity-words/"+topic),
- type:"POST"
- }).success(function(data) {
- console.log(data);
- if(data !=0) {
-
- $('.choose-learn-community-words .modal-dialog-choose-word').html(data);
- $('.choose-learn-community-words').modal();
- }
- });
- });
- /**End learning community**/
- jQuery.fn.exists = function(){return this.length>0;}
- if ($('#sub-menu').exists() && $('#sub-menu').is(":visible")) {
- $('#voca-wrap').css('padding','100px 0 100px');
- }
-
- $('.sub-menu-library').mouseover(function(){
- $(this).addClass('open');
- });
-
- $('.sub-menu-library').mouseout(function(){
- $(this).removeClass('open');
- });
-
- $('.sub-menu-blog').mouseover(function(){
- $(this).addClass('open');
- });
-
- $('.sub-menu-blog').mouseout(function(){
- $(this).removeClass('open');
- });
- $('.sub-menu-phone').mouseover(function(){
- $(this).addClass('open');
- });
-
- $('.sub-menu-phone').mouseout(function(){
- $(this).removeClass('open');
- });
- setTimeout(function(){$('.sub-menu-personal, .sub-menu-library, .sub-menu-library-community, .sub-menu-community,.sub-menu-blog ').has('.menu-active').addClass('sub-menu-item-border');},1000);
- });
- //show music modal
- function showMusicModal(url){
- $('#music-modal .learning-music-modal .learning-music-modal-src').attr('src',url);
- $('#music-modal').modal('show');
- }
- //show video modal
- function showVideoModal(url){
- $('#video-modal .learning-video-modal .learning-video-modal-src').attr('src',url+'?rel=0');
- $('#video-modal').modal('show');
- }
- //show story modal
- function showStoryModal(url){
- $('#story-modal').modal('show');
- if(url == 0){
- $('#story-modal .learning-music-modal-src').css("display","none");
- }else{
- $('#story-modal .learning-music-modal-src').attr('src',url+'?rel=0');
- }
-
- }
- /*
- $(function(){
- $('.avatar-picture').tooltip({placement: 'bottom', html: true,trigger:'click'});
- $('.sidebar-nav').slimScroll({
- height: '100%',
- color:"#555"
- });
- });
- $(function(){
- $('.bell-notification-content-items').slimScroll({
- height: '500px',
- color:"#efefef"
- });
- });
- */
- $(window).scroll(function(){
- if($(document).scrollTop()>=600){
- $('.intro-text-menu img').removeClass('hidden');
- }else{
- if(!$('.intro-text-menu img').hasClass('hidden')){
- $('.intro-text-menu img').addClass('hidden');
- }
- }
- });
- function removeInform(){
- $('.inform-bar').fadeOut('slow');
- }
- $(document).ready(function(){
-
- $('.title-tooltip').tooltip({'html':true});
- $('.title-tooltip').mouseover(function(){
- $(this).parent().parent().next().css('text-decoration','underline');
- });
- $('.title-tooltip').mouseout(function(){
- $(this).parent().parent().next().css('text-decoration','none');
- });
- var heightScreen = jQuery(window).height()-50;
- //$('.main-wrapper').css('min-height',heightScreen+'px');
- $(document).on('change','.choose-language',function(){
- var lang = $(this).val();
- $('form#choose-laguage-form').attr('action',urlConfig('set-language/'+ lang));
- $('form#choose-laguage-form').submit();
- });
- $(document).on('mouseup','.btn-edit-avatar',function(){
- $.ajax({
- url: urlConfig('change-avatar'),
- data: {
- },
- type: 'POST'
- }).success(function(data) {
- $('#change-avatar-modal').html(data);
- $('#change-avatar-modal').modal();
- });
- });
- $('.close-notification').click(function(){
- $('.notification').css('display','none');
- $('.close-notification').css('display','none');
- document.cookie="closeNotification=closenotification;path=/";
- });
- var show = 0;
- $('.hide-show-message').click(function(){
- if(show == 0){
- $('.message-content').css('bottom', '0px');
- show = 1;
- }else{
- show = 0;
- $('.message-content').css('bottom', '-520px');
- }
- });
- $('.hide-message').click(function(){
- show = 0;
- $('.message-content').css('bottom', '-520px');
- document.cookie="hideEvent=hideEvent;path=/";
- });
- if (document.cookie.indexOf("hideEvent") < 0) {
- setTimeout(function(){
- $('.message-content').css('bottom', '0px');
- document.cookie="hideEvent=hideEvent;path=/";
- show = 1;
- }, 10000);
- }
- $('.voca-vip').mouseover(function(){
- $(this).css('text-decoration','underline');
- });
- $('.voca-vip').mouseout(function(){
- $(this).css('text-decoration','none');
- });
- $(document).on('mouseover','.avatar-picture-item',function(){
- $('.btn-edit-avatar.avatar-picture.avatar-picture-item + .change-avatar').css('visibility','visible');
- });
- $(document).on('mouseout','.avatar-picture-item',function(){
- $('.btn-edit-avatar.avatar-picture.avatar-picture-item + .change-avatar').css('visibility','hidden');
- });
- $(document).on('mouseover','.btn-edit-avatar.avatar-picture.avatar-picture-item + .change-avatar',function(){
- $(this).css('visibility','visible');
- });
- $(document).on('mouseout','.btn-edit-avatar.avatar-picture.avatar-picture-item + .change-avatar',function(){
- $(this).css('visibility','hidden');
- });
-
- var l = 0;
- $(".learn-mobile").click(function(){
- if(l == 0){
- l = 1;
- $('.nav-mobile').slideDown();
- $('.learn-mobile-icon').removeClass('fa-chevron-down');
- $('.learn-mobile-icon').addClass('fa-chevron-up');
- }else{
- l = 0;
- $('.nav-mobile').slideUp();
- $('.learn-mobile-icon').removeClass('fa-chevron-up');
- $('.learn-mobile-icon').addClass('fa-chevron-down');
- }
- });
-
- //setting sound type
- $('.li-set-sound-type').click(function(){
- $('.ul-sound-type').slideToggle();
- });
- });
- (function(){
- var _z = console;
- Object.defineProperty( window, "console", {
- get : function(){
- if( _z._commandLineAPI ){
- throw "Sorry, VOCA Can't excute YOUR scripts!!!";
- }
- return _z;
- },
- set : function(val){
- _z = val;
- }
- });
- })();
|