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. 13101
      src/gresource/js/_vendor/moment-with-locales.min.js
  6. 13
      src/meson.build
  7. 1
      themes/simple/index.html

2
build/utils.sh

@ -8,7 +8,7 @@ combine_javascript_sources() {
Greeter.js \
GreeterConfig.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
greeter_loaded_handler(void) {
load_script(GRESOURCE_PATH "/js/_vendor/moment-with-locales.min.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");
load_script(GRESOURCE_PATH "/js/bundle.js");
}

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

@ -2,12 +2,13 @@
<gresources>
<gresource prefix="/com/antergos/lightdm-webkit2-greeter/">
<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/Greeter.js</file>
<file>js/GreeterConfig.js</file>
<file>js/ThemeHeartbeat.js</file>
<file>js/ThemeUtils.js</file>
<file>js/ThemeHeartbeat.js</file>-->
</gresource>
</gresources>

20
src/gresource/js/ThemeUtils.js

@ -44,7 +44,7 @@ let localized_invalid_date = moment('today', '!@#'),
*
* @memberOf LightDM
*/
class ThemeUtils {
const ThemeUtils = {
/**
* 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`.
*/
dirlist( path ) {}
dirlist( path ) {},
/**
* Escape HTML entities in a string.
@ -97,7 +97,7 @@ class ThemeUtils {
*
* @returns {String}
*/
esc_html( text ) {}
esc_html( text ) {},
/**
@ -132,14 +132,14 @@ class ThemeUtils {
}
return local_time;
}
},
/**
* @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.get_current_localized_time = ThemeUtils.get_current_localized_time;
/* -------->>> DEPRECATED! <<<-------- */
/**
* @deprecated
* @type {LightDM.ThemeUtils}
*/
window.greeterutil = window.theme_utils;
/* -------->>> DEPRECATED! <<<-------- */

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

File diff suppressed because it is too large Load Diff

13
src/meson.build

@ -9,6 +9,19 @@ extdir = with_webext_dir[0]
gresources_dir = include_directories('gresource')
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(
'greeter-resources',

1
themes/simple/index.html

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

Loading…
Cancel
Save