Hello. I trying to do this. But i need it in firefox extension. I'm including:
bitbucket.org/atlassian/simple-xdm/raw/62355f436bb3966cf4098f41cef544b7dbc4c6bc/dist/iframe.min.js
ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js
aui-cdn.atlassian.com/aui-adg/5.8.14/js/aui.js
and do this:
require('chat', function(chat) {
chat.appendMessage('Hello');
});
So, iframe.min.js say me this:
Error: See almond README: incorrect module build, no module name.
Could anyone give me full code (outside the HipChat ext) or say what i missed? Thanks.
Generally, i'm writing firefox plugin which must send some message via chat input. Couldn't do it via javascript button pressing emulation and etc, so, i noticed to api. Ideally i want just set text to input.
Ah... why don't you just access the chat input element directly and update the value then? The iframe.min.js you're including is specifically for use with HipChat Connect add-ons, not browser add-ons.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Scratch that... use the `HC.api.appendMessage({text:"TEXT"})` js api to append text to the chat input. Assuming you'll be able to execute you JS directly on the page.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Rich, u are my savior! But where i can read about this api? Considering full task, i need to catch message sending, change message and send. It's real via hacks although...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Would you mind explaining what it is you're trying to build? The HipChat Connect framework is meant to be used for addons that run within HipChat, and will not work outside that scope.
So for example, if you're building an extension for Firefox, you won't be able to use HipChat Connect.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ReferenceError: AP is not defined
<script> $.getScript( '//bitbucket.org/atlassian/simple-xdm/raw/62355f436bb3966cf4098f41cef544b7dbc4c6bc/dist/iframe.min.js', function() { $.getScript( '//aui-cdn.atlassian.com/aui-adg/5.8.14/js/aui.js', function() { AP.require('chat', function(chat) { chat.appendMessage('Hello!!'); }); } ); } ); </script>
Seems i missed some js libs to include.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why are you loading the script via ajax? Just add it to your <head>.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And after including iframe.min.js i have: Uncaught Error: See almond README: incorrect module build, no module name I googled many times, but could not fix it. It want i define some name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have to use the AP. prefix in front of require... like so:
AP.require('chat', function(chat) { chat.appendMessage('Hello!!'); });
BTW, aui.js and jquery aren't required for that to work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.