Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="form-group pull-left">
- <input type="file" id="scriptFile" class="form-control input-sm inputfile">
- <label for="scriptFile"><div class="glyphicon glyphicon-open"></div><span> Choose a Script…</span></label>
- </div>
- $("#scriptFile").change(function(event) {
- var file = event.target.files[0];
- // Just updates the "select a file" button to display the selected file's name.
- $("#scriptFile").next('label').find('span').html(" " + event.target.value.split( '\' ).pop());
- var reader = new FileReader();
- reader.onload = function(event) {
- editor.setValue(event.target.result);
- editor.clearSelection();
- };
- reader.readAsText(file);
- $('#scriptFile').addClass("selected"); //CSS purposes
- editor.focus();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement