Skip to content

Instantly share code, notes, and snippets.

View EliJDonahue's full-sized avatar
😃
Working on exciting new projects for the Aras Community!

Eli J. Donahue EliJDonahue

😃
Working on exciting new projects for the Aras Community!
View GitHub Profile
@EliJDonahue
EliJDonahue / aras_labs_custom_doc_style.css
Last active November 28, 2016 21:14
CSS for custom Aras Tech Doc style
/**** Define Font Families ***************/
@import url('https://fonts.googleapis.com/css?family=Raleway:900,600,400,400i');
@import url('https://fonts.googleapis.com/css?family=Lato:400,700,400i,700i');
/**** Assign Font Styles ***************/
@page {
@bottom-right {
font-family: 'Lato', sans-serif;
@EliJDonahue
EliJDonahue / aras_labs_page_numbering.css
Created November 28, 2016 21:13
Use CSS counters to auto-number Aras Tech Doc pages
/* Display page counter value in bottom right corner of the page */
@page {
@bottom-right {
content: counter(page);
}
}
@EliJDonahue
EliJDonahue / aras_labs_custom_label.css
Created December 1, 2016 20:11
Custom CSS for styling field labels
.my_label {
margin-bottom: 8px;
font-weight: bold;
}
@EliJDonahue
EliJDonahue / aras_labs_clear_field_style.js
Created December 1, 2016 20:15
Clear the style attribute on a given Aras form field
////////////////////// Helpful functions ///////////////////////////////////
// sets a specific attribute for all elements in a collection
setAttributeOnAll = function(els, attrName, attrVal)
{
for (var i=0; i < els.length; i++)
els[i].setAttribute(attrName,attrVal);
};
////////////////////// Override default styles /////////////////////////////
@EliJDonahue
EliJDonahue / aras_labs_add_class_to_fields.js
Created December 1, 2016 20:23
Add a custom CSS class to a collection of elements
////////////////////// Helpful functions ///////////////////////////////////
// appends a value to an attribute for all elements in a collection
// can be used to append class name
appendAttributeOnAll = function(els, attrName, attrVal)
{
for (var i=0; i < els.length; i++)
{
var curr = els[i].getAttribute(attrName);
els[i].setAttribute(attrName, curr + ' ' + attrVal);
@EliJDonahue
EliJDonahue / aras_labs_helper_functions_for_custom_field_styles.js
Created December 1, 2016 21:25
Javascript helper functions for overriding default field styles
////////////////////// Configurable variables /////////////////////////////
var imgRoot = '../customer/svg/';
var searchBtn = imgRoot + 'search.svg';
var dateBtn = imgRoot + 'calendar.svg';
////////////////////// Helpful functions //////////////////////////////////
// function to replace a class name for specified elements
replaceClass = function(els, oldClass, newClass)
@EliJDonahue
EliJDonahue / aras_labs_override_select_styles.js
Created December 1, 2016 21:27
Override default styles for text fields and textarea fields
////////////////////// Override default styles /////////////////////////////
// default select style
var selects = document.getElementsByClassName('sys_f_select');
replaceClass(selects,'sys_f_select','my_select');
selects = document.getElementsByClassName('sys_f_div_select');
replaceClass(selects,'sys_f_div_select','my_select_div');
@EliJDonahue
EliJDonahue / aras_labs_override_date_style.js
Last active December 1, 2016 21:41
Override default date field style
////////////////////// Override default styles /////////////////////////////
// default date select style with custom button icon and class
var cals = document.getElementsByClassName("sys_f_input_image_calendar_ff");
setAttributeOnAll(cals,'src',dateBtn);
replaceClass(cals,'sys_f_input_image_calendar_ff',' my_cal_btn_ff');
@EliJDonahue
EliJDonahue / aras_labs_override_item_field_style.js
Created December 1, 2016 21:45
Override default Item field style and button icons
////////////////////// Override default styles /////////////////////////////
// default item field styles (managed_by_id)
var btn = updateItemFieldIcon('managed_by_id',searchBtn);
appendAttributeOnAll(btn,'class','my_search_btn');
// default item field styles (owned_by_id)
btn = updateItemFieldIcon('owned_by_id',searchBtn);
appendAttributeOnAll(btn,'class','my_search_btn');
@EliJDonahue
EliJDonahue / aras_labs_aml_response.xml
Created December 28, 2016 17:27
Generic example of an AML response
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<Result>
<Item type="{ITEMTYPE NAME}" typeId="{ITEMTYPE ID}" id="{ITEM ID}">
<property_1></property_1>
<property_2></property_2>
...
<property_n></property_n>
<!-- Item property example -->