Skip to content

Commit

Permalink
Merge pull request #47 from pimcore/css-js-update
Browse files Browse the repository at this point in the history
Updated javascripts and css for gulp processing
  • Loading branch information
deltatag authored Dec 19, 2017
2 parents c88fe9d + 40d7fd2 commit 0f29c31
Show file tree
Hide file tree
Showing 11 changed files with 10,074 additions and 8,280 deletions.
89 changes: 89 additions & 0 deletions frontend/js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,95 @@
}
});
});
},
registerSaveFilterDefinition: function () {
$('#save-filter-definition').on('click', function (e) {
e.preventDefault();
var $input = $('input[name="filterDefinition[name]"]');
var $requiredMessage = $('#name-required-message');
if ($($input).val().length < 1) {
$input.focus();
$requiredMessage.slideDown();
setTimeout(function () {
$requiredMessage.slideUp();
}, 3000);
return;
} else $requiredMessage.hide();
var $form = $(this).closest("form");
var originalAction = $form.attr('action');
var $disabledSelects = $form.find('select:disabled');
$disabledSelects.each(function(){
$(this).prop('disabled', false);
});
$form.attr('action', '/admin/customermanagementframework/customers/filter-definition/save').submit();
$form.attr('action', originalAction);
$disabledSelects.each(function(){
$(this).prop('disabled', true);
});
});
},
registerUpdateFilterDefinition: function () {
$('#update-filter-definition').on('click', function (e) {
e.preventDefault();
var $input = $('input[name="filterDefinition[name]"]');
var $requiredMessage = $('#name-required-message');
if ($($input).val().length < 1) {
$input.focus();
$requiredMessage.slideDown();
setTimeout(function () {
$requiredMessage.slideUp();
}, 3000);
return;
} else $requiredMessage.hide();
var $form = $(this).closest("form");
var originalAction = $form.attr('action');
var $disabledSelects = $form.find('select:disabled');
$disabledSelects.each(function(){
$(this).prop('disabled', false);
});
$form.attr('action', '/admin/customermanagementframework/customers/filter-definition/update').submit();
$form.attr('action', originalAction);
$disabledSelects.each(function(){
$(this).prop('disabled', true);
});
});
},
registerShareFilterDefinition: function () {
$('#share-filter-definition').on('click', function (e) {
e.preventDefault();
var $form = $(this).closest("form");
var originalAction = $form.attr('action');
$form.attr('action', '/admin/customermanagementframework/customers/filter-definition/share').submit();
$form.attr('action', originalAction);
});
},
registerNewCustomerAction: function () {
var $newCustomerButton = $('#add-new-customer');
var isPimcoreAvailable = ('undefined' !== typeof window.top.pimcore);
if(!isPimcoreAvailable) $newCustomerButton.hide();
$newCustomerButton.on('click', function (e) {
if (!isPimcoreAvailable) {
app.Logger.error(
'Pimcore is not available (e.g. backend opened outside iframe) - can\'t load object with ID',
objectId
);
return false;
}
$.ajax({
url: '/admin/customermanagementframework/customers/new',
success: function (data) {
var objectId = data.id;
if ('undefined' !== typeof window.top.pimcore) {
window.top.pimcore.helpers.openObject(objectId, 'object');
} else {
app.Logger.error(
'Pimcore is not available (e.g. backend opened outside iframe) - can\'t load object with ID',
objectId
);
}
}
});
});
}
});
})(jQuery);
7 changes: 7 additions & 0 deletions frontend/scss/cmf.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,10 @@
border-bottom: 20px solid #ecf0f5;
background-color: #fff;
}

.select2-selection__clear {
display: none;
}
.select2-selection__rendered {
text-align: left;
}
22 changes: 11 additions & 11 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ gulpTasks(gulp, require('gulp-load-plugins')(), {
scripts: {
'lib.js': [
'node_modules/jquery/dist/jquery.js',
'node_modules/admin-lte/plugins/fastclick/fastclick.js',
'node_modules/admin-lte/plugins/slimScroll/jquery.slimscroll.js',
'node_modules/admin-lte/node_modules/fastclick/lib/fastclick.js',
'node_modules/admin-lte/node_modules/slimScroll/slimscroll.js',
'node_modules/admin-lte/plugins/pace/pace.js',
'node_modules/admin-lte/plugins/select2/select2.full.js',
'node_modules/admin-lte/node_modules/select2/dist/js/select2.full.js',
'node_modules/admin-lte/plugins/iCheck/icheck.js',
'node_modules/admin-lte/plugins/daterangepicker/moment.js',
'node_modules/admin-lte/plugins/daterangepicker/daterangepicker.js',
'node_modules/admin-lte/bootstrap/js/bootstrap.js',
'node_modules/admin-lte/dist/js/app.js'
'node_modules/admin-lte/node_modules/bootstrap-daterangepicker/moment.js',
'node_modules/admin-lte/node_modules/bootstrap-daterangepicker/daterangepicker.js',
'node_modules/admin-lte/node_modules/bootstrap/dist/js/bootstrap.js',
'node_modules/admin-lte/dist/js/adminlte.js'
],
'cmf.js': [
'frontend/js/init.js',
Expand All @@ -33,13 +33,13 @@ gulpTasks(gulp, require('gulp-load-plugins')(), {

styles: {
'lib.css': [
'node_modules/admin-lte/bootstrap/css/bootstrap.css',
'node_modules/admin-lte/node_modules/bootstrap/dist/css/bootstrap.css',
'node_modules/font-awesome/css/font-awesome.css',
'node_modules/ionicons/css/ionicons.css',
'node_modules/admin-lte/plugins/pace/pace.css',
'node_modules/admin-lte/plugins/select2/select2.css',
'node_modules/admin-lte/node_modules/select2/dist/css/select2.css',
'node_modules/admin-lte/plugins/iCheck/all.css',
'node_modules/admin-lte/plugins/daterangepicker/daterangepicker.css',
'node_modules/admin-lte/node_modules/bootstrap-daterangepicker/daterangepicker.css',
'node_modules/admin-lte/dist/css/AdminLTE.css',
'node_modules/admin-lte/dist/css/skins/skin-blue.css'
],
Expand All @@ -63,7 +63,7 @@ gulpTasks(gulp, require('gulp-load-plugins')(), {
'files': [
'node_modules/font-awesome/fonts/*',
'node_modules/ionicons/fonts/*',
'node_modules/admin-lte/bootstrap/fonts/*'
'node_modules/admin-lte/node_modules/bootstrap/fonts/*'
]
},
'iCheck': {
Expand Down
7 changes: 3 additions & 4 deletions src/Resources/public/admin/css/cmf.css
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ table .label-column label {
background-color: #fff; }

.select2-selection__clear {
display: none;
}
display: none; }

.select2-selection__rendered {
text-align: left;
}
text-align: left; }
2 changes: 1 addition & 1 deletion src/Resources/public/admin/css/cmf.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0f29c31

Please sign in to comment.