Skip to content

Commit

Permalink
Fix css minification (opensourcepos#329)
Browse files Browse the repository at this point in the history
Fix suspended sales dialog (set class to modal-dlg)
  • Loading branch information
jekkos committed Feb 19, 2016
1 parent 967ba99 commit 30223c3
Show file tree
Hide file tree
Showing 12 changed files with 7,910 additions and 182 deletions.
229 changes: 131 additions & 98 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,119 +1,152 @@
module.exports = function(grunt) {

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
wiredep: {
task: {
ignorePath: '../../../',
src: ['**/header.php']
}
},
bower_concat: {
all: {
dest: {
'js': 'dist/opensourcepos_bower.js'
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
wiredep: {
task: {
ignorePath: '../../../',
src: ['**/header.php']
}
}
},
concat: {
js: {
options: {
separator: ';'
},
bower_concat: {
all: {
mainFiles: {
'bootswatch-dist': ['css/bootstrap.css', 'js/bootstrap.js']
},
dest: {
'js': 'dist/opensourcepos_bower.js',
'css': 'dist/opensourcepos_bower.css'
}
}
},
cssmin: {
target: {
files: {
'dist/<%= pkg.name %>.min.css': ['dist/opensourcepos_bower.css', 'css/*.css']
}
}
},
concat: {
js: {
options: {
separator: ';'
},
files: {
'dist/<%= pkg.name %>.js': ['dist/opensourcepos_bower.js', 'js/jquery*', 'js/*.js']
}
},
files: {
'dist/<%= pkg.name %>.js': ['dist/opensourcepos_bower.js', 'js/jquery*', 'js/*.js']
sql: {
options: {
banner: '-- >> This file is autogenerated from tables.sql and constraints.sql. Do not modify directly << --'
},
files: {
'database/database.sql': ['database/tables.sql', 'database/constraints.sql'],
'database/migrate_phppos_dist.sql': ['database/tables.sql', 'database/phppos_migrate.sql', 'database/constraints.sql']
}
}
},
sql: {
uglify: {
options: {
banner: '-- >> This file is autogenerated from tables.sql and constraints.sql. Do not modify directly << --'
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
files: {
'database/database.sql': ['database/tables.sql', 'database/constraints.sql'],
'database/migrate_phppos_dist.sql': ['database/tables.sql', 'database/phppos_migrate.sql', 'database/constraints.sql']
dist: {
files: {
'dist/<%= pkg.name %>.min.js': ['dist/<%= pkg.name %>.js']
}
}
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'dist/<%= pkg.name %>.min.js': ['dist/<%= pkg.name %>.js']
}
}
},
jshint: {
files: ['Gruntfile.js', 'js/*.js'],
options: {
// options here to override JSHint defaults
globals: {
jQuery: true,
console: true,
module: true,
document: true
}
}
},
tags: {
js : {
jshint: {
files: ['Gruntfile.js', 'js/*.js'],
options: {
scriptTemplate: '<script type="text/javascript" src="{{ path }}" language="javascript"></script>',
openTag: '<!-- start js template tags -->',
closeTag: '<!-- end js template tags -->',
absolutePath: true
// options here to override JSHint defaults
globals: {
jQuery: true,
console: true,
module: true,
document: true
}
}
},
tags: {
css : {
options: {
scriptTemplate: '<rel type="text/css" src="{{ path }}"></rel>',
openTag: '<!-- start css template tags -->',
closeTag: '<!-- end css template tags -->',
absolutePath: true
},
src: [ 'css/*.css' ],
dest: 'application/views/partial/header.php'
},
mincss: {
options: {
scriptTemplate: '<rel type="text/css" src="{{ path }}"></rel>',
openTag: '<!-- start mincss template tags -->',
closeTag: '<!-- end mincss template tags -->',
absolutePath: true
},
src: [ 'dist/*min.css' ],
dest: 'application/views/partial/header.php'
},
js : {
options: {
scriptTemplate: '<script type="text/javascript" src="{{ path }}" language="javascript"></script>',
openTag: '<!-- start js template tags -->',
closeTag: '<!-- end js template tags -->',
absolutePath: true
},
src: [ 'js/jquery*', 'js/*.js' ],
dest: 'application/views/partial/header.php'
},
src: [ 'js/jquery*', 'js/*.js' ],
dest: 'application/views/partial/header.php'
},
minjs : {
options: {
scriptTemplate: '<script type="text/javascript" src="{{ path }}" language="javascript"></script>',
openTag: '<!-- start minjs template tags -->',
closeTag: '<!-- end minjs template tags -->',
absolutePath: true
},
src: [
'dist/*min.js'
],
dest: 'application/views/partial/header.php'
}
},
mochaWebdriver: {
options: {
timeout: 1000 * 60 * 3
minjs : {
options: {
scriptTemplate: '<script type="text/javascript" src="{{ path }}" language="javascript"></script>',
openTag: '<!-- start minjs template tags -->',
closeTag: '<!-- end minjs template tags -->',
absolutePath: true
},
src: [
'dist/*min.js'
],
dest: 'application/views/partial/header.php'
}
},
test : {
options: {
usePhantom: true,
usePromises: true
},
src: ['test/**/*.js']
}
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint']
},
cachebreaker: {
dev: {
mochaWebdriver: {
options: {
match: ['opensourcepos.min.js'],
src: {
path: 'dist/opensourcepos.min.js'
},
replacement: 'md5'
timeout: 1000 * 60 * 3
},
files: {
src: ['**/header.php']
test : {
options: {
usePhantom: true,
usePromises: true
},
src: ['test/**/*.js']
}
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint']
},
cachebreaker: {
dev: {
options: {
match: [
{
'opensourcepos.min.js': 'dist/opensourcepos.min.js',
'opensourcepos.min.css': 'dist/opensourcepos.min.css'
}
],
replacement: 'md5'
},
files: {
src: ['**/header.php']
}
}
}
}
});
});

require('load-grunt-tasks')(grunt);
require('load-grunt-tasks')(grunt);

grunt.registerTask('default', ['wiredep', 'tags:js', 'bower_concat', 'concat', 'uglify', 'tags:minjs', 'cachebreaker']);
grunt.registerTask('default', ['wiredep', 'bower_concat', 'concat', 'uglify', 'cssmin', 'tags', 'cachebreaker']);

};
39 changes: 29 additions & 10 deletions application/views/partial/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,29 @@
<base href="<?php echo base_url();?>" />
<title><?php echo $this->config->item('company').' -- '.$this->lang->line('common_powered_by').' OS Point Of Sale' ?></title>
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico">
<!-- bower:css -->
<link rel="stylesheet" href="bower_components/tablesorter/dist/css/theme.blue.min.css" />
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="bower_components/bootstrap3-dialog/dist/css/bootstrap-dialog.min.css" />
<link rel="stylesheet" href="bower_components/jasny-bootstrap/dist/css/jasny-bootstrap.css" />
<link rel="stylesheet" href="bower_components/smalot-bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />
<!-- endbower -->
<link rel="stylesheet" type="text/css" href="css/ospos.css" />
<link rel="stylesheet" type="text/css" href="css/ospos_print.css" media="print" />
<?php if ($this->input->cookie('debug') == "true" || $this->input->get("debug") == "true") : ?>
<!-- bower:css -->
<link rel="stylesheet" href="bower_components/tablesorter/dist/css/theme.blue.min.css" />
<link rel="stylesheet" href="bower_components/bootstrap3-dialog/dist/css/bootstrap-dialog.min.css" />
<link rel="stylesheet" href="bower_components/jasny-bootstrap/dist/css/jasny-bootstrap.css" />
<link rel="stylesheet" href="bower_components/bootswatch-dist/css/bootstrap.css" />
<link rel="stylesheet" href="bower_components/smalot-bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />
<!-- endbower -->
<!-- start css template tags -->
<link rel="stylesheet" type="text/css" href="css/autocomplete.css"/>
<link rel="stylesheet" type="text/css" href="css/barcode_font.css"/>
<link rel="stylesheet" type="text/css" href="css/general.css"/>
<link rel="stylesheet" type="text/css" href="css/invoice.css"/>
<link rel="stylesheet" type="text/css" href="css/invoice_email.css"/>
<link rel="stylesheet" type="text/css" href="css/login.css"/>
<link rel="stylesheet" type="text/css" href="css/ospos.css"/>
<link rel="stylesheet" type="text/css" href="css/ospos_print.css"/>
<link rel="stylesheet" type="text/css" href="css/popupbox.css"/>
<link rel="stylesheet" type="text/css" href="css/receipt.css"/>
<link rel="stylesheet" type="text/css" href="css/register.css"/>
<link rel="stylesheet" type="text/css" href="css/reports.css"/>
<link rel="stylesheet" type="text/css" href="css/tables.css"/>
<!-- end css template tags -->
<!-- bower:js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/jquery-bgiframe/jquery.bgiframe.js"></script>
Expand Down Expand Up @@ -42,8 +55,14 @@
<script type="text/javascript" src="js/phpjsdate.js" language="javascript"></script>
<!-- end js template tags -->
<?php else : ?>
<!--[if lte IE 8]>
<link rel="stylesheet" media="print" href="css/print.css" type="text/css" />
<![endif]-->
<!-- start mincss template tags -->
<link rel="stylesheet" type="text/css" href="dist/opensourcepos.min.css?rel=7c0e8d652d"/>
<!-- end mincss template tags -->
<!-- start minjs template tags -->
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=d794e57f0c" language="javascript"></script>
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=f57ef65f75" language="javascript"></script>
<!-- end minjs template tags -->
<?php endif; ?>

Expand Down
2 changes: 1 addition & 1 deletion application/views/sales/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}

echo anchor("sales/suspended/width:425", $this->lang->line('sales_suspended_sales'),
array('class'=>'btn btn-default btn-sm pull-right thickbox none', 'id'=>'show_suspended_sales_button', 'title'=>$this->lang->line('sales_suspended_sales')));
array('class'=>'btn btn-default btn-sm pull-right modal-dlg none', 'id'=>'show_suspended_sales_button', 'title'=>$this->lang->line('sales_suspended_sales')));

if ($this->Employee->has_grant('reports_sales', $this->session->userdata('person_id')))
{
Expand Down
6 changes: 3 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
"smalot-bootstrap-datetimepicker": "^2.3.8"
},
"overrides": {
"bootstrap": {
"bootswatch-dist": {
"main": [
"dist/js/bootstrap.js",
"dist/css/bootstrap.css"
"js/bootstrap.js",
"css/bootstrap.css"
]
}
}
Expand Down
2 changes: 0 additions & 2 deletions css/login.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Login page styling tuned for bootstrap

*
{
margin:0;
Expand Down
9 changes: 0 additions & 9 deletions css/ospos.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
@import url(autocomplete.css);
@import url(general.css);
@import url(popupbox.css);
@import url(register.css);
@import url(receipt.css);
@import url(reports.css);
@import url(tables.css);
@import url(invoice.css);

html, body
{
height: 100%;
Expand Down
Loading

0 comments on commit 30223c3

Please sign in to comment.