Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profilev2 #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion profile/profileReplaceFaxEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if (typeof (dojo) != "undefined") {
// Change fax number label
var faxNo = dojo.query("label[for='faxNumber']");
if (faxNo.length > 0) {
faxNo.innerHTML = "NMC / HCPC";
faxNo[0].innerHTML = "NMC / HCPC";
} else {
console.log('Query failed');
}
Expand Down
33 changes: 33 additions & 0 deletions profilev2/profileCustomisation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
////
// @author Tony McGuckin, IBM
// @name Profiles Customization
// @version 0.1
// @date February, 2017
//
// Copied from samples
//
if (typeof (dojo) != "undefined") {
var selects = dojo.query("select[id='phone1.label']");
if (selects.length > 0) {
var opts = selects[0].options;
opts.length = 0;
opts[0] = new Option("NMC / HCPC","NMC / HCPC",true, false);
} else {
console.log('Query failed');
}

var input = dojo.query("input[id='phone1']");
if (input.length > 0) {
var currValue = input[0].value;
var newSelect = '<select id="phone1" onchange="dataChange(this);" onkeypress="dataChange(this);" name="attribute(phone1)"><option value="NMC / HCPC" selected="">NMC / HCPC</option>'
input[0].parentNode.innerHTML = newSelect;
var select = dojo.query("select[id='phone1']");
var opts = select[0].options;
var selected = (currValue === "NMC") ? true : false;
opts[0] = new Option("NMC", "NMC", true, selected);
selected = (currValue === "HCPC") ? true : false;
opts[1] = new Option("HCPC", "HCPC", false, selected);
} else {
console.log('Query failed');
}
}
30 changes: 30 additions & 0 deletions profilev2/profiles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"extensions": [
{
"application": "Profiles Customization Sample",
"payload": {
"include-files": [
"profiles/profilesCustomization.js"
],
"include-repo": {
"name": "intec-cnx"
},
"cache-headers": {
"cache-control": "max-age=0"
},
"match": {
"url": "profileView.do"
}
},
"name": "Profiles Customization Extension",
"type": "com.ibm.customizer.ui",
"path": "profiles"
}
],
"name": "Profiles Customization Sample",
"description": "Alternative Profiles Page Design & Layout",
"title": "Profiles Customization Sample",
"services": [
"Customizer"
]
}