<commit_before><link rel="stylesheet" href="css/fox-listview.css"/>

/*fox-listview*/
<fox-element name="fox-listview">
    <script>
        (function() {
            var menu_swipeLeft = function() {
                var swipeDoms = this.querySelectorAll('a.swipe-left');
                var L = swipeDoms.length;
                var translateX = 0, isopen = false;
                var touchStart = function(e) {
                    isdrag = true;
                    e.preventDefault();
                    tp_startX = e.touches[0].pageX - translateX;   /*touch point*/
                    x = e.touches[0].pageX;   /*touch point*/
                    y = e.touches[0].pageY;   /*touch point*/
                    var menu = this.nextElementSibling;
                    menuW = menu.children.length*68;
                }
                var touchMove = function(e) {
                    if (Math.abs(e.touches[0].pageX - x) < Math.abs(e.touches[0].pageY - y)) {
                        return;
                    }
                    if (isdrag){
                        e.preventDefault();
                        isopen = false;
                        var tp_move = e.touches[0].pageX;   /*touch point move*/
                        var tp_length = tp_move - tp_startX;
                        this.style.webkitTransform = 'translate3d('+ tp_length +'px, 0, 0)';
                        this.style.webkitTransition =  'none';
                        var reg= /\(([^,]+)+/g ;
                        translateX = parseInt(reg.exec(this.style.webkitTransform)[1]);
                    }
                }

                var touchEnd = function() {
                    if(isopen == true) {
                        this.style.webkitTransform = 'translate3d(0, 0, 0)';
                        this.style.webkitTransition =  '300ms';
                        translateX = 0;
                    }
                    if(translateX > -menuW/2 && translateX < 0) {
                        this.style.webkitTransform = 'translate3d(0, 0, 0)';
                        this.style.webkitTransition =  '300ms';
                        translateX = 0;
                    }else if(translateX > -menuW && translateX < -menuW/2){
                        this.style.webkitTransform = 'translate3d(-'+ menuW +'px, 0, 0)';
                        this.style.webkitTransition =  '300ms';
                        translateX = -menuW;
                        isopen = true;
                    }else if(translateX <= -menuW) {
                        this.style.webkitTransform = 'translate3d(-'+ menuW +'px, 0, 0)';
                        translateX = -menuW;
                        isopen = true;
                    }else if(translateX > 0) {
                        this.style.webkitTransform = 'translate3d(0, 0, 0)';
                        this.style.webkitTransition =  '300ms';
                        translateX = 0;
                    }
                }
                for( var i = 0; i < L; i++ ) {
                    swipeDoms[i].addEventListener('touchstart', touchStart);
                    swipeDoms[i].addEventListener('touchmove', touchMove);
                    swipeDoms[i].addEventListener('touchend', touchEnd);

                }
            }

            fox('fox-listview', {
                lifecycle: {
                    created: function() {
                        menu_swipeLeft.call(this);
                    }
                }
            });
        })();
    </script>
</fox-element><commit_msg>fox-listview<commit_after><link rel="stylesheet" href="css/fox-listview.css"/>

/*fox-listview*/
<fox-element name="fox-listview">
    <script>
        (function() {
            var menu_swipeLeft = function() {
                var swipeDoms = this.querySelectorAll('a.swipe-left');
                var L = swipeDoms.length;
                var translateX = 0, isopen = false;
                var touchStart = function(e) {
                    isdrag = true;
                    e.preventDefault();
                    tp_startX = e.touches[0].pageX - translateX;   /*touch point*/
                    x = e.touches[0].pageX;   /*touch point*/
                    y = e.touches[0].pageY;   /*touch point*/
                    var menu = this.nextElementSibling;
                    menuW = menu.children.length*68;
                }
                var touchMove = function(e) {
                    if (Math.abs(e.touches[0].pageX - x) < Math.abs(e.touches[0].pageY - y)) {
                        return;
                    }
                    if (isdrag){
                        e.preventDefault();
                        isopen = false;
                        var tp_move = e.touches[0].pageX;   /*touch point move*/
                        var tp_length = tp_move - tp_startX;
                        this.style.webkitTransform = 'translate3d('+ tp_length +'px, 0, 0)';
                        this.style.webkitTransition =  'none';
                        var reg= /\(([^,]+)+/g ;
                        translateX = parseInt(reg.exec(this.style.webkitTransform)[1]);
                    }
                }

                var touchEnd = function() {
                    if(isopen == true) {
                        this.style.webkitTransform = 'translate3d(0, 0, 0)';
                        this.style.webkitTransition =  '300ms';
                        translateX = 0;
                    }
                    if(translateX > -menuW/2 && translateX < 0) {
                        this.style.webkitTransform = 'translate3d(0, 0, 0)';
                        this.style.webkitTransition =  '300ms';
                        translateX = 0;
                    }else if(translateX > -menuW && translateX < -menuW/2){
                        this.style.webkitTransform = 'translate3d(-'+ menuW +'px, 0, 0)';
                        this.style.webkitTransition =  '300ms';
                        translateX = -menuW;
                        isopen = true;
                    }else if(translateX <= -menuW) {
                        this.style.webkitTransform = 'translate3d(-'+ menuW +'px, 0, 0)';
                        translateX = -menuW;
                        isopen = true;
                    }else if(translateX > 0) {
                        this.style.webkitTransform = 'translate3d(0, 0, 0)';
                        this.style.webkitTransition =  '300ms';
                        translateX = 0;
                    }
                }
                for( var i = 0; i < L; i++ ) {
                    swipeDoms[i].addEventListener('touchstart', touchStart);
                    swipeDoms[i].addEventListener('touchmove', touchMove);
                    swipeDoms[i].addEventListener('touchend', touchEnd);
                     swipeDoms[i].nextElementSibling.addEventListener('touchend', function() {
                     this.previousElementSibling.style.webkitTransform = 'translate3d(0, 0, 0)';
                     this.previousElementSibling.style.webkitTransition =  '300ms';
                     translateX = 0;
                     });
                }
                /*touch the menu-item*/


            }

            fox('fox-listview', {
                lifecycle: {
                    created: function() {
                        menu_swipeLeft.call(this);
                    }
                }
            });
        })();
    </script>
</fox-element>
{'fraction_non_alphanumeric': 0.11655450874831763, 'fraction_numerical': 0.014804845222072678, 'mean_word_length': 1.0676126878130217, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 19, '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': '3475765', 'n_tokens_mistral': 2085, 'n_tokens_neox': 1877, 'n_words': 350}