diff options
Diffstat (limited to 'composer/include/email-composer-js.h')
-rwxr-xr-x | composer/include/email-composer-js.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/composer/include/email-composer-js.h b/composer/include/email-composer-js.h new file mode 100755 index 0000000..769d929 --- /dev/null +++ b/composer/include/email-composer-js.h @@ -0,0 +1,49 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef EMAIL_COMPOSER_JS_H_ +#define EMAIL_COMPOSER_JS_H_ + +#include "email-composer.h" + +#define COMPOSER_JS_ENABLE_EDITABLE "document.body.contentEditable='true'; void 0" +#define COMPOSER_JS_DISABLE_EDITABLE "document.body.contentEditable='false'; void 0" +#define COMPOSER_JS_SET_FOCUS "document.body.focus(); void 0" +#define COMPOSER_JS_SET_UNFOCUS "document.body.blur(); void 0" + +#define COMPOSER_JS_GET_HTML_CONTENT \ + "function getHtmlContent() { " \ + "console.log(\"Here\");" \ + "var elements = document.getElementsByTagName(\"body\");" \ + "console.log(\"elements[0].outerHTML : \" + elements[0].outerHTML);" \ + "return elements[0].outerHTML;" \ + "};" \ + "getHtmlContent();" + +#define COMPOSER_JS_GET_IMAGE_LIST \ + "function getImgs() { " \ + "var imgs = document.getElementsByTagName(\"img\");" \ + "var srcs = \"\";" \ + "for (var i = 0; i < imgs.length; i++) {" \ + "srcs += imgs[i].src + \",\" ;" \ + "console.log(\"imgs[\" + i + \"].src : \" + imgs[i].src);" \ + "console.log(\"srcs : \" + srcs);" \ + "}" \ + "return srcs;" \ + "};" \ + "getImgs();" + +#endif /* EMAIL_COMPOSER_JS_H_ */ |