<commit_before>define(function(require, exports, moudle) {
  alifenxi.track("course_view_view");
  var login = require('../index.js');
  var focus_btn = $("#focus-btn");
  $(function(){
    var is_login = $('#signin_user').length == 0 ? false : true;
    if(is_login){
      $('#start_learn').attr({
        href : $('#start_learn').attr('data-href')
      })
      $('#learn_mater').attr({
        href :  $('#learn_mater').attr('data-href')
      })
    }else{
      $('#start_learn').on('click', function(e){
        login.signin();
      });
      $('#learn_mater').on('click', function(e){
        login.signin();
      })
    }
  });

  var sendFocus = function(isFocus,id){
    var reverse_flag = isFocus == 'true' ? false : true;
    $.post('/course/setfocus/',{focus:reverse_flag,id:id},'json').done(function(res){
      if(res.status == 1){
        focus_btn.attr("data-focus",reverse_flag);
      }
    }).error(function(res){
      focus_btn.attr("data-focus",reverse_flag);
    });
  };
  focus_btn.on("click",function(e){
    var is_login = $('#signin_user').length == 0 ? false : true;
    var course_id = focus_btn.attr("data-id");
    if(is_login){
      sendFocus(focus_btn.attr("data-focused"),course_id);
    }else{
      login.signin();
    }
  });
});<commit_msg>now you can see the status change<commit_after>define(function (require, exports, moudle) {
    alifenxi.track("course_view_view");
    var login = require('../index.js');
    var focus_btn = $("#focus-btn");
    $(function () {
        var is_login = $('#signin_user').length == 0 ? false : true;
        if (is_login) {
            $('#start_learn').attr({
                href: $('#start_learn').attr('data-href')
            })
            $('#learn_mater').attr({
                href: $('#learn_mater').attr('data-href')
            })
        } else {
            $('#start_learn').on('click', function (e) {
                login.signin();
            });
            $('#learn_mater').on('click', function (e) {
                login.signin();
            })
        }
    });

    var sendFocus = function (isFocus, id) {
        var reverse_flag = isFocus == 'true' ? 'false' : 'true';
        $.post('/course/setfocus/', {focus: reverse_flag, id: id}, 'json').done(function (res) {
            if (res.errno == 0) {
                focus_btn.attr("data-focused", reverse_flag);
            }
        }).error(function (res) {
            focus_btn.attr("data-focused", reverse_flag);
        });
    };
    focus_btn.on("click", function (e) {
        var is_login = $('#signin_user').length == 0 ? false : true;
        var course_id = focus_btn.attr("data-id");
        if (is_login) {
            sendFocus(focus_btn.attr("data-focused"), course_id);
        } else {
            login.signin();
        }
    });
});
{'fraction_non_alphanumeric': 0.19737309194178204, 'fraction_numerical': 0.002129925452609159, 'mean_word_length': 2.2805587892898718, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7564943', 'n_tokens_mistral': 904, 'n_tokens_neox': 893, 'n_words': 146}