|
|
@ -1,4 +1,42 @@ |
|
|
|
(function($) { |
|
|
|
|
|
|
|
|
|
|
|
Aloha.ready(function() { |
|
|
|
var $aloha = Aloha.jQuery; |
|
|
|
$aloha('.textbox_canvas_content').aloha(); |
|
|
|
|
|
|
|
Aloha.bind("aloha-smart-content-changed", function(e, obj) { |
|
|
|
//var $editable = $(obj.editable.obj);
|
|
|
|
//console.log(e, obj);
|
|
|
|
var edited_obj = jQuery(obj.editable.obj); |
|
|
|
var html = edited_obj.html(); |
|
|
|
var boxJq = edited_obj.parents('.box'); |
|
|
|
var boxIndex = parseInt(boxJq.attr("data-index")); |
|
|
|
var canvasIndex = boxJq.parents('.canvas').attr("data-index"); |
|
|
|
if (boxJq.hasClass("textBox")) { |
|
|
|
var thisBox = edgeArticle[canvasIndex].textBoxes[boxIndex]; |
|
|
|
} |
|
|
|
|
|
|
|
thisBox.setHTML(html); |
|
|
|
|
|
|
|
// console.log($editable.attr("data-field"));
|
|
|
|
}); |
|
|
|
|
|
|
|
Aloha.bind("aloha-editable-activated", function(event, properties) { |
|
|
|
var thisElem = properties.editable; |
|
|
|
var thisBox = $(thisElem.obj).parents(".box"); |
|
|
|
thisBox.draggable("disable"); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
Aloha.bind("aloha-editable-deactivated", function(event, properties) { |
|
|
|
var thisElem = properties.editable; |
|
|
|
var thisBox = $(thisElem.obj).parents(".box"); |
|
|
|
thisBox.draggable("enable"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//var ARTICLE_ID = 0;
|
|
|
|
var BASE_URL = "http://edgwareroad.org/edit/" |
|
|
|
var edgeArticle = window.edgeArticle = []; |
|
|
@ -662,6 +700,7 @@ TextBox.prototype.init = function() { |
|
|
|
// thisBox.updateCSS(css);
|
|
|
|
} |
|
|
|
}); |
|
|
|
//Aloha.jQuery(e).find(".textbox_canvas_content").aloha();
|
|
|
|
return e; |
|
|
|
}; |
|
|
|
|
|
|
|