Commit 1faed4b9 authored by Sébastien Blin's avatar Sébastien Blin

chatview: use common code

Change-Id: Ib0e98591f3206e719f1fce9e4816b232c3fc01b5
parent 5123d413
...@@ -444,6 +444,7 @@ load_javascript_libs(WebKitWebView *webview_chat, ...@@ -444,6 +444,7 @@ load_javascript_libs(WebKitWebView *webview_chat,
/* Create the list of libraries to load */ /* Create the list of libraries to load */
priv->js_libs_to_load = g_list_append(priv->js_libs_to_load, (gchar*) "/net/jami/JamiGnome/jed.js"); priv->js_libs_to_load = g_list_append(priv->js_libs_to_load, (gchar*) "/net/jami/JamiGnome/jed.js");
priv->js_libs_to_load = g_list_append(priv->js_libs_to_load, (gchar*) "/net/jami/JamiGnome/linkify.js"); priv->js_libs_to_load = g_list_append(priv->js_libs_to_load, (gchar*) "/net/jami/JamiGnome/linkify.js");
priv->js_libs_to_load = g_list_append(priv->js_libs_to_load, (gchar*) "/net/jami/JamiGnome/chatview.js");
priv->js_libs_to_load = g_list_append(priv->js_libs_to_load, (gchar*) "/net/jami/JamiGnome/linkify-string.js"); priv->js_libs_to_load = g_list_append(priv->js_libs_to_load, (gchar*) "/net/jami/JamiGnome/linkify-string.js");
priv->js_libs_to_load = g_list_append(priv->js_libs_to_load, (gchar*) "/net/jami/JamiGnome/linkify-html.js"); priv->js_libs_to_load = g_list_append(priv->js_libs_to_load, (gchar*) "/net/jami/JamiGnome/linkify-html.js");
...@@ -551,6 +552,22 @@ build_view(WebKitChatContainer *view) ...@@ -551,6 +552,22 @@ build_view(WebKitChatContainer *view)
); );
webkit_user_content_manager_add_style_sheet(webkit_content_manager, chatview_style_sheet); webkit_user_content_manager_add_style_sheet(webkit_content_manager, chatview_style_sheet);
chatview_style_sheet = webkit_user_style_sheet_new(
(gchar*) g_bytes_get_data(
g_resources_lookup_data(
"/net/jami/JamiGnome/chatview-gnome.css",
G_RESOURCE_LOOKUP_FLAGS_NONE,
NULL
),
NULL
),
WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES,
WEBKIT_USER_STYLE_LEVEL_USER,
NULL,
NULL
);
webkit_user_content_manager_add_style_sheet(webkit_content_manager, chatview_style_sheet);
/* Prepare WebKitSettings */ /* Prepare WebKitSettings */
WebKitSettings* webkit_settings = webkit_settings_new_with_settings( WebKitSettings* webkit_settings = webkit_settings_new_with_settings(
"enable-javascript", TRUE, "enable-javascript", TRUE,
......
...@@ -19,7 +19,7 @@ Before pushing a patch, make sure that it passes ESLint: ...@@ -19,7 +19,7 @@ Before pushing a patch, make sure that it passes ESLint:
$ eslint chatview.html $ eslint chatview.html
Most trivial issues can be fixed using Most trivial issues can be fixed using
$ eslint chatview.html --fix $ eslint chatview.js --fix
We will not accept patches introducing non-ESLint-compliant code. We will not accept patches introducing non-ESLint-compliant code.
......
.internal_mes_wrapper {
margin: 3px 0 0 0;
}
.message_wrapper {
padding: 1em;
}
.sender_image {
margin: 10px;
}
.message_out + .message_out .message_wrapper {
border-top-right-radius: 10px;
}
.message_in + .message_in .message_wrapper {
border-top-left-radius: 10px;
}
.message_in + .message_in .sender_image {
visibility: hidden;
}
.message_out + .message_out .sender_image {
visibility: hidden;
}
.message_text {
hyphens: auto;
word-break: break-word;
word-wrap: break-word;
}
\ No newline at end of file
.internal_mes_wrapper {
margin: 0;
}
.message_wrapper {
padding: 0.5em 1em 0.5em 1em;
}
.sender_image {
margin: 0px 10px 0px 10px;
}
.message_in .message_wrapper {
background-color: #cfebf5;
}
.message_in .sender_image,
.message_out .sender_image {
visibility: hidden;
}
.message_in.last_of_sequence .sender_image,
.message_in.single_message .sender_image {
visibility: visible;
}
.message_in.last_of_sequence .sender_image {
margin-top: 2px;
}
.message_in.middle_of_sequence .sender_image {
margin-top: 0px;
}
.generated_message.message_in .message_wrapper,
.generated_message.message_out .message_wrapper {
background-color: transparent !important;
border-radius: 0px !important;
}
.single_message.message_in .message_wrapper,
.single_message.message_out .message_wrapper {
border-radius: 0.7em 0.7em 0.7em 0.7em !important;
}
.last_of_sequence.message_in .message_wrapper {
border-radius: 0.7em 0.7em 0.7em 0.7em;
}
.first_of_sequence.message_in .message_wrapper {
border-radius: 0.7em 0.7em 0.7em 0.7em;
}
.middle_of_sequence.message_in .message_wrapper {
border-radius: 0.7em 0.7em 0.7em 0.7em;
}
.last_of_sequence.message_out .message_wrapper {
border-radius: 0.7em 0.7em 0.7em 0.7em;
}
.first_of_sequence.message_out .message_wrapper {
border-radius: 0.7em 0.7em 0.7em 0.7em;
}
.middle_of_sequence.message_out .message_wrapper {
border-radius: 0.7em 0.7em 0.7em 0.7em;
}
.middle_of_sequence .internal_mes_wrapper,
.last_of_sequence .internal_mes_wrapper,
.last_message .internal_mes_wrapper {
margin: 0px 0 0 0 !important;
}
.message_out .sender_image {
margin: 0px;
}
.first_of_sequence.message_out .internal_mes_wrapper,
.single_message.message_out .internal_mes_wrapper {
margin: 0px 0 0 0 !important;
}
.message_text {
word-break: break-all;
word-wrap: hyphenate;
}
pre {
white-space: pre-wrap;
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<file>chatview.html</file> <file>chatview.html</file>
<!-- JavaScript --> <!-- JavaScript -->
<file>chatview.js</file>
<file>linkify.js</file> <file>linkify.js</file>
<file>linkify-string.js</file> <file>linkify-string.js</file>
<file>linkify-html.js</file> <file>linkify-html.js</file>
...@@ -12,6 +13,7 @@ ...@@ -12,6 +13,7 @@
<!-- CSS --> <!-- CSS -->
<file>chatview.css</file> <file>chatview.css</file>
<file>chatview-gnome.css</file>
<!-- Locale --> <!-- Locale -->
</gresource> </gresource>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment