Commit 84f6456b authored by Matthieu Le Corre's avatar Matthieu Le Corre

fix images src

Signed-off-by: Matthieu Le Corre's avatarMatthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
parent de581e24
......@@ -17,7 +17,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/var o={name:"editor",start:function(t,e,n){var i=this;this.app_name=t,this.filename=e,this.context=n,this.init().then((function(){i.loadContent(),i.setupCallback()}))},init:function(){return i.e(1).then(i.t.bind(null,65,7)).then(t=>{this.whiteboard=t.init(document.getElementById(this.app_name+"-editor"),{imageURLPrefix:"/stable18/apps/"+this.app_name+"/img/lc_assets",toolbarPosition:"top"})})},loadContent:function(){var t=this,e=OC.generateUrl("apps/"+this.app_name+"/file/load");$.ajax({type:"GET",url:e,data:{path:this.context.dir+"/"+this.filename}}).done((function(e){console.log("Loading WB ..."),t.whiteboard.loadSnapshot(JSON.parse(e))}))},saveContent:function(){var t=OC.generateUrl("apps/"+this.app_name+"/file/save"),e={content:JSON.stringify(this.whiteboard.getSnapshot()),path:this.context.dir+"/"+this.filename};$.ajax({type:"POST",url:t,data:e}).done((function(t){console.log("Save whiteboard ...")}))},setupCallback:function(){var t=this;this.whiteboard.on("drawingChange",(function(){t.saveContent()}))},close:function(){this.whiteboard.teardown()}},r={name:"ApplicationPrototype",initialise:function(t,e,n){this.APP_NAME=t,this.APP_EXT=e,this.APP_MIME=n,this.NewFileMenu.APP_NAME=t,this.NewFileMenu.APP_EXT=e,this.NewFileMenu.APP_MIME=n,this.container="<div id="+this.APP_NAME+"-container><div id="+this.APP_NAME+"-editor></div></div>",this.closebtn="<div id="+this.APP_NAME+"-closebtn class=icon-close></div>",this.savebtn="<div id="+this.APP_NAME+"-savebtn class=icon-save></div>",OC.Plugins.register("OCA.Files.NewFileMenu",this.NewFileMenu),this.registerFileActions()},setupContainer:function(){var t=this;$("#content").append(this.container).addClass("viewer-mode").addClass("no-sidebar"),$("#"+this.APP_NAME+"-container").append(this.closebtn),$("#"+this.APP_NAME+"-closebtn").click((function(){o.close(),$("#"+t.APP_NAME+"-container").remove(),$("#content").removeClass("viewer-mode").removeClass("no-sidebard")})),$("#"+this.APP_NAME+"-container").append(this.savebtn),$("#"+this.APP_NAME+"-savebtn").click((function(){o.saveContent()}))},registerFileActions:function(){var t=this;OCA.Files.fileActions.registerAction({name:"Edit",mime:this.APP_MIME,permissions:OC.PERMISSION_READ,icon:function(){return OC.imagePath("core","actions/edit")},actionHandler:function(e,n){t.setupContainer(),t.editAction(e,n)}}),OCA.Files.fileActions.setDefault(this.APP_MIME,"Edit")},editAction:function(t,e){o.start(this.APP_NAME,t,e)},NewFileMenu:{attach:function(e){var n=this,i=e.fileList;"files"===i.id&&e.addMenuEntry({id:this.APP_NAME,displayName:t(this.APP_NAME,"New "+this.APP_NAME),templateName:t(this.APP_NAME,"New "+this.APP_NAME+"."+this.APP_EXT),iconClass:"icon-"+this.APP_NAME,fileType:this.APP_MIME,actionHandler:function(t){i.getCurrentDirectory();i.createFile(t).then((function(){console.log("New "+n.APP_NAME)}))}})}}};
*/var o={name:"editor",start:function(t,e,n){var i=this;this.app_name=t,this.filename=e,this.context=n,this.init().then((function(){i.loadContent(),i.setupCallback()}))},init:function(){return i.e(1).then(i.t.bind(null,65,7)).then(t=>{this.whiteboard=t.init(document.getElementById(this.app_name+"-editor"),{imageURLPrefix:OC.linkTo(this.app_name,"img/lc_assets"),toolbarPosition:"top"})})},loadContent:function(){var t=this,e=OC.generateUrl("apps/"+this.app_name+"/file/load");$.ajax({type:"GET",url:e,data:{path:this.context.dir+"/"+this.filename}}).done((function(e){console.log("Loading WB ..."),t.whiteboard.loadSnapshot(JSON.parse(e))}))},saveContent:function(){var t=OC.generateUrl("apps/"+this.app_name+"/file/save"),e={content:JSON.stringify(this.whiteboard.getSnapshot()),path:this.context.dir+"/"+this.filename};$.ajax({type:"POST",url:t,data:e}).done((function(t){console.log("Save whiteboard ...")}))},setupCallback:function(){var t=this;this.whiteboard.on("drawingChange",(function(){t.saveContent()}))},close:function(){this.whiteboard.teardown()}},r={name:"ApplicationPrototype",initialise:function(t,e,n){this.APP_NAME=t,this.APP_EXT=e,this.APP_MIME=n,this.NewFileMenu.APP_NAME=t,this.NewFileMenu.APP_EXT=e,this.NewFileMenu.APP_MIME=n,this.container="<div id="+this.APP_NAME+"-container><div id="+this.APP_NAME+"-editor></div></div>",this.closebtn="<div id="+this.APP_NAME+"-closebtn class=icon-close></div>",this.savebtn="<div id="+this.APP_NAME+"-savebtn class=icon-save></div>",OC.Plugins.register("OCA.Files.NewFileMenu",this.NewFileMenu),this.registerFileActions()},setupContainer:function(){var t=this;$("#content").append(this.container).addClass("viewer-mode").addClass("no-sidebar"),$("#"+this.APP_NAME+"-container").append(this.closebtn),$("#"+this.APP_NAME+"-closebtn").click((function(){o.close(),$("#"+t.APP_NAME+"-container").remove(),$("#content").removeClass("viewer-mode").removeClass("no-sidebard")})),$("#"+this.APP_NAME+"-container").append(this.savebtn),$("#"+this.APP_NAME+"-savebtn").click((function(){o.saveContent()}))},registerFileActions:function(){var t=this;OCA.Files.fileActions.registerAction({name:"Edit",mime:this.APP_MIME,permissions:OC.PERMISSION_READ,icon:function(){return OC.imagePath("core","actions/edit")},actionHandler:function(e,n){t.setupContainer(),t.editAction(e,n)}}),OCA.Files.fileActions.setDefault(this.APP_MIME,"Edit")},editAction:function(t,e){o.start(this.APP_NAME,t,e)},NewFileMenu:{attach:function(e){var n=this,i=e.fileList;"files"===i.id&&e.addMenuEntry({id:this.APP_NAME,displayName:t(this.APP_NAME,"New "+this.APP_NAME),templateName:t(this.APP_NAME,"New "+this.APP_NAME+"."+this.APP_EXT),iconClass:"icon-"+this.APP_NAME,fileType:this.APP_MIME,actionHandler:function(t){i.getCurrentDirectory();i.createFile(t).then((function(){console.log("New "+n.APP_NAME)}))}})}}};
/**
* @author Matthieu Le Corre <matthieu.lecorre@univ-nantes.fr>
*
......
This diff is collapsed.
......@@ -42,7 +42,7 @@ export default {
this.whiteboard = LC.init(
document.getElementById(this.app_name+'-editor'),
{
imageURLPrefix: '/stable18/apps/'+this.app_name+'/img/lc_assets' ,
imageURLPrefix: OC.linkTo(this.app_name,'img/lc_assets') ,
toolbarPosition: 'top'
}
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment