Browse Source

move vendor css, js, and fonts into new vendor dir for easy access from any theme that needs them.

sisyphus
Dustin Falgout 9 years ago
parent
commit
6f39331372
  1. 4
      NEWS
  2. 2
      configure.ac
  3. 9
      src/lightdm-webkit2-greeter.c
  4. 7
      themes/_vendor/Makefile.am
  5. 7
      themes/_vendor/css/Makefile.am
  6. 6
      themes/_vendor/css/bootstrap.min.css
  7. 0
      themes/_vendor/css/bootswatch-paper.bootstrap.min.css
  8. 0
      themes/_vendor/fonts/Makefile.am
  9. 2
      themes/_vendor/fonts/TTF/Makefile.am
  10. 0
      themes/_vendor/fonts/TTF/OpenSans-Light.ttf
  11. 0
      themes/_vendor/fonts/TTF/OpenSans-Regular.ttf
  12. 2
      themes/_vendor/fonts/font-awesome/Makefile.am
  13. 4
      themes/_vendor/fonts/font-awesome/font-awesome.min.css
  14. 0
      themes/_vendor/fonts/font-awesome/fontawesome-webfont.woff
  15. 0
      themes/_vendor/fonts/font-awesome/fontawesome-webfont.woff2
  16. 12
      themes/_vendor/js/Makefile.am
  17. 0
      themes/_vendor/js/bootstrap.min.js
  18. 0
      themes/_vendor/js/jquery.min.js
  19. 11
      themes/_vendor/js/js.cookie.min.js
  20. 0
      themes/_vendor/js/mock.js
  21. 0
      themes/_vendor/js/moment-with-locales.min.js
  22. 3
      themes/antergos/css/Makefile.am
  23. 4
      themes/antergos/css/style.css
  24. 7
      themes/antergos/css/vendor/Makefile.am
  25. 4
      themes/antergos/fonts/font-awesome/font-awesome.min.css
  26. 14
      themes/antergos/index.html
  27. 2
      themes/antergos/js/Makefile.am
  28. 34
      themes/antergos/js/greeter.js
  29. 10
      themes/antergos/js/vendor/Makefile.am
  30. 8
      themes/tools/Makefile.am

4
NEWS

@ -1,3 +1,7 @@
Overview of changes in lightdm-webkit2-greeter 2.1.3
* Implement work-around in default theme for webkit2gtk localStorage bug.
Overview of changes in lightdm-webkit2-greeter 2.1.2
* Allow access to right-click context menu when debug mode is enabled in lightdm-webkit2-greeter.conf.

2
configure.ac

@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(lightdm-webkit2-greeter, 2.1.2)
AC_INIT(lightdm-webkit2-greeter, 2.1.3)
AC_SUBST(THEME_DIR)
AC_CONFIG_HEADER(config.h)
AC_PREREQ([2.59])

9
src/lightdm-webkit2-greeter.c

