Created
January 14, 2016 07:29
-
-
Save mkhatib/ec20159754a48d509629 to your computer and use it in GitHub Desktop.
Revisions
-
mkhatib created this gist
Jan 14, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ var element = document.getElementById('editor'); var editor = new carbon.Editor(element, { rtl: true, modules: [carbon.EmbeddedComponent] }); editor.install(carbon.EmbeddingExtension, { embedProviders: { embedly: new carbon.EmbedlyProvider({ apiKey: EMBEDLY_API_KEY }), carbon: new carbon.CarbonEmbedProvider() }, ComponentClass: carbon.EmbeddedComponent }); editor.install(carbon.SelfieExtension); editor.install(carbon.LayoutingExtension); editor.render(); editor.addEventListener('change', function(event) { localStorage.setItem('article', JSON.stringify(editor.getJSONModel())); }); editor.addEventListener('attachment-added', function(event){ var attachment = event.detail.attachment; var file = attachment.file; uploadFile(file, function(response) { attachment.setAttributes({ src: response.mediaLink, caption: response.caption' }); }); }); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ <html> <head> <link rel="stylesheet" href="dist/carbon.min.css" /> </head> <body> <div id="editor"></div> <script src="dist/carbon.min.js"></script> <script src="app.js"></script> </body> </html>