Browse Source

update bootstrap and bootswatch paper to latest versions. implemented wrapper for dirlist method in javascript. improved some styles for the default theme.

sisyphus
Dustin Falgout 8 years ago
parent
commit
3da6a2796d
  1. 2
      data/lightdm-webkit2-greeter.conf
  2. 75
      src/gresource/js/ThemeUtils.js
  3. 10
      src/webkit2-extension.c
  4. 6
      themes/_vendor/css/bootstrap.min.css
  5. 1239
      themes/_vendor/css/bootswatch-paper.bootstrap.min.css
  6. 12
      themes/antergos/css/style.css

2
data/lightdm-webkit2-greeter.conf

@ -3,7 +3,7 @@
# debug_mode = Greeter theme debug mode.
# secure_mode = Don't allow themes to make remote http requests.
# screensaver_timeout = Blank the screen after this many seconds of inactivity.
# time_format = A moment.js format string for use by theme's to display the time.
# time_format = A moment.js format string so the greeter can generate localized time for display.
# time_language = Language to use when displaying the time or "auto" to use the system's language.
# webkit_theme = Webkit theme to use.
#

75
src/gresource/js/ThemeUtils.js

@ -33,7 +33,8 @@ moment.locale( window.navigator.languages );
let localized_invalid_date = moment('today', '!@#'),
time_language = null,
time_format = null;
time_format = null,
allowed_dirs = null;
@ -44,7 +45,7 @@ let localized_invalid_date = moment('today', '!@#'),
*
* @memberOf LightDM
*/
const ThemeUtils = {
class ThemeUtils {
/**
* Binds `this` to class, `context`, for all of the class's methods.
*
@ -74,7 +75,7 @@ const ThemeUtils = {
}
}
}
},
}
/**
@ -88,7 +89,51 @@ const ThemeUtils = {
*
* @returns {String[]} List of abs paths for the files and directories found in `path`.
*/
dirlist( path ) {},
dirlist( path ) {
let allowed = true;
if ( '' === path || ! path instanceof String ) {
console.log('[ERROR] theme_utils.dirlist(): path must be a non-empty string!');
allowed = false;
} else if ( null !== path.match(/^[^/].+/) ) {
console.log('[ERROR] theme_utils.dirlist(): path must not include be absolute!');
allowed = false;
}
if ( null !== path.match(/\/\.+(?=\/)/) ) {
// No special directory names allowed (eg ../../)
path = path.replace(/\/\.+(?=\/)/g, '' );
}
if ( null === allowed_dirs ) {
let user = lightdm.users.pop();
allowed_dirs = {
themes_dir: greeter_config.get_str( user.username, 'lightdm_data_dir' ),
backgrounds_dir: greeter_config.get_str( 'greeter', 'themes_dir' ),
lightdm_data_dir: greeter_config.get_str( 'branding', 'background_images' ),
tmpdir: '/tmp'
};
}
if ( ! Object.keys( allowed_dirs ).some( dir => path.startsWith( allowed_dirs[dir] ) ) ) {
console.log(`[ERROR] theme_utils.dirlist(): path is not allowed: ${path}`);
allowed = false;
}
if ( ! allowed ) {
return [];
}
try {
return __ThemeUtils.dirlist( path );
} catch( err ) {
console.log( `[ERROR] theme_utils.dirlist(): ${err}` );
return [];
}
}
/**
* Escape HTML entities in a string.
@ -97,7 +142,9 @@ const ThemeUtils = {
*
* @returns {String}
*/
esc_html( text ) {},
esc_html( text ) {
return this.txt2html( text );
}
/**
@ -132,23 +179,29 @@ const ThemeUtils = {
}
return local_time;
},
}
/**
* @deprecated Use {@link theme_utils.esc_html()} instead.
*/
txt2html( text ) {},
};
txt2html( text ) {
try {
return __ThemeUtils.txt2html( text );
} catch( err ) {
console.log( `[ERROR] theme_utils.dirlist(): ${err}` );
return text;
}
}
}
/**
* @memberOf window
* @type {LightDM.ThemeUtils}
*/
window.theme_utils = __ThemeUtils;
window.theme_utils.bind_this = ThemeUtils.bind_this;
window.theme_utils.get_current_localized_time = ThemeUtils.get_current_localized_time;
window.theme_utils = new ThemeUtils();
/**
* @deprecated

10
src/webkit2-extension.c

@ -1175,7 +1175,17 @@ get_conf_str_cb(JSContextRef context,
return JSValueMakeNull(context);
}
if (0 == g_strcmp0(key, "themes_dir")) {
value = g_strdup_printf("%s", THEME_DIR);
} else if (0 == g_strcmp0(key, "lightdm_data_dir")) {
value = lightdm_greeter_ensure_shared_data_dir_sync(GREETER, section);
} else {
value = g_key_file_get_string(keyfile, section, key, &err);
}
if (err) {
_mkexception(context, exception, err->message);

6
themes/_vendor/css/bootstrap.min.css vendored

File diff suppressed because one or more lines are too long

1239
themes/_vendor/css/bootswatch-paper.bootstrap.min.css vendored

File diff suppressed because one or more lines are too long

12
themes/antergos/css/style.css

@ -563,23 +563,25 @@ input.password.form-control:focus {
top: 2px;
}
a.list-group-item:focus, a.list-group-item:hover, a.list-group-item.hovered {
a.list-group-item:focus, a.list-group-item.hovered {
position: relative;
-webkit-box-shadow: 0 1px 0px rgba(0, 0, 0, 0.1), 0 0 1px rgba(0, 0, 0, 0.1) inset;
box-shadow: 0 1px 0px rgba(0, 0, 0, 0.1), 0 0 1px rgba(0, 0, 0, 0.1) inset;
box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);
border-color: transparent;
outline: none;
margin: 0px 0;
background: #FFFFFF;
}
a.list-group-item.hover:not(:focus) {
background: #f0f0f0;
}
a.list-group-item:focus:before, a.list-group-item:focus:after,
a.list-group-item:hover:before, a.list-group-item:hover:after,
a.list-group-item.hovered:after, a.list-group-item.hovered:before {
content: "";
position: absolute;
z-index: -1;
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
box-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
top: 0;
bottom: 0;
left: 10px;

Loading…
Cancel
Save