<commit_before>angular.module('docsTabsExample', [])
.directive('slideshowContainer', function() {
  return {
    link: function(scope, element, attr) {
      console.log("element:", element);
      
        var css3 = {
          has3d: function() {
            var el = document.createElement('p'),
            has3d,
            transforms = {
                'webkitTransform':'-webkit-transform',
                'OTransform':'-o-transform',
                'msTransform':'-ms-transform',
                'MozTransform':'-moz-transform',
                'transform':'transform'
            };
         
            // Add it to the body to get the computed style
            document.body.insertBefore(el, null);
         
            for(var t in transforms){
                if( el.style[t] !== undefined ){
                    el.style[t] = 'translate3d(1px,1px,1px)';
                    has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);
                }
            }
         
            document.body.removeChild(el);
         
            return (has3d !== undefined && has3d.length > 0 && has3d !== "none");
          },
          hasTransform: function() {
            var prefixes = 'transform WebkitTransform MozTransform OTransform msTransform'.split(' ');
            var div = document.createElement('div');
            for(var i = 0; i < prefixes.length; i++) {
                if(div && div.style[prefixes[i]] !== undefined) {
                    return prefixes[i];
                }
            }
            return false;
          }
        },
        isAndroid = (/android/gi).test(navigator.appVersion),
        has3d = css3.has3d(),
        hasTransform = css3.hasTransform(),

        gv1 = has3d ? 'translate3d(' : 'translate(',
        gv2 = has3d ? ',0)' : ')';
        var touchSlider = function(container,options){
                if(!container) return null;
                if(options) options.container = container; //container会覆盖options内的container
                else options = typeof container == 'string' ? {'container' : container} : container;
                angular.extend(this,{
                        container : ".slider",  //大容器，包含面板元素、触发元素、上下页等
                        wrap : null,  //滑动显示区域，默认为container的第一个子元素。（该元素固定宽高overflow为hidden，否则无法滑动）
                        panel : null,  //面板元素，默认为wrap的第一个子元素
                        trigger : null,   //触发元素，也可理解为状态元素
                        activeTriggerCls : 'sel',  //触发元素内子元素的激活样式
                        hasTrigger : false,  //是否需要触发事件，例tab页签就需要click触发
                        steps : 0,  //步长，每次滑动的距离
                        left : 0,  //panel初始的x坐标
                        visible : 1,  //每次滑动几个panels，默认1
                        margin : 0,  //面板元素内子元素间的间距
                        curIndex : 0,  //初始化在哪个panels上，默认0为第一个
                        duration : 300,  //动画持续时间
                        //easing : 'ease-out', //动画公式
                        loop : false,  //动画循环
                        play : false,  //动画自动播放
                        interval : 5000,  //播放间隔时间，play为true时才有效
                        useTransform : !isAndroid, //以translate方式动画

                        lazy : '.lazyimg', //图片延时加载属性
                        lazyIndex : 1,  //默认加载到第几屏
                        callback : null, //动画结束后触发pageLeft
                        prev : null,  //上一页
                        next : null,  //下一页
                        activePnCls : 'none'  //prev和next在头尾时的样式
                },options);
                this.findEl() && this.init() && this.increaseEvent();
        };
        angular.extend(touchSlider.prototype,{
                reset : function(options){
                        angular.extend(this,options || {});
                        this.init();
                },
                findEl : function(){
                        var container = this.container = angular.element(element);
                        if(!container.length){return null;}

                        this.wrap = this.wrap && container.find(this.wrap) || container.children().eq(0);
                        if(!this.wrap.length){return null;}

                        this.panel = this.panel && container.find(this.panel) || this.wrap.children().eq(0);
                        if(!this.panel.length){return null;}

                        this.panels = this.panel.children();
                        if(!this.panels.length){  //对于没有图片的元素，直接隐藏
                                this.container.hide();
                                return null;
                        }

                        this.trigger = this.trigger;
                        this.prev = this.prev && container.find(this.prev);
                        this.next = this.next && container.find(this.next);
                        return this;
                },
                init : function(){
                        var wrap = this.wrap,
                        panel = this.panel,
                        panels = this.panels,
                        trigger = this.trigger,
                        len = this.len = panels.length,  //子元素的个数
                        margin = this.margin,
                        allWidth = 0,  //滑动容器的宽度
                        status = this.visible,  //每次切换多少个panels
                        useTransform = this.useTransform = hasTransform ? this.useTransform : false;  //不支持直接false,android默认false

                        //this.steps = this.steps || wrap.width();  //滑动步长，默认wrap的宽度
                        this.steps = this.steps ||  parseInt(window.getComputedStyle(this.wrap[0]).width);
                        angular.forEach(panels, function(item, n){
                                allWidth += item.offsetWidth;
                        });

                        if(margin && typeof margin == 'number'){
                                allWidth += (len-1) * margin;  //总宽度增加
                                this.steps += margin;  //步长增加margin
                        }

                        if(status > 1){this.loop = false;}  //如果一页显示的子元素超出1个，或设置了步长，则不支持循环；若自动播放，则只支持一次

                        //初始位置
                        var initLeft = this.left;
                        initLeft -= this.curIndex * this.steps;
                        this.setCoord(panel,initLeft);
                        if(useTransform){
//				wrap.css({'-webkit-transform':'translate3d(0,0,0)'});  //防止ios6下滑动会有顿感
//				panel.css({'-webkit-backface-visibility':'hidden'});
//				panels.css({'-webkit-transform':gv1+'0,0'+gv2});
                        }<commit_msg>Cleanup<commit_after>angular.module('docsTabsExample', [])
.directive('slideshowContainer', function() {
  return {
    link: function(scope, element, attr) {
      console.log("element:", element);
      
        var css3 = {
          has3d: function() {
            var el = document.createElement('p'),
            has3d,
            transforms = {
                'webkitTransform':'-webkit-transform',
                'OTransform':'-o-transform',
                'msTransform':'-ms-transform',
                'MozTransform':'-moz-transform',
                'transform':'transform'
            };
         
            // Add it to the body to get the computed style
            document.body.insertBefore(el, null);
         
            for(var t in transforms){
                if( el.style[t] !== undefined ){
                    el.style[t] = 'translate3d(1px,1px,1px)';
                    has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);
                }
            }
         
            document.body.removeChild(el);
         
            return (has3d !== undefined && has3d.length > 0 && has3d !== "none");
          },
          hasTransform: function() {
            var prefixes = 'transform WebkitTransform MozTransform OTransform msTransform'.split(' ');
            var div = document.createElement('div');
            for(var i = 0; i < prefixes.length; i++) {
                if(div && div.style[prefixes[i]] !== undefined) {
                    return prefixes[i];
                }
            }
            return false;
          }
        },
        isAndroid = (/android/gi).test(navigator.appVersion),
        has3d = css3.has3d(),
        hasTransform = css3.hasTransform(),

        gv1 = has3d ? 'translate3d(' : 'translate(',
        gv2 = has3d ? ',0)' : ')';
        var touchSlider = function(container,options){
                if(!container) return null;
                if(options) options.container = container; //container会覆盖options内的container
                else options = typeof container == 'string' ? {'container' : container} : container;
                angular.extend(this,{
                        container : ".slider",  //大容器，包含面板元素、触发元素、上下页等
                        wrap : null,  //滑动显示区域，默认为container的第一个子元素。（该元素固定宽高overflow为hidden，否则无法滑动）
                        panel : null,  //面板元素，默认为wrap的第一个子元素
                        trigger : null,   //触发元素，也可理解为状态元素
                        activeTriggerCls : 'sel',  //触发元素内子元素的激活样式
                        hasTrigger : false,  //是否需要触发事件，例tab页签就需要click触发
                        steps : 0,  //步长，每次滑动的距离
                        left : 0,  //panel初始的x坐标
                        visible : 1,  //每次滑动几个panels，默认1
                        margin : 0,  //面板元素内子元素间的间距
                        curIndex : 0,  //初始化在哪个panels上，默认0为第一个
                        duration : 300,  //动画持续时间
                        //easing : 'ease-out', //动画公式
                        loop : false,  //动画循环
                        play : false,  //动画自动播放
                        interval : 5000,  //播放间隔时间，play为true时才有效
                        useTransform : !isAndroid, //以translate方式动画

                        lazy : '.lazyimg', //图片延时加载属性
                        lazyIndex : 1,  //默认加载到第几屏
                        callback : null, //动画结束后触发pageLeft
                        prev : null,  //上一页
                        next : null,  //下一页
                        activePnCls : 'none'  //prev和next在头尾时的样式
                },options);
                this.findEl() && this.init() && this.increaseEvent();
        };
        angular.extend(touchSlider.prototype,{
                reset : function(options){
                        angular.extend(this,options || {});
                        this.init();
                },
                findEl : function(){
                        var container = this.container = angular.element(element);
                        if(!container.length){return null;}

                        this.wrap = this.wrap && container.find(this.wrap) || container.children().eq(0);
                        if(!this.wrap.length){return null;}

                        this.panel = this.panel && container.find(this.panel) || this.wrap.children().eq(0);
                        if(!this.panel.length){return null;}

                        this.panels = this.panel.children();
                        if(!this.panels.length){  //对于没有图片的元素，直接隐藏
                                this.container.hide();
                                return null;
                        }

                        this.trigger = this.trigger;
                        this.prev = this.prev && container.find(this.prev);
                        this.next = this.next && container.find(this.next);
                        return this;
                },
                init : function(){
                        var wrap = this.wrap,
                        panel = this.panel,
                        panels = this.panels,
                        trigger = this.trigger,
                        len = this.len = panels.length,  //子元素的个数
                        margin = this.margin,
                        allWidth = 0,  //滑动容器的宽度
                        status = this.visible,  //每次切换多少个panels
                        useTransform = this.useTransform = hasTransform ? this.useTransform : false;  //不支持直接false,android默认false

                        //this.steps = this.steps || wrap.width();  //滑动步长，默认wrap的宽度
                        this.steps = this.steps ||  parseInt(window.getComputedStyle(this.wrap[0]).width);
                        angular.forEach(panels, function(item, n){
                                allWidth += item.offsetWidth;
                        });

                        if(margin && typeof margin == 'number'){
                                allWidth += (len-1) * margin;  //总宽度增加
                                this.steps += margin;  //步长增加margin
                        }

                        if(status > 1){this.loop = false;}  //如果一页显示的子元素超出1个，或设置了步长，则不支持循环；若自动播放，则只支持一次

                        //初始位置
                        var initLeft = this.left;
                        initLeft -= this.curIndex * this.steps;
                        this.setCoord(panel,initLeft);
{'fraction_non_alphanumeric': 0.11507720959106076, 'fraction_numerical': 0.007682160316598122, 'mean_word_length': 1.163141993957704, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '6302543', 'n_tokens_mistral': 3733, 'n_tokens_neox': 3704, 'n_words': 587}