locomotivecms / aloha-rails Goto Github PK
View Code? Open in Web Editor NEWRails 3.1 Integration for Aloha Editor
License: MIT License
Rails 3.1 Integration for Aloha Editor
License: MIT License
Hello,
I'm attempting to use this gem for the first time. I added the line to my gemfile and did bundle install. I then added
//= require aloha
in my application.js file after my require of jquery and added the link to the stylesheets in my layout. This causes the following scripts to be loaded on the page:
<script src="/assets/aloha/preinit.js?body=1" type="text/javascript"></script>
<script src="/assets/aloha/lib/require.js?body=1" type="text/javascript"></script>
<script src="/assets/aloha/lib/aloha.js?body=1" type="text/javascript"></script>
<script src="/assets/aloha.js?body=1" type="text/javascript"></script>
The preinit attempts:
window.Aloha.settings.baseUrl = '/assets/aloha/lib/';
but throws: Cannot read property 'settings' of undefined
aloha.js itself then throws:
Uncaught TypeError: Object function (module, callback) {
return _require("", module, callback);
} has no method 'config'
any ideas?
In view, I include some tag js for iframe:
<script src="/assets/locomotive/utils/aloha_settings.js?body=1" type="text/javascript" data-aloha-plugins="common/format,common/table,common/list,common/link,common/highlighteditables,common/block,common/undo,common/contenthandler,common/paste,common/commands,common/abbr,common/align,common/horizontalruler,custom/locomotive_media"></script>
<script src="/assets/aloha/preinit.js?body=1" type="text/javascript" data-aloha-plugins="common/format,common/table,common/list,common/link,common/highlighteditables,common/block,common/undo,common/contenthandler,common/paste,common/commands,common/abbr,common/align,common/horizontalruler,custom/locomotive_media"></script>
<script src="/assets/aloha/lib/aloha.js?body=1" type="text/javascript" data-aloha-plugins="common/format,common/table,common/list,common/link,common/highlighteditables,common/block,common/undo,common/contenthandler,common/paste,common/commands,common/abbr,common/align,common/horizontalruler,custom/locomotive_media"></script>
<script src="/assets/aloha.js?body=1" type="text/javascript" data-aloha-plugins="common/format,common/table,common/list,common/link,common/highlighteditables,common/block,common/undo,common/contenthandler,common/paste,common/commands,common/abbr,common/align,common/horizontalruler,custom/locomotive_media"></script>
<script src="/assets/locomotive/aloha.js?body=1" type="text/javascript" data-aloha-plugins="common/format,common/table,common/list,common/link,common/highlighteditables,common/block,common/undo,common/contenthandler,common/paste,common/commands,common/abbr,common/align,common/horizontalruler,custom/locomotive_media"></script>
<script type="text/javascript">
Aloha.ready(function() {
window.parent.application_view.set_page({"id":"51526eb07a03713982000006","_id":"51526eb07a03713982000006","created_at":"2013-03-27T10:59:44+07:00","updated_at":"2013-03-27T16:54:27+07:00","title":"Home page","slug":"index","fullpath":"index","handle":null,"published":true,"listed":true,"templatized":false,"templatized_from_parent":false,"redirect":false,"redirect_url":null,"cache_strategy":"none","response_type":"text\/html","template_changed":null,"editable_elements":[{"id":"515274537a03713982000009","_id":"515274537a03713982000009","created_at":null,"updated_at":null,"type":"EditableLongText","label":"tagline","slug":"tagline","block_name":"Default","block":null,"default_content":false,"default_attribute":null,"hint":"The tagline below the big title","priority":1,"disabled":false,"assignable":null,"from_parent":false,"content":"<p> Lorem ipsum (default content),,,,</p>"}],"localized_fullpaths":{"en":"index"}});
Aloha.settings = {
plugins: {
format: {
config: ["b", "i", "sub", "sup", "p", "h1", "h2", "h3", "h4", "h5", "h6"]
}
}
};
Aloha.jQuery('.editable_div').aloha()
});
</script>
When click to editable div, it not show toolbar editor, and each time type something, it will fire warning: Unkown Aloha Component: could not find commonAncestorContainer .And Can not using 'Backspace' and 'Delete'.
Hi, any ideas to include the extra plugins repository?
require in my application.js can't find aloha
Jquery version detection in chrome changed, breaking the ability of aloha 0.23.2 to determine if it's a chrome browser. This is updated in the current version of Aloha (0.23.6). For that reason, I'm not going to issue a pull request on my forked hotfix.
I followed the instructions on the README
file and here's the error I get:
couldn't find file 'aloha'
(in /root/app/assets/javascripts/application.js.erb:24)
I have bundled installed and restarted foreman already.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.