Browse Source

finishing up with #83

sisyphus
Dustin Falgout 8 years ago
parent
commit
14979df770
  1. 2
      build/utils.sh
  2. 6
      src/greeter.c
  3. 5
      src/gresource/greeter-resources.gresource.xml
  4. 20
      src/gresource/js/ThemeUtils.js
  5. 13357
      src/gresource/js/_vendor/moment-with-locales.min.js
  6. 17
      src/meson.build
  7. 1
      themes/simple/index.html

2
build/utils.sh

@ -8,7 +8,7 @@ combine_javascript_sources() {
Greeter.js \ Greeter.js \
GreeterConfig.js \ GreeterConfig.js \
ThemeUtils.js \ ThemeUtils.js \
ThemeHeartbeat.js > bundle.js ThemeHeartbeat.js >> "${MESON_SOURCE_ROOT}/src/gresource/js/bundle.js"
} }
} }

6
src/greeter.c

@ -207,11 +207,7 @@ load_script(char *script) {
static void static void
greeter_loaded_handler(void) { greeter_loaded_handler(void) {
load_script(GRESOURCE_PATH "/js/_vendor/moment-with-locales.min.js"); load_script(GRESOURCE_PATH "/js/bundle.js");
load_script(GRESOURCE_PATH "/js/Greeter.js");
load_script(GRESOURCE_PATH "/js/GreeterConfig.js");
load_script(GRESOURCE_PATH "/js/ThemeUtils.js");
load_script(GRESOURCE_PATH "/js/ThemeHeartbeat.js");
} }

5
src/gresource/greeter-resources.gresource.xml

@ -2,12 +2,13 @@
<gresources> <gresources>
<gresource prefix="/com/antergos/lightdm-webkit2-greeter/"> <gresource prefix="/com/antergos/lightdm-webkit2-greeter/">
<file>css/style.css</file> <file>css/style.css</file>
<file>js/_vendor/moment-with-locales.min.js</file> <file>js/bundle.js</file>
<!--<file>js/_vendor/moment-with-locales.min.js</file>
<file>js/LightDMObjects.js</file> <file>js/LightDMObjects.js</file>
<file>js/Greeter.js</file> <file>js/Greeter.js</file>
<file>js/GreeterConfig.js</file> <file>js/GreeterConfig.js</file>
<file>js/ThemeHeartbeat.js</file>
<file>js/ThemeUtils.js</file> <file>js/ThemeUtils.js</file>
<file>js/ThemeHeartbeat.js</file>-->
</gresource> </gresource>
</gresources> </gresources>

20
src/gresource/js/ThemeUtils.js

@ -44,7 +44,7 @@ let localized_invalid_date = moment('today', '!@#'),
* *
* @memberOf LightDM * @memberOf LightDM
*/ */
class ThemeUtils { const ThemeUtils = {
/** /**
* Binds `this` to class, `context`, for all of the class's methods. * Binds `this` to class, `context`, for all of the class's methods.
* *
@ -74,7 +74,7 @@ class ThemeUtils {
} }
} }
} }
} },
/** /**
@ -88,7 +88,7 @@ class ThemeUtils {
* *
* @returns {String[]} List of abs paths for the files and directories found in `path`. * @returns {String[]} List of abs paths for the files and directories found in `path`.
*/ */
dirlist( path ) {} dirlist( path ) {},
/** /**
* Escape HTML entities in a string. * Escape HTML entities in a string.
@ -97,7 +97,7 @@ class ThemeUtils {
* *
* @returns {String} * @returns {String}
*/ */
esc_html( text ) {} esc_html( text ) {},
/** /**
@ -132,14 +132,14 @@ class ThemeUtils {
} }
return local_time; return local_time;
} },
/** /**
* @deprecated Use {@link theme_utils.esc_html()} instead. * @deprecated Use {@link theme_utils.esc_html()} instead.
*/ */
txt2html( text ) {} txt2html( text ) {},
} };
/** /**
@ -150,6 +150,8 @@ window.theme_utils = __ThemeUtils;
window.theme_utils.bind_this = ThemeUtils.bind_this; window.theme_utils.bind_this = ThemeUtils.bind_this;
window.theme_utils.get_current_localized_time = ThemeUtils.get_current_localized_time; window.theme_utils.get_current_localized_time = ThemeUtils.get_current_localized_time;
/* -------->>> DEPRECATED! <<<-------- */ /**
* @deprecated
* @type {LightDM.ThemeUtils}
*/
window.greeterutil = window.theme_utils; window.greeterutil = window.theme_utils;
/* -------->>> DEPRECATED! <<<-------- */

13357
src/gresource/js/_vendor/moment-with-locales.min.js vendored

File diff suppressed because it is too large Load Diff

17
src/meson.build

@ -9,12 +9,25 @@ extdir = with_webext_dir[0]
gresources_dir = include_directories('gresource') gresources_dir = include_directories('gresource')
gnome = import('gnome') gnome = import('gnome')
utils = '@0@/utils.sh'.format(meson.build_root())
# Can't do it the right way until GLib 2.52 is released
# js_sources = run_command(utils, 'get-js-files').stdout().split()
#js_sources_combined = custom_target(
# 'javascript_sources',
# input: files(js_sources),
# output: 'bundle.js',
# command: [utils, 'combine-js']
#)
js_sources = run_command(utils, 'combine-js')
gresources = gnome.compile_resources( gresources = gnome.compile_resources(
'greeter-resources', 'greeter-resources',
'gresource/greeter-resources.gresource.xml', 'gresource/greeter-resources.gresource.xml',
source_dir : 'gresource', source_dir: 'gresource',
c_name : 'greeter_resources' c_name: 'greeter_resources'
) )
# ======================================= # # ======================================= #

1
themes/simple/index.html

@ -154,7 +154,6 @@
* authentication_complete callback. * authentication_complete callback.
*/ */
window.authentication_complete = function() { window.authentication_complete = function() {
console.log('fired!');
if (lightdm.is_authenticated) { if (lightdm.is_authenticated) {
// Start default session // Start default session
// let body = document.getElementById('body'); // let body = document.getElementById('body');

Loading…
Cancel
Save