|
@@ -1,5 +1,6 @@
|
|
|
//CHARGEMENT DE LA PAGE
|
|
|
function init_plugin_hackpoint(){
|
|
|
+
|
|
|
switch($.urlParam('page')){
|
|
|
case 'sheet.sketch':
|
|
|
if($('.hackpoint').hasClass('readonly')){
|
|
@@ -21,6 +22,13 @@ function init_plugin_hackpoint(){
|
|
|
}
|
|
|
|
|
|
|
|
|
+function hackpoint_resource_markdown_parse(){
|
|
|
+ var editor = $('#content').data('codemirror');
|
|
|
+
|
|
|
+
|
|
|
+ $('#htmlcontent').html( marked(editor.getValue()));
|
|
|
+}
|
|
|
+
|
|
|
//Enregistrement des configurations
|
|
|
function hackpoint_setting_save(){
|
|
|
$.action({
|
|
@@ -47,7 +55,7 @@ modalize : function(options){
|
|
|
}
|
|
|
|
|
|
var form = obj.detach();
|
|
|
- form.removeClass('hide');
|
|
|
+ form.removeClass('hidden');
|
|
|
modal.html(form.get(0).outerHTML);
|
|
|
|
|
|
var modalize = {
|
|
@@ -391,9 +399,10 @@ function hackpoint_resource_title_edit(event,element){
|
|
|
|
|
|
|
|
|
function hackpoint_resource_mirrorify(element,data){
|
|
|
-
|
|
|
+ var options = data;
|
|
|
if($('.hackpoint').hasClass('readonly')) data.readOnly = true;
|
|
|
var editor = CodeMirror.fromTextArea($(element).get(0), data);
|
|
|
+ $(element).data('codemirror',editor);
|
|
|
editor.on("blur", function(cm,obj){
|
|
|
if($('.hackpoint').hasClass('readonly')) return;
|
|
|
var data = {};
|
|
@@ -407,7 +416,10 @@ function hackpoint_resource_mirrorify(element,data){
|
|
|
},300);
|
|
|
});
|
|
|
});
|
|
|
+
|
|
|
+
|
|
|
editor.on("change", function() {
|
|
|
+ if(options.change) options.change();
|
|
|
var data ={height:800};
|
|
|
var wrap = editor.getWrapperElement();
|
|
|
var approp = editor.getScrollInfo().height > data.height ? data.height+"px" : "auto";
|
|
@@ -416,6 +428,7 @@ function hackpoint_resource_mirrorify(element,data){
|
|
|
editor.refresh();
|
|
|
}
|
|
|
});
|
|
|
+ if(options.complete) options.complete();
|
|
|
}
|
|
|
|
|
|
//Ajout ou modification d'élément resource
|