Skip to content

Commit

Permalink
Release v1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
zenorocha committed Oct 27, 2015
1 parent 9341fda commit 6653272
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "select",
"version": "1.0.2",
"version": "1.0.3",
"description": "Programmatically select the text of a HTML element",
"license": "MIT",
"main": "dist/select.js",
Expand Down
11 changes: 8 additions & 3 deletions dist/select.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.select = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
function select(element) {
var selection = window.getSelection();
var selectedText;

if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
element.selectionStart = 0;
element.selectionEnd = element.value.length;

selectedText = element.value;
}
else {
var selection = window.getSelection();
var range = document.createRange();

range.selectNodeContents(element);
selection.removeAllRanges();
selection.addRange(range);

selectedText = selection.toString();
}

return selection.toString();
return selectedText;
}

module.exports = select;

},{}]},{},[1])(1)
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "select",
"description": "Programmatically select the text of a HTML element",
"version": "1.0.2",
"version": "1.0.3",
"main": "src/select.js",
"repository": "zenorocha/select",
"keywords": [
Expand Down

0 comments on commit 6653272

Please sign in to comment.