/*
 * @author {{author}}
 * */
require([
  "utils",
  "config",
  "dialog",
  "login",
], function (utils, config, dialog, login) {
  if (!!window.ActiveXObject && !window.XMLHttpRequest) {
    SQ.alert("浏览器版本太低啦，可能会影响页面显示~赶紧升级吧~");
  }
  var apiUrl = config.apiUrl;
  var Main = new SQ.Class();
  Main.include({
    isLogin: false,
    //应用层初始化函数
    init: function () {
      $(document)
      //加入收藏
        .on("click", ".bookmark", function (e) {
          e.preventDefault();
          var u = window.location.href,
            t = document.title;
          try {
            window.external.AddFavorite(u, t);
          } catch (e) {
            try {
              window.sidebar.addPanel(t, u, "");
            } catch (e) {
              return SQ.alert("请您尝试同时按下Ctrl和D键收藏本页");
            }
          }
        });

        login.getUserInfo();    //保持登录状态
    },
    //底层初始化函数,自动在init之前执行
    initializer: function () {

    }
  });

  return new Main();
});
