Commit 34368032 authored by mattwire's avatar mattwire
Browse files

Remove old css/js resources

parent 0321a2ef
......@@ -173,18 +173,6 @@ function civigiftaid_civicrm_searchTasks($objectType, &$tasks) {
*/
function civigiftaid_civicrm_buildForm($formName, &$form) {
switch ($formName) {
case 'CRM_Civigiftaid_Form_Settings':
CRM_Core_Resources::singleton()
->addScriptFile(E::LONG_NAME, 'resources/js/settings.js', 1, 'html-header');
break;
case 'CRM_Civigiftaid_Form_Task_AddToBatch':
case 'CRM_Civigiftaid_Form_Task_RemoveFromBatch':
CRM_Core_Resources::singleton()
->addScriptFile(E::LONG_NAME, 'resources/js/batch.js', 1, 'html-header')
->addStyleFile(E::LONG_NAME, 'resources/css/batch.css', 1, 'html-header');
break;
case 'CRM_Admin_Form_Generic':
if ($form->getSettingPageFilter() !== 'ukgiftaid') {
return;
......
#crm-container .gift-aid {
padding: 20px;
}
#crm-container .gift-aid h2 {
margin: 1rem 0;
padding: 0;
}
#crm-container .gift-aid h2:first-child,
#crm-container .gift-aid h3:first-child {
margin-top: 0;
}
#crm-container .gift-aid h3 {
margin: 1rem 0;
padding: 0;
}
#crm-container .gift-aid ol {
padding-left: 20px;
}
#crm-container .gift-aid ol li {
margin-top: 0.5rem;
margin-bottom: 0.5rem;
}
#crm-container .gift-aid .select2-container .select2-choices {
border-radius: 3px;
}
#crm-container .gift-aid .crm-section .label {
margin-right: 1.25rem;
}
#crm-container .gift-aid .crm-section .content .help-text {
color: #777;
margin-left: 0.5rem;
font-size: 0.95em;
}
#crm-container .gift-aid .crm-accordion-wrapper {
margin: 1rem 0;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}
#crm-container .gift-aid .crm-accordion-body {
background-color: #f6f6f6;
padding: 0;
border-color: #ddd;
}
#crm-container .gift-aid .crm-accordion-body p {
padding: 10px;
margin: 0;
}
#crm-container .gift-aid .crm-accordion-body > table {
margin: 0;
}
#crm-container .gift-aid .crm-accordion-body > table > thead th {
padding: 10px;
border-style: solid;
border-width: 0 0 1px 0;
border-color: #e3e3e3;
}
#crm-container .gift-aid .contribution {
border-color: #e3e3e3;
border-style: solid;
border-width: 0 0 3px 0;
cursor: pointer;
background-color: #fff;
}
#crm-container .gift-aid .contribution.collapsed {
background-color: #f1f1f1;
background-color: transparent;
border-width: 0 0 1px 0;
}
#crm-container .gift-aid .contribution:hover {
background-color: #f5f5f5;
background-color: white;
}
#crm-container .gift-aid .contribution > td {
border-color: #ddd;
border-style: solid;
border-width: 0 0 0 1px;
background-color: transparent;
padding: 10px;
}
#crm-container .gift-aid .contribution > td:first-child {
border-width: 0;
}
#crm-container .gift-aid .contribution a:hover {
text-decoration: underline;
}
#crm-container .gift-aid .line-items {
width: 98%;
padding: 0;
margin: 0 auto 1%;
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.15);
}
#crm-container .gift-aid .line-items tr {
background-color: #eee;
border-bottom: 1px dotted #d8d8d8;
}
#crm-container .gift-aid .line-items tr.odd {
background-color: white;
}
#crm-container .gift-aid .line-items th {
padding: 5px 10px;
font-size: 0.7rem;
}
#crm-container .gift-aid .line-items td {
padding: 5px 10px;
font-size: 0.75rem;
border: 1px solid #ddd;
border: none;
background: transparent;
color: #707070;
}
CRM.$(function($) {
var container = $(document.getElementsByClassName('gift-aid'));
/**
* Base class
*
* @type {Object}
*/
var Base = {
/**
* @param config
* @returns {Object}
*/
create: function (config) {
var instance = Object.create(this);
instance.config = config || {};
return instance;
},
/**
* Setup
*/
setup: function () {
this.configure();
this.init();
},
/**
* Set variables and other configurations to be used in the later stages
*/
configure: function () {
},
/**
* Initialise
*/
init: function () {
}
};
/**
* Batch operations class
*/
var BatchOperations = Base.create();
BatchOperations.configure = function (config) {
Base.configure(config);
this.contributions = container.find('.contribution');
this.lineItems = container.find('.line-items');
};
BatchOperations.init = function () {
this.contributions.addClass('collapsed');
this.lineItems.toggle();
};
BatchOperations.setup();
});
CRM.$(function ($) {
var container = $(document.getElementsByClassName('CRM_Civigiftaid_Form_Settings'));
/**
* Base class
*
* @type {Object}
*/
var Base = {
/**
* @param config
* @returns {Object}
*/
create: function (config) {
var instance = Object.create(this);
instance.config = config || {};
return instance;
},
/**
* Setup
*/
setup: function () {
this.configure();
this.init();
this.createBindings();
},
/**
* Set variables and other configurations to be used in the later stages
*/
configure: function () {
},
/**
* Initialise
*/
init: function () {
},
/**
* Create bindings
*/
createBindings: function () {
}
};
/**
* Settings class
*/
var Settings = Base.create();
Settings.configure = function () {
this.financialTypes = container.find('#s2id_financial_types_enabled').parent('td');
this.globallyEnabled = container.find('#globally_enabled');
};
Settings.init = function () {
if (this.globallyEnabled.prop('checked')) {
this.toggleFinancialTypesDisplay();
}
};
Settings.createBindings = function () {
var self = this;
this.globallyEnabled.on('click', function () {
self.toggleFinancialTypesDisplay();
});
};
Settings.toggleFinancialTypesDisplay = function () {
this.financialTypes.toggle();
};
Settings.setup();
});
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment