Difference between revisions of "Team:Manchester/Improve"

Line 1: Line 1:
 
{{Manchester}}
 
{{Manchester}}
 
{{Manchester/Navbar}}
 
{{Manchester/Navbar}}
<html>
+
<html>/**
 +
* @fileoverview dragscroll - scroll area by dragging
 +
* @version 0.0.8
 +
*
 +
* @license MIT, see http://github.com/asvd/dragscroll
 +
* @copyright 2015 asvd <heliosframework@gmail.com>
 +
*/
  
  
<div class="clear"></div>
+
(function (root, factory) {
 +
    if (typeof define === 'function' && define.amd) {
 +
        define(['exports'], factory);
 +
    } else if (typeof exports !== 'undefined') {
 +
        factory(exports);
 +
    } else {
 +
        factory((root.dragscroll = {}));
 +
    }
 +
}(this, function (exports) {
 +
    var _window = window;
 +
    var _document = document;
 +
    var mousemove = 'mousemove';
 +
    var mouseup = 'mouseup';
 +
    var mousedown = 'mousedown';
 +
    var EventListener = 'EventListener';
 +
    var addEventListener = 'add'+EventListener;
 +
    var removeEventListener = 'remove'+EventListener;
 +
    var newScrollX, newScrollY;
  
 +
    var dragged = [];
 +
    var reset = function(i, el) {
 +
        for (i = 0; i < dragged.length;) {
 +
            el = dragged[i++];
 +
            el = el.container || el;
 +
            el[removeEventListener](mousedown, el.md, 0);
 +
            _window[removeEventListener](mouseup, el.mu, 0);
 +
            _window[removeEventListener](mousemove, el.mm, 0);
 +
        }
  
<div class="column full_size">
+
        // cloning into array since HTMLCollection is updated dynamically
<h1>Improve</h1>
+
        dragged = [].slice.call(_document.getElementsByClassName('dragscroll'));
<p>For teams seeking to improve upon a previous part or project, you should document all of your work on this page. Please remember to include all part measurement and characterization data on the part page on the Registry. Please include a link to your improved part on this page.</p>
+
        for (i = 0; i < dragged.length;) {
 +
            (function(el, lastClientX, lastClientY, pushed, scroller, cont){
 +
                (cont = el.container || el)[addEventListener](
 +
                    mousedown,
 +
                    cont.md = function(e) {
 +
                        if (!el.hasAttribute('nochilddrag') ||
 +
                            _document.elementFromPoint(
 +
                                e.pageX, e.pageY
 +
                            ) == cont
 +
                        ) {
 +
                            pushed = 1;
 +
                            lastClientX = e.clientX;
 +
                            lastClientY = e.clientY;
  
<h3>Gold Medal Criterion #2</h3>
+
                            e.preventDefault();
<p><b>Standard Tracks:</b> Create a new part that has a functional improvement upon an existing BioBrick part. The sequences of the new and existing parts must be different. You must perform experiments with both parts to demonstrate this improvement.  Document the experimental characterization on the Part's Main Page on the Registry for both the existing and new parts. Both the new and existing Main Page of each Part’s Registry entry must reference each other. Submit a sample of the new part to the Registry.
+
                        }
 +
                    }, 0
 +
                );
  
The existing part must NOT be from your 2018 part number range and must be different from the part documented in bronze #4.
+
                _window[addEventListener](
 
+
                    mouseup, cont.mu = function() {pushed = 0;}, 0
<br><br>
+
                );
<b>Special Tracks:</b> Improve the function of an existing iGEM project (that your current team did not originally create) and display your achievement on your wiki.</p>
+
 
+
 
+
</div>
+
  
 +
                _window[addEventListener](
 +
                    mousemove,
 +
                    cont.mm = function(e) {
 +
                        if (pushed) {
 +
                            (scroller = el.scroller||el).scrollLeft -=
 +
                                newScrollX = (- lastClientX + (lastClientX=e.clientX));
 +
                            scroller.scrollTop -=
 +
                                newScrollY = (- lastClientY + (lastClientY=e.clientY));
 +
                            if (el == _document.body) {
 +
                                (scroller = _document.documentElement).scrollLeft -= newScrollX;
 +
                                scroller.scrollTop -= newScrollY;
 +
                            }
 +
                        }
 +
                    }, 0
 +
                );
 +
            })(dragged[i++]);
 +
        }
 +
    }
  
 +
     
 +
    if (_document.readyState == 'complete') {
 +
        reset();
 +
    } else {
 +
        _window[addEventListener]('load', reset, 0);
 +
    }
  
 +
    exports.reset = reset;
 +
}));
 
</html>
 
</html>
 
{{Manchester/Footer}}
 
{{Manchester/Footer}}

Revision as of 18:53, 11 October 2018

/** * @fileoverview dragscroll - scroll area by dragging * @version 0.0.8 * * @license MIT, see http://github.com/asvd/dragscroll * @copyright 2015 asvd */ (function (root, factory) { if (typeof define === 'function' && define.amd) { define(['exports'], factory); } else if (typeof exports !== 'undefined') { factory(exports); } else { factory((root.dragscroll = {})); } }(this, function (exports) { var _window = window; var _document = document; var mousemove = 'mousemove'; var mouseup = 'mouseup'; var mousedown = 'mousedown'; var EventListener = 'EventListener'; var addEventListener = 'add'+EventListener; var removeEventListener = 'remove'+EventListener; var newScrollX, newScrollY; var dragged = []; var reset = function(i, el) { for (i = 0; i < dragged.length;) { el = dragged[i++]; el = el.container || el; el[removeEventListener](mousedown, el.md, 0); _window[removeEventListener](mouseup, el.mu, 0); _window[removeEventListener](mousemove, el.mm, 0); } // cloning into array since HTMLCollection is updated dynamically dragged = [].slice.call(_document.getElementsByClassName('dragscroll')); for (i = 0; i < dragged.length;) { (function(el, lastClientX, lastClientY, pushed, scroller, cont){ (cont = el.container || el)[addEventListener]( mousedown, cont.md = function(e) { if (!el.hasAttribute('nochilddrag') || _document.elementFromPoint( e.pageX, e.pageY ) == cont ) { pushed = 1; lastClientX = e.clientX; lastClientY = e.clientY; e.preventDefault(); } }, 0 ); _window[addEventListener]( mouseup, cont.mu = function() {pushed = 0;}, 0 ); _window[addEventListener]( mousemove, cont.mm = function(e) { if (pushed) { (scroller = el.scroller||el).scrollLeft -= newScrollX = (- lastClientX + (lastClientX=e.clientX)); scroller.scrollTop -= newScrollY = (- lastClientY + (lastClientY=e.clientY)); if (el == _document.body) { (scroller = _document.documentElement).scrollLeft -= newScrollX; scroller.scrollTop -= newScrollY; } } }, 0 ); })(dragged[i++]); } } if (_document.readyState == 'complete') { reset(); } else { _window[addEventListener]('load', reset, 0); } exports.reset = reset; }));