Skip to content

Instantly share code, notes, and snippets.

<?
private function parse_view($html){
$html = preg_replace(
array(
"/\{using ([^}]*)\}/i",
"/\{include ([^}]*)\}/i",
"/\{func ([A-Za-z_]*)->([^}]*)\(([^\)]*)\)\}/i"
),
array(
"<?
<%% using(common) %%>
<%% common/header() %%>
page content
<%% common/footer() %%>
var that = this;
Overlay = {
init: function(elementToOverlay, content, options) {
that.options = $.extend({
element: 'div',
attributes: {}
}, options);
that.overlay = $(html[that.options.element](that.options.attributes, content))
.click(that.hideOverlay)
/*
* this.getTextSelection()
* Utility function that returns the text that is selected
* and is cross-browser compatible.
*/
OsimoEditorControls.prototype.getTextSelection = function(){
var textarea = $('#'+this.input+'_editbox').get(0);
if (window.getSelection) {
var len = textarea.value.length;
var start = textarea.selectionStart;