function SendMsg(content) {
angular.element('pre:last').scope().editAreaCtn =
String(content + '\n ----通过 X-Phone Plus 发布');
angular.element('pre:last').scope().sendTextMessage();
}
function SendMsgWithInput() {
var temp = document.getElementById('editArea').innerHTML;
angular.element('pre:last').scope().editAreaCtn =
String(temp + '\n ----通过 X-Phone 发布');
angular.element('pre:last').scope().sendTextMessage();
}
function CreateButton(buttonText) {
var votebutton = document.createElement("input");
votebutton.type = "button";
votebutton.value = buttonText;
votebutton.name = "custom-button";
votebutton.className = "btn btn-default";
votebutton.onclick = function () {
SendMsg(this.value);
};
tool_bar.appendChild(votebutton);
}
(function () {
'use strict';
var sendButton = '<a class="btn btn_send" href="javascript:;" ">发送</a>';
document.getElementsByClassName("btn_send")[0].outerHTML = sendButton;
document.getElementsByClassName("btn_send")[0].onclick = function () {
SendMsgWithInput();
};
document.getElementsByClassName("content ng-isolate-scope")[0].onkeydown =
function (event) {
var e = event || window.event ||
arguments.callee.caller.arguments[0];
if (e && e.shiftKey == 1) {
SendMsgWithInput();
}
};
CreateButton('test');
var toolbar = document.getElementsByClassName("toolbar")[0];
var signButton = document.createElement("input");
signButton.type = "button";
signButton.value = "带签名发送";
signButton.name = "sign-button";
signButton.className = "btn btn-default";
signButton.onclick = function () {
SendMsgWithInput();
};
toolbar.appendChild(signButton);
})();