I could find function for text chat in Oxwall.
This javascript file have all function (ow_plugins/mailbox/static/js/contactmanager.js).
I could find the function for receive key from text chat, When i press enter, This function all text to server.
If i could send key enter (this means i can call this function with enter key parameter) i could send my link after i fill text chat box.
this.textareaControl.keypress(function (ev) {
if (!self.model.isSelected) {
self.model.setIsSelected(true);
}
if (ev.which === 13 && !ev.shiftKey) {
alert("jiq oooo dasto hora!!!22222 :D");
ev.preventDefault();
var body = $(this).val();
alert(body);
if ($.trim(body) == '')
return;
self.sendMessage(body);
if (self.dialogWindowHeight > 0) {
self.messageListWrapper.height(self.dialogWindowHeight);
}
$(this).attr('rows', 1);
$(this).css('height', self.textareaHeight);
self.scrollDialog();
self.model.setIsComposing(false);
}
else if (ev.which === 13 && ev.shiftKey) {
self.adjustTextarea($(this));
}
else {
self.adjustTextarea($(this));
}
}
I read this function and i could edit this function for better call:
function ehsan11() {
var ev = window.event;
alert(ev.which);
if (!self.model.isSelected) {
self.model.setIsSelected(true);
}
if (ev.which === 13 && !ev.shiftKey) {
alert("jiq oooo dasto hora!!!22222 :D");
ev.preventDefault();
var body = $(this).val();
alert(body);
if ($.trim(body) == '')
return;
self.sendMessage(body);
if (self.dialogWindowHeight > 0) {
self.messageListWrapper.height(self.dialogWindowHeight);
}
$(this).attr('rows', 1);
$(this).css('height', self.textareaHeight);
self.scrollDialog();
self.model.setIsComposing(false);
}
else if (ev.which === 13 && ev.shiftKey) {
self.adjustTextarea($(this));
}
else {
self.adjustTextarea($(this));
}
}
this.textareaControl.keypress(ehsan11);
But i still can not call ehsan11 function from outer, Because this function wrote in this unit:
OWMailbox.Dialog.Controller = function(model){
...
function ehsan11() {
...
}
this.textareaControl.keypress(ehsan11);
...
}
Can any one help me.
Thanks a lot.