<commit_before>/**
 * author: 吴家荣
 * email: <EMAIL>
 * update: 2016/03/09
 * ------------------------------------------------------------------
 * JS类：EdenSliderPlus
 * 功能：实现全屏、退出全屏、上下翻页、跳到指定页、优化展现等功能
 * ------------------------------------------------------------------
 */

// EdenSliderPlus类
var EdenSliderPlus = function () {}

EdenSliderPlus.prototype.init = function() {
  var slider = $('#slider'); // 取得幻灯片元素

  if (slider == null) throw Error("No elements' id name is slider");
  
  var width = slider.innerWidth(); // 幻灯片元素宽
  var height = slider.innerHeight(); // 幻灯片元素高
  var screenWidth = window.screen.width; // 电脑屏幕宽
  var screenHeight = window.screen.height; // 电脑屏幕高

  if (height < 100) height = width * (657 / 819.188);

  EdenSliderPlus.width = width;
  EdenSliderPlus.fullScreenWidth = 
    screenHeight * (width / height); // 适应高度而计算出来的全屏后的宽度
  EdenSliderPlus.slider = slider;
  EdenSliderPlus.isFullScreen = false;

  // console.log(width, height, screenWidth, screenWidth, EdenSliderPlus.fullScreenWidth);
}

// 设置全屏的函数
EdenSliderPlus.prototype.launchFullscreen = function (element) {
  if (element.requestFullscreen) {
    element.requestFullscreen();
  } else if (element.mozRequestFullScreen) {
    element.mozRequestFullScreen();
  } else if (element.webkitRequestFullscreen) {
    element.webkitRequestFullscreen();
  } else if (element.msRequestFullscreen) {
    element.msRequestFullscreen();
  }
}

// 退出全屏的函数
EdenSliderPlus.prototype.exitFullscreen = function () {
  if (document.exitFullscreen) {
    document.exitFullscreen();
  } else if (document.mozCancelFullScreen) {
    document.mozCancelFullScreen();
  } else if (document.webkitExitFullscreen) {
    document.webkitExitFullscreen();
  }
}

// 启动嵌入的js代码
EdenSliderPlus.prototype.activate = function() {
  if (!EdenSliderPlus.slider) throw Error("No elements' id name is slider");

  setDblClickEvent();
  setKeydownEvent();
  setFullscreenChangeEvent();
}<commit_msg>修复slider判断错误<commit_after>/**
 * author: 吴家荣
 * email: <EMAIL>
 * update: 2016/03/09
 * ------------------------------------------------------------------
 * JS类：EdenSliderPlus
 * 功能：实现全屏、退出全屏、上下翻页、跳到指定页、优化展现等功能
 * ------------------------------------------------------------------
 */

// EdenSliderPlus类
var EdenSliderPlus = function () {}

EdenSliderPlus.prototype.init = function() {
  var slider = $('#slider'); // 取得幻灯片元素

  if (slider.length == 0) throw Error("No elements' id name is slider");
  
  var width = slider.innerWidth(); // 幻灯片元素宽
  var height = slider.innerHeight(); // 幻灯片元素高
  var screenWidth = window.screen.width; // 电脑屏幕宽
  var screenHeight = window.screen.height; // 电脑屏幕高

  if (height < 100) height = width * (657 / 819.188);

  EdenSliderPlus.width = width;
  EdenSliderPlus.fullScreenWidth = 
    screenHeight * (width / height); // 适应高度而计算出来的全屏后的宽度
  EdenSliderPlus.slider = slider;
  EdenSliderPlus.isFullScreen = false;

  // console.log(width, height, screenWidth, screenWidth, EdenSliderPlus.fullScreenWidth);
}

// 设置全屏的函数
EdenSliderPlus.prototype.launchFullscreen = function (element) {
  if (element.requestFullscreen) {
    element.requestFullscreen();
  } else if (element.mozRequestFullScreen) {
    element.mozRequestFullScreen();
  } else if (element.webkitRequestFullscreen) {
    element.webkitRequestFullscreen();
  } else if (element.msRequestFullscreen) {
    element.msRequestFullscreen();
  }
}

// 退出全屏的函数
EdenSliderPlus.prototype.exitFullscreen = function () {
  if (document.exitFullscreen) {
    document.exitFullscreen();
  } else if (document.mozCancelFullScreen) {
    document.mozCancelFullScreen();
  } else if (document.webkitExitFullscreen) {
    document.webkitExitFullscreen();
  }
}

// 启动嵌入的js代码
EdenSliderPlus.prototype.activate = function() {
  if (!EdenSliderPlus.slider.length == 0) throw Error("No elements' id name is slider");

  setDblClickEvent();
  setKeydownEvent();
  setFullscreenChangeEvent();
}
{'fraction_non_alphanumeric': 0.18815153826595474, 'fraction_numerical': 0.010678871090770405, 'mean_word_length': 3.0598555211558307, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '2965297', 'n_tokens_mistral': 1375, 'n_tokens_neox': 1409, 'n_words': 233}