code: function() {
  
        var ranges, i, sel, len;
  
        if (window.getSelection) {
          sel = window.getSelection();
          if (sel.getRangeAt && sel.rangeCount) {
            ranges = [];
            len = sel.rangeCount;
            for (i = 0; i < len; i += 1) {
              ranges.push(sel.getRangeAt(i));
            }
            return ranges;
          }
        } else if (document.selection && document.selection.createRange) {
          return document.selection.createRange();
        }
        return null;
      }
docs: Saves text selection