@ -176,6 +176,7 @@ main(int argc, char **argv) {
WebKitUserContentManager *manager;
WebKitWebContext *context;
GtkCssProvider *css_provider;
WebKitWebsiteDataManager *data_manager;
/*
* Prevent memory from being swapped out, since we see unencrypted
@ -229,10 +230,16 @@ main(int argc, char **argv) {
GTK_STYLE_PROVIDER(css_provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
/* Create a website data manager object to configure our cache and data dirs */
data_manager = webkit_website_data_manager_new(
"base-cache-directory", g_strconcat(g_get_user_cache_dir(), "/", g_get_prgname(), NULL),
"base-data-directory", g_strconcat(g_get_user_data_dir(), "/", g_get_prgname(), NULL)
);
/* Register and connect handler that will set the web extensions directory
* so webkit can find our extension.
*/
context = webkit_web_context_get_default();
context = webkit_web_context_new_with_website_data_manager(data_manager);
g_signal_connect(context,
"initialize-web-extensions",
G_CALLBACK(initialize_web_extensions_cb), NULL);

7
themes/_vendor/Makefile.am vendored

@ -0,0 +1,7 @@
SUBDIRS = \
css
fonts
js
DISTCLEANFILES = \
Makefile.in

7
themes/_vendor/css/Makefile.am vendored

@ -0,0 +1,7 @@
vendorcssdir = $(THEME_DIR)/vendor/css
vendorcss_DATA = bootstrap.min.css bootswatch-paper.bootstrap.min.css
EXTRA_DIST = $(vendorcss_DATA)
DISTCLEANFILES = \
Makefile.in

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

File diff suppressed because one or more lines are too long

0
themes/antergos/css/vendor/bootstrap.min.css → themes/_vendor/css/bootswatch-paper.bootstrap.min.css vendored

0
themes/antergos/fonts/Makefile.am → themes/_vendor/fonts/Makefile.am vendored

2
themes/antergos/fonts/TTF/Makefile.am → themes/_vendor/fonts/TTF/Makefile.am vendored

@ -1,4 +1,4 @@
ttffontsdir = $(THEME_DIR)/antergos/fonts/TTF
ttffontsdir = $(THEME_DIR)/vendor/fonts/TTF
ttffonts_DATA = \
OpenSans-Light.ttf \
OpenSans-Regular.ttf

0
themes/antergos/fonts/TTF/OpenSans-Light.ttf → themes/_vendor/fonts/TTF/OpenSans-Light.ttf vendored

0
themes/antergos/fonts/TTF/OpenSans-Regular.ttf → themes/_vendor/fonts/TTF/OpenSans-Regular.ttf vendored

2
themes/antergos/fonts/font-awesome/Makefile.am → themes/_vendor/fonts/font-awesome/Makefile.am vendored

@ -1,4 +1,4 @@
fawesomedir = $(THEME_DIR)/antergos/fonts/font-awesome
fawesomedir = $(THEME_DIR)/vendor/fonts/font-awesome
fawesome_DATA = font-awesome.min.css fontawesome-webfont.woff2 fontawesome-webfont.woff
EXTRA_DIST = $(fawesome_DATA)

4
themes/_vendor/fonts/font-awesome/font-awesome.min.css vendored

File diff suppressed because one or more lines are too long

0
themes/antergos/fonts/font-awesome/fontawesome-webfont.woff → themes/_vendor/fonts/font-awesome/fontawesome-webfont.woff vendored

0
themes/antergos/fonts/font-awesome/fontawesome-webfont.woff2 → themes/_vendor/fonts/font-awesome/fontawesome-webfont.woff2 vendored

12
themes/_vendor/js/Makefile.am vendored

@ -0,0 +1,12 @@
vendorjsdir = $(THEME_DIR)/vendor/js
vendorjs_DATA = \
bootstrap.min.js \
jquery.min.js \
js.cookie.min.js \
mock.js \
moment-with-locales.min.js
EXTRA_DIST = $(vendorjs_DATA)
DISTCLEANFILES = \
Makefile.in

0
themes/antergos/js/vendor/bootstrap.min.js → themes/_vendor/js/bootstrap.min.js vendored

0
themes/antergos/js/vendor/jquery-2.1.4.min.js → themes/_vendor/js/jquery.min.js vendored

11
themes/_vendor/js/js.cookie.min.js vendored

@ -0,0 +1,11 @@
/*!
* JavaScript Cookie v2.1.0
* https://github.com/js-cookie/js-cookie
*
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
* Released under the MIT license
*/
(function(k){if("function"===typeof define&&define.amd)define(k);else if("object"===typeof exports)module.exports=k();else{var g=window.Cookies,b=window.Cookies=k();b.noConflict=function(){window.Cookies=g;return b}}})(function(){function k(){for(var b=0,c={};b<arguments.length;b++){var a=arguments[b],f;for(f in a)c[f]=a[f]}return c}function g(b){function c(a,f,e){var h;if(1<arguments.length){e=k({path:"/"},c.defaults,e);if("number"===typeof e.expires){var l=new Date;l.setMilliseconds(l.getMilliseconds()+
864E5*e.expires);e.expires=l}try{h=JSON.stringify(f),/^[\{\[]/.test(h)&&(f=h)}catch(g){}f=b.write?b.write(f,a):encodeURIComponent(String(f)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent);a=encodeURIComponent(String(a));a=a.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent);a=a.replace(/[\(\)]/g,escape);return document.cookie=[a,"=",f,e.expires&&"; expires="+e.expires.toUTCString(),e.path&&"; path="+e.path,e.domain&&"; domain="+e.domain,e.secure?"; secure":
""].join("")}a||(h={});for(var l=document.cookie?document.cookie.split("; "):[],p=/(%[0-9A-Z]{2})+/g,n=0;n<l.length;n++){var d=l[n].split("="),m=d[0].replace(p,decodeURIComponent),d=d.slice(1).join("=");'"'===d.charAt(0)&&(d=d.slice(1,-1));try{d=b.read?b.read(d,m):b(d,m)||d.replace(p,decodeURIComponent);if(this.json)try{d=JSON.parse(d)}catch(g){}if(a===m){h=d;break}a||(h[m]=d)}catch(g){}}return h}c.get=c.set=c;c.getJSON=function(){return c.apply({json:!0},[].slice.call(arguments))};c.defaults={};
c.remove=function(a,b){c(a,"",k(b,{expires:-1}))};c.withConverter=g;return c}return g(function(){})});

0
themes/tools/mock.js → themes/_vendor/js/mock.js vendored

0
themes/antergos/js/vendor/moment-with-locales.min.js → themes/_vendor/js/moment-with-locales.min.js vendored

3
themes/antergos/css/Makefile.am

@ -3,8 +3,5 @@ css_DATA = style.css
EXTRA_DIST = $(css_DATA)
SUBDIRS = vendor
DISTCLEANFILES = \
Makefile.in

4
themes/antergos/css/style.css

@ -30,11 +30,11 @@
@font-face {
font-family: 'Open Sans';
src: url('../fonts/TTF/OpenSans-Regular.ttf');
src: url('../../_vendor/fonts/TTF/OpenSans-Regular.ttf');
}
@font-face {
font-family: 'Open Sans Light';
src: url('../fonts/TTF/OpenSans-Light.ttf');
src: url('../../_vendor/fonts/TTF/OpenSans-Light.ttf');
}
*:focus {

7
themes/antergos/css/vendor/Makefile.am vendored

@ -1,7 +0,0 @@
vendordir = $(THEME_DIR)/antergos/css/vendor
vendor_DATA = bootstrap.min.css
EXTRA_DIST = $(vendor_DATA)
DISTCLEANFILES = \
Makefile.in

4
themes/antergos/fonts/font-awesome/font-awesome.min.css vendored

File diff suppressed because one or more lines are too long

14
themes/antergos/index.html

@ -37,19 +37,20 @@
<meta name="author" content="Dustin Falgout">
<!--For testing the theme in a web browser -->
<script type="text/javascript" src="../tools/mock.js"></script>
<script type="text/javascript" src="../_vendor/js/mock.js"></script>
<!-- Vendor CSS -->
<link rel="stylesheet" type="text/css" href="css/vendor/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="fonts/font-awesome/font-awesome.min.css"/>
<link rel="stylesheet" type="text/css" href="../_vendor/css/bootswatch-paper.bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="../_vendor/fonts/font-awesome/font-awesome.min.css"/>
<!-- Theme's CSS -->
<link rel="stylesheet" type="text/css" href="css/style.css">
<!-- Vendor JavaScript -->
<script src="js/vendor/jquery-2.1.4.min.js"></script>
<script src="js/vendor/bootstrap.min.js"></script>
<script src="js/vendor/moment-with-locales.min.js"></script>
<script src="../_vendor/js/jquery.min.js"></script>
<script src="../_vendor/js/bootstrap.min.js"></script>
<script src="../_vendor/js/moment-with-locales.min.js"></script>
<script src="../_vendor/js/js.cookie.min.js"></script>
<!-- Theme JavaScript -->
<script type="text/javascript" src="js/translations.js"></script>
@ -233,6 +234,7 @@
<!-- Custom JavaScript for the BG Switcher & Clock Toggle -->
<script>
// TODO: Move this stuff into greeter.js
$( "#bg-switch-close" ).click( function( e ) {
e.preventDefault();
$( "#bg-switch-wrapper" ).toggleClass( "active" );

2
themes/antergos/js/Makefile.am

@ -5,7 +5,5 @@ javascript_DATA = \
EXTRA_DIST = $(javascript_DATA)
SUBDIRS = vendor
DISTCLEANFILES = \
Makefile.in

34
themes/antergos/js/greeter.js

@ -65,17 +65,37 @@ class AntergosThemeUtils {
this.translations = window.ant_translations;
this.$log_container = $('#logArea');
this.recursion = 0;
this.cache_available = false;
if ( 'undefined' === typeof window.navigator.languages ) {
window.navigator.languages = [ window.navigator.language ];
}
this.check_cache_availability();
this.init_config_values();
return _util;
}
check_cache_availability() {
try {
localStorage.setItem('testing', 'test');
let test = localStorage.getItem('testing');
if ('test' === test) {
this.cache_available = true;
}
localStorage.removeItem('testing');
} catch(err) {
this.log(err);
this.log('ERROR: Cache is not available. Unable to access persistent data.');
}
}
/**
* Add text to the debug log element (accessible from the login screen).
*
@ -98,6 +118,10 @@ class AntergosThemeUtils {
cache_get() {
var key = `ant`;
if (false === this.cache_available) {
return null;
}
for (var _len = arguments.length, key_parts = new Array(_len), _key = 0; _key < _len; _key++) {
key_parts[_key] = arguments[_key];
}
@ -105,6 +129,7 @@ class AntergosThemeUtils {
for ( var part of key_parts ) {
key += `:${part}`;
}
console.log(`cache_get() called with key: ${key}`);
return localStorage.getItem( key );
}
@ -119,6 +144,10 @@ class AntergosThemeUtils {
cache_set( value ) {
var key = `ant`;
if (false === this.cache_available) {
return;
}
for (var _len2 = arguments.length, key_parts = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
key_parts[_key2 - 1] = arguments[_key2];
}
@ -126,6 +155,7 @@ class AntergosThemeUtils {
for ( var part of key_parts ) {
key += `:${part}`;
}
console.log(`cache_set() called with key: ${key} and value: ${value}`);
return localStorage.setItem( key, value );
}
@ -225,7 +255,7 @@ class AntergosBackgroundManager {
* Determine which background image should be displayed and apply it.
*/
initialize() {
if ( ! this.current_background ) {
if ( ! this.current_background && true === _util.cache_available ) {
// For backwards compatibility
if ( null !== localStorage.getItem( 'bgsaved' ) && '0' === localStorage.getItem( 'bgrandom' ) ) {
this.current_background = localStorage.getItem( 'bgsaved' );
@ -449,7 +479,9 @@ class AntergosTheme {
if ( null === last_session ) {
// For backwards compatibility
if (true === _util.cache_available) {
last_session = localStorage.getItem( user.name );
}
if ( null === last_session ) {
// This user has never logged in before let's enable the system's default
// session.

10
themes/antergos/js/vendor/Makefile.am vendored

@ -1,10 +0,0 @@
jsvendordir = $(THEME_DIR)/antergos/js/vendor
jsvendor_DATA = \
jquery-2.1.4.min.js \
bootstrap.min.js \
moment-with-locales.min.js
EXTRA_DIST = $(jsvendor_DATA)
DISTCLEANFILES = \
Makefile.in

8
themes/tools/Makefile.am

@ -1,8 +0,0 @@
toolsdir = $(THEME_DIR)/tools
tools_DATA = mock.js
EXTRA_DIST = $(tools_DATA)
DISTCLEANFILES = \
Makefile.in
Loading…
Cancel
Save