Skip to content

Instantly share code, notes, and snippets.

@iamdey
Created April 30, 2012 16:02
Show Gist options
  • Save iamdey/2559583 to your computer and use it in GitHub Desktop.
Save iamdey/2559583 to your computer and use it in GitHub Desktop.
sceditor in a popin
<?php
var_dump($_POST);
$content = (isset($_POST['content'])) ? $_POST['content'] : '';
?>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="vendors/SCEditor/jquery.sceditor.js"></script>
<script src="vendors/SCEditor/jquery.sceditor.bbcode.js"></script>
<link rel="stylesheet" href="vendors/SCEditor/minified/jquery.sceditor.min.css" type="text/css" media="all" />
<style>
.popin {
position: absolute;
padding: 20px;
background-color: #eee;
border: 1px solid #333;
top: 100px;
z-index: 20;
left: 200px;
}
</style>
<script>
$(document).ready(function() {
$("#t1").sceditorBBCodePlugin({ });
//create popin
$("body").append('<div class="popin" />');
var popin = $(".popin");
var textarea_html = '<h2>popin textarea</h2><form id="t2" action="index.php" method="post"><textarea id="t1" required="required" name="content" style="height: 300px; width: 400px;"></textarea><button type="submit">Send</button></form>';
popin.html(textarea_html);
$("#t2").sceditorBBCodePlugin({
dropDownCss: {
"z-index": 20
}
});
});
</script>
</head>
<body>
<h1>test sceditor</h1>
<h2>Normal textarea</h2>
<form action="index.php" method="post">
<textarea id="t1" required="required" name="content" style="height: 300px; width: 400px;"><?php echo $content ?></textarea>
<button type="submit">Send</button>
</form>
<body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment