Last active
December 10, 2015 22:09
-
-
Save lambtron/4500330 to your computer and use it in GitHub Desktop.
This is the home page of the TextMe! application. This describes how the user would put in his/her phone number and generate a link that would be dragged to the toolbar to act as a bookmarklet.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section class="form"> | |
<input type="text" placeholder="xxx-xxx-xxxx"> | |
<button type="submit">Make my bookmarklet!</button> | |
</section> | |
<section id="bookmarklet-container"> | |
<span><p>Your link will be generated below and drag it to your toolbar!</p></span> | |
<div id="bookmarklet"> | |
</div> | |
</section> | |
<script type="text/javascript"> | |
$(document).ready( function() { | |
$('.form > .btn').click( function() { | |
var recipient = $('.form .input-medium').val(); | |
if ( recipient != "" ) { | |
var href = "javascript:(function(){var s=document.createElement('script');s.src='http://www.andy-jiang.com/text2.js';s.onload=function(){sendSMS(" + recipient + ")};document.body.appendChild(s);})();"; | |
// Make the draggable bookmarklet. | |
var a = document.createElement('a'); | |
a.title = "TextMe!"; | |
a.innerHTML = "TextMe!"; | |
a.href = href; | |
$('#bookmarklet').html(a); | |
} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment