mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-25 20:41:20 -05:00
codemirror on demand
This commit is contained in:
parent
1a7660047f
commit
4cc15a9121
@ -254,7 +254,7 @@ class Pastes extends CI_Model
|
||||
$this->db->select('title, name, created, pid, snipurl');
|
||||
$this->db->where('replyto', $data['pid']);
|
||||
$this->db->order_by('id', 'desc');
|
||||
$this->db->limit(10);
|
||||
$this->db->limit(100);
|
||||
$query = $this->db->get('pastes');
|
||||
|
||||
if ($query->num_rows() > 0)
|
||||
|
@ -45,6 +45,13 @@
|
||||
<div class="item">
|
||||
<label for="paste">Your paste
|
||||
<span class="instruction">Paste your paste here</span>
|
||||
<?php
|
||||
if($this->uri->segment(1) == 'view'
|
||||
&& isset($codemirror_languages[$lang_set])
|
||||
&& gettype($codemirror_languages[$lang_set]) == 'array'){
|
||||
?><span class="instruction"><a href="#" id="enable_codemirror">Enable syntax highlighting</a></span><?php
|
||||
}
|
||||
?>
|
||||
</label>
|
||||
|
||||
<textarea id="code" name="code" cols="40" rows="20" tabindex="4"><?php if(isset($paste_set)){ echo $paste_set; }?></textarea>
|
||||
|
@ -9,5 +9,10 @@ CM.init = function() {
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
$enable_codemirror = $('#enable_codemirror');
|
||||
$enable_codemirror.click(function() {
|
||||
CM.init();
|
||||
$enable_codemirror.remove();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user