Skip to content

Instantly share code, notes, and snippets.

@timsuzman
Created July 2, 2012 21:54
Show Gist options
  • Save timsuzman/3035962 to your computer and use it in GitHub Desktop.
Save timsuzman/3035962 to your computer and use it in GitHub Desktop.
bbcode
<div id="bbcode" style="float:left;margin-top:20px;">
<b>BBcode:</b>
<br>
<textarea>[url={{server_url}}/submissions/show?id={{submission.id}}][img]{{screenshot_url(submission.screenshot_id)}}[/img][/url]
by {{users[submission.user_id].username}} starting from [url={{server_url}}/prompts/show?id={{prompt.id}}]{{ prompt.title }}[/url]</textarea>
</div>
// from stackoverflow
$("#bbcode textarea").focus(function() {
$this = $(this);
$this.select();
// Work around Chrome's little problem
$this.mouseup(function() {
// Prevent further mouseup intervention
$this.unbind("mouseup");
return false;
});
});
#bbcode textarea {
width:300px;
height:50px;
background-color:#F0EEE6;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment