Free javascript Hosting


internalts.js

Uploaded on Apr 06 2022 20:05 by edward.email0

/*
* You can replace the following code with whatever you would like
* to inject into other web pages.
*/
/* An example script
*
* @param {els} count dom elements
*/

let searchToolString = '<button onclick="ticketSearch(\'assignedTsr\',\'Edward Yarian\')">Edward</button><button onclick="ticketSearch(\'assignedTsr\',\'Logan Wilcox\')">Logan</button><button onclick="ticketSearch(\'assignedTsr\',\'Christian Moreland\')">Christian</button><button onclick="ticketSearch(\'assignedTsr\',\'Roy Kinsey\')">Roy</button><button onclick="ticketSearch(\'assignedTsr\',\'Chaundra Trotter\')">Chaundra</button><button onclick="ticketSearch(\'assignedTsr\', \'Michael Hughes\')">Michael</button> <button onclick="ticketSearch(\'assignedTsr\', \'Katherine Norman\')">Katie</button> <button onclick="ticketSearch(\'assignedTsr\', \'Devin Brough\')">Devin</button> <button onclick="ticketSearch(\'subject\',\'Shared Voicemail (Technical Support 3)\')">Voicemails</button><button onclick="ticketSearch(\'subject\',\'LiveChat Transcript*\')">LiveChats</button><button onclick="incomingUnassigned()">Incoming Unassigned</button><button onclick="tickNMI()">NMIs</button><input id="searchToolOpened" type="checkbox">Opened</input><input id="searchToolIncoming" type="checkbox">Incoming</input><input id="searchToolCompleted" type="checkbox">Completed</input><input id="searchToolClosed" type="checkbox">Closed</input><input id="searchToolWeek" type="checkbox">This Week</input>';

let activitySearchString = '<button onclick="activitySearch(1216)">Edward</button><button onclick="activitySearch(1215)">Logan</button><button onclick="activitySearch(1219)">Christian</button><button onclick="activitySearch(1222)">Roy</button><button onclick="activitySearch(1225)">Chaundra</button><button onclick="activitySearch(1228)">Michael</button><button onclick="activitySearch(1230)">Katie</button><button onclick="activitySearch(1231)">Devin</button>'
let ticketType = 'Incoming';
let numGuides = 0;
let numReassign = 0;

let stateCheck = setInterval(() => {
if (document.readyState === 'complete') {
clearInterval(stateCheck);
// document ready


//
setTimeout(function() {


/* cerb tools */
if(window.location.href.substring(7, 15) == "cerberus") {
/* watermarks */
if(document.getElementById('frmWorkspacePage220')) {
const upgradedMsg = document.createElement('span');
upgradedMsg.innerHTML = "<br>Upgraded by Edward &#129312;";
document.getElementById('frmWorkspacePage220').children[4].appendChild(upgradedMsg);
}


// cerb 2.0
if(getCookie('theme') == '2') {
switch(location.pathname) {
case "/index.php/": console.log(location.pathname);
setTimeout(function() {
refreshTickets();
}, 300);
cerbUpgrade('dash')
break;
case "/index.php/pages/220-TS1/cs-incoming-open": console.log(location.pathname);
setTimeout(function() {
numGuides = document.getElementsByClassName('worklistBody')[2].childElementCount -1;
numReassign = document.getElementsByClassName('worklistBody')[3].childElementCount - 1;
refreshTickets();
}, 300);
cerbUpgrade('dash')
break;
case "/index.php/pages/220-TS1/cs-incoming-waiting": console.log(location.pathname);
ticketType = 'Waiting';
cerbUpgrade('dash')
break;
case "/index.php/pages/220-TS1/cs-completed": console.log(location.pathname);
ticketType = 'Completed';
cerbUpgrade('dash')
break;
case "/index.php/pages/208-Knowledgebase/ts-documentation":
ticketType = 'Knowledgebase';
cerbUpgrade('dash');
break;
default: console.log(location.pathname);
document.getElementById('cerb-logo').parentElement.href = '/index.php/pages/220-TS1/cs-incoming-open';
break;
}
}


// theme toggle
if(document.getElementsByClassName('navmenu').length > 0) {
const themeToggleBtn = document.createElement('button');
themeToggleBtn.innerHTML = "Toggle Cerb 2.0";
themeToggleBtn.style = "border-radius:0px;"
themeToggleBtn.onclick = function() { toggleCSS(); };
document.getElementsByClassName('navmenu')[0].appendChild(themeToggleBtn);
}

/* CHRISTMAS 2021 */

/* if(document.getElementsByClassName('cerb-no-print').length > 0) {
createElm('span', '', document.body, "width: 100%; position: absolute; left:-5px; background-image: url(\"https://edward.coolpage.biz/TS/srcs/xmas21/xmaslights.png\");height: 65px;z-index: 99;background-size: contain;", false, 'xmaslights', false, 'pre');
document.getElementById('cerb-logo').style = 'position: relative; z-index: 100 !important; background: url("https://edward.coolpage.biz/TS/srcs/logo.png") no-repeat !important';
}

const xmasStyle = document.createElement('link'); xmasStyle.rel = "stylesheet"; xmasStyle.type = "text/css";
xmasStyle.href = 'https://edward.coolpage.biz/TS/srcs/xmas21/xmas.css?v=4';
document.head.appendChild(xmasStyle);

setTimeout(function() {
console.log('santa goes');
randomSanta();
}, Math.floor(Math.random() * (70000 - 45000) + 45000)) */

//end

if(getCookie('theme') == '2') {
var redesign = document.createElement('link')
redesign.setAttribute('rel', 'stylesheet');
redesign.setAttribute('type', 'text/css');
redesign.setAttribute('href', 'https://edward.coolpage.biz/TS/cerb-public.css?v=1');
document.head.appendChild(redesign);
console.log('redesign is live');
} // end

if(document.querySelector('[data-context="cerberusweb.contexts.ticket"]')) {
document.querySelector('[data-context="cerberusweb.contexts.ticket"]').parentNode.onclick = function() {
setTimeout(function() {
setTimeout(function() { document.getElementsByClassName('ui-dialog-title')[0].innerHTML += "<button onclick='refreshTickOptions()'>Refresh Options</button>"; }, 1500);
let searchTools = document.getElementById('search_cerberusweb_contexts_ticket_output_container').parentElement.children[1]
searchTools.innerHTML += searchToolString;
}, 800)
}
}

if(document.querySelector('[data-context="cerberusweb.contexts.activity_log"]')) {
document.querySelectorAll('[data-context="cerberusweb.contexts.activity_log"]')[1].onclick = function() {
setTimeout(function() {
let activityTools = document.querySelectorAll('td[data-column="c_created"]')[0].parentNode.parentNode.parentNode.parentNode.parentNode.firstElementChild.firstElementChild;
activityTools.innerHTML += activitySearchString;
}, 800)
/* setTimeout(function() {
let activityTools = document.getElementsByClassName('worklist')[0];
activityTools.innerHTML += activitySearchString
}, 800) */
}
}
//end


if(document.getElementsByClassName('cerb-fields-container').length > 0) {
const cerbfieldcontainer = document.getElementsByClassName('cerb-fields-container')[0];
createElm('div', '<div class="cerb-fields-container-item"><div style="margin-bottom:5px;"><abbr title="">Edward waz here</abbr></div></div>', cerbfieldcontainer);
}
//end

/* Guide and Reassigned Ticket Location Correct */
if(document.getElementById('viewcust_2663')) {
reassignTicks = document.getElementById('viewcust_2663').parentNode;
guidesSection = document.getElementById('viewcust_2598').parentNode;
ticketDash = document.getElementById('divWorklistsTab1004');

ticketDash.appendChild(guidesSection);
ticketDash.appendChild(reassignTicks);
setTimeout(function() { updateUnclaimedTicketCount(); }, 800);
}

if(document.getElementById('ui-id-24').textContent !== "Overview") {
document.getElementById('ui-id-24').onclick = function() { console.log('click');
setTimeout(function() {
reassignTicks = document.getElementById('viewcust_2663').parentNode;
guidesSection = document.getElementById('viewcust_2598').parentNode;
ticketDash = document.getElementById('divWorklistsTab1004');

ticketDash.appendChild(guidesSection);
ticketDash.appendChild(reassignTicks);
setTimeout(function() { updateUnclaimedTicketCount(); }, 800);
}, 500)
}
}
//end

/* Comment Button Auto Fill */
//
const cmtBtn = document.getElementById("btnProfileComment");
if(cmtBtn) {
cmtBtn.onclick = function() {
cmtAutoFill();
};
}

waitForElementToDisplay('.cerb-form', function() {
createElm('button', '<span class="glyphicons glyphicons-refresh"></span>', document.getElementsByClassName('cerb-form')[0].childNodes[3].childNodes[3], false, function() { cmtAutoFill() });
}, 800, 999999999999999)

// End
/* Button Insert Vars */
const toolBarDiv = document.getElementsByClassName('cerb-profile-widget--header')[1];
/* Website Link Button Insert */
//
if(toolBarDiv) {
toolBarDiv.style += "margin-bottom:5px";
let orgSite2 = document.querySelectorAll('[rel="noopener"]')[0].textContent;
let publicSite = getSite(orgSite2, 0);
let deltaNet = getSite(orgSite2, 1);
//


console.log(orgSite2);
if (orgSite2) {
createElm('button', `<a style="color:black; font-weight: bold" href="` + deltaNet + `" target="_blank"><span class="glyphicons glyphicons-globe" style="margin-right:5px"></span>DeltaNet</a>`, toolBarDiv);
createElm('button', `<a style="color:black; font-weight: bold" href="` + publicSite + `" target="_blank"><span class="glyphicons glyphicons-globe" style="margin-right:5px"></span>Public Website</a>`, toolBarDiv);
}

// End
/* Reply Focus Button Insert */
//
const replyBtn = document.getElementsByClassName('cerb-button-reply')[0];
if (replyBtn) {
createElm('button', '<a style="color:black; font-weight: bold; text-decoration: none;"><span class="glyphicons glyphicons-share" style="color:rgb(0,180,0); margin-right:5px"></span>Reply</a>', toolBarDiv, false, function() { document.getElementsByClassName('cerb-button-reply')[0].click(); });
}

/* Bottom Page */
//
const bottomPage = document.getElementById('footer');
if (bottomPage) {
createElm('button', '<a style="color:black; font-weight: bold; text-decoration: none;"><span class="glyphicons glyphicons-down-arrow" style="margin-right:5px"></span>Down</a>', toolBarDiv, false, function(){ document.getElementById('footer').scrollIntoView({behavior: 'smooth'}); });
}
//End

//assign to self
if(document.getElementsByClassName('cerb-fields-container')[0].children.length < 7 || document.getElementsByClassName('cerb-fields-container')[0].children[3].textContent.search('Organization')) {
createElm('button', '<a style="color:black; font-weight: bold; text-decoration: none;"><span class="glyphicons glyphicons-user" style="margin-right:5px"></span>Assign To Self</a>', toolBarDiv, false, function() { selfAssign(); });

}
//end

/* attachments button */
if(document.getElementsByClassName('properties')[0].attributes.style.nodeValue == 'padding:5px 0;border:0;') {
if(document.getElementsByClassName('properties')[0].children[1].childElementCount > 1) {
createElm('button', '<a style="color:black; font-weight: bold; text-decoration: none;"><span class="glyphicons glyphicons-paperclip" style="margin-right:5px"></span>Attachments</a>', toolBarDiv, false, function() { document.getElementsByClassName('properties')[0].scrollIntoView({behavior: 'smooth'}); });
}
} else if(document.getElementsByClassName('properties')[1].attributes.style.nodeValue == 'padding:5px 0;border:0;') {
if(document.getElementsByClassName('properties')[1].children[1].childElementCount > 1) {
createElm('button', '<a style="color:black; font-weight: bold; text-decoration: none;"><span class="glyphicons glyphicons-paperclip" style="margin-right:5px"></span>Attachments</a>', toolBarDiv, false, function() { document.getElementsByClassName('properties')[1].scrollIntoView({behavior: 'smooth'}); });
}
}
//end

/* scroll to top */
createElm('button', "<span class='glyphicons glyphicons-up-arrow'></span>", toolBarDiv, "position:fixed; left:97.5%; top:90%;", function() { document.getElementById('cerb-logo').scrollIntoView({behavior: 'smooth'}); });
//end


/* draft button resume */
if(document.getElementsByClassName('cerb-button-resume')[0]) {
createElm('button', '<span class="glyphicons glyphicons-restart"></span> Resume', toolBarDiv, false, function() { document.getElementsByClassName('cerb-button-resume')[0].click(); })
}
//end


/* rc port button */
if(document.querySelector('h1').textContent.substring(document.querySelector('h1').textContent.length, document.querySelector('h1').textContent.length-2) == "-r") {
document.querySelectorAll('[data-context="cerberusweb.contexts.project.board.column"]')[2].click();
setTimeout(function() {
document.getElementsByClassName('worklistBody')[2].childNodes[3].childNodes[1].childNodes[3].childNodes[5].click()
setTimeout(function() {
let relPort = document.getElementsByClassName('cerb-card-widget--header')[0].parentElement.childNodes[5].childNodes[0].childNodes[1].childNodes[1].childNodes[5].childNodes[1].childNodes[2].textContent.replaceAll("\n", "").replaceAll("\t","").replace("0", "5");
createElm('button', `<a style="color:black; font-weight: bold" href="https://online.dmgdemo.com:` + relPort + `" target="_blank"><span class="glyphicons glyphicons-globe" style="margin-right:5px"></span>Release Port</a>`, toolBarDiv);
document.getElementsByClassName('ui-icon-closethick')[0].click();
document.getElementsByClassName('ui-icon-closethick')[0].click();
}, 200)
}, 300)
}

//end buttons
//
/* Expansion Correction */
setTimeout(function() {
if (document.getElementsByClassName('block').length == 4 && document.getElementsByClassName('block')[0].children.length >= 7 && document.getElementsByClassName('block')[0].children[7].className.substr(0, 7) != "comment" && document.getElementsByClassName('block')[0].id.substr(0, 5) != "draft") {
document.getElementsByClassName('block')[0].parentNode.remove()
document.getElementsByClassName('toolbar-minmax')[0].style = "float: right; display: block !important";
document.getElementById('conversation').querySelector('[title="maximize"]').click();
}
//end
}, 1000);
}


/* ticket mask copy */
if(document.getElementsByClassName('cerb-profile-toolbar').length > 0) {
let tMask = document.getElementsByClassName('cerb-profile-toolbar')[0].parentElement.childNodes[1].textContent.substring(2, 15);
let tName = document.getElementsByClassName('cerb-profile-toolbar')[0].parentElement.childNodes[1].textContent.substring(15);
let tContainer = document.getElementsByClassName('cerb-profile-toolbar')[0].parentElement.childNodes[1];


tContainer.innerHTML = "[#<span onclick='copy(\""+tMask+"\")' style='color:blue'>" + tMask + "</span>" + tName;

}

//end


/* clear reopen time when closed */
function updateReopenDateOnClosed() {
waitForElementToDisplay('[name="status_id"][value="2"]', function() {
console.log(1);
document.querySelectorAll('[name="status_id"][value="2"]').forEach(item => {
item.addEventListener('click', event => {
console.log('click');
document.querySelector('[name=ticket_reopen]').value = '';
updateReopenDateOnClosed();
})
})
})
}
updateReopenDateOnClosed();




/* reply auto fill */

waitForElementToDisplay('textarea.reply', function() {
const replyArea = document.querySelector('textarea.reply');
replyArea.oninput = function() {
const shortcutCodes = {
"+cache": `You'll want to log out of the DeltaNET and close the tab, then follow the instructions below depending on the browser you use.

On Firefox, this can be done through History > Clear Recent History. Please make sure all boxes except passwords are marked and the time range is set to All Time.

On Chrome, this is done by clicking the More button (it looks like three vertical dots!) > More tools > Clear browsing data > Advanced > Time Range: All Time > check every box (except passwords - that box can stay unchecked) > Clear Data.

On Safari, go into the Safari menu and choose Preferences. Go to the Advanced tab and click the box to show the Develop menu. Then, go into the develop menu and click
"Empty caches".

On Edge, select the Hub icon (the three lines in front of a star) and click clear history. Select "Cookies and saved website data" and "Cached data and files", and click Clear.

If you�re on Internet Explorer, please change browsers immediately! Not only will any modern browser be far faster as well as more secure, Microsoft doesn�t support it any longer - thus, we also do not support it on our platform.`,

"+followup": `Hi,

I wanted to follow up with you on this ticket. I reached out previously and wanted to make sure you received my message. Feel free to respond at your earliest convenience!`,

"+training": `Hello,
You have requested information on scheduling a DeltaNET6 Training Session, and I would love to help you get that set up.
In order to get this event planned, please let me know the following:

* 3 Dates and Times you are available for this training session. *Please note, these trainings are scheduled out for 1 (HR) in length.
* The content in which you are requesting training for, Agent Side, Admin Side, Marketing, Leads, Etc. So I can prepare the appropriate material for you.
* A list of questions or concerns with the platform, so we can narrow down specific questions you may have on a certain feature, or want to learn more about.


These meetings will be scheduled via Zoom, so I can share my screen and present information. These meetings can have as many members join as you would like: New Agent Trainings, updated training courses for existing agents, or simply a 1-on-1 training to help familiarize you with our ever-growing platform.


I look forward to working with you, and hearing back soon with the above information!

Can’t wait to get started,

Thank You!
`,

'+digest': `The daily digest can be disabled for the agent under Profile -> System Notifications -> Daily Digest or on the admin side under Preferences -> Globals -> System Notifications -> Daily Digest.

If you'd like to remove just the agent birthdays, you can do so in the same locations, only instead of disabling Daily Digest, you can check the box for "Exclude Agent Special Days"

Please let me know if there are any other questions.`,

'+domain': `Inserting A Domain
First, agents must navigate to the domain section of the DeltaNET, this is located under the "Website" tile on the agents setting page. To get to the setting page click the gear in the top left corner.

Once on the domain page, agents can click the "Setup New Domain" button at the bottom to start the setup process. On the following screen, the agent will be prompted to insert their valid purchased domain that they got from their registrar. DO NOT include the "http://" or the "www." when inserting the domain. For the confirmation Email Address, enter in any current valid address that the agent can receive mail on.NOTE: Required records and important information will be sent to the confirmation address, please make sure the address entered is correct and secure before proceeding.
Example Domain Format:
GOOD: exampledomain.com - Bad: http://www.exampledomain.com
Bad: www.exampledomain.com - Bad: http://exampledomain.com

After pressing submit, the next step is to validate the domain in our system. To do this the agent will need to create a new TXT record in their registrar. The text record that needs to be entered can be found on the confirmation Email, the format will look as follows: "DMG=5ded624a9563342fd83ecbc554112822"
**It is important that you do this validation step BEFORE changing the name servers. If you change the name servers before you have successfully validated the domain, you will not be able to validate the domain and then you will be unable to use it until you revert the name servers back to their default and complete this step.**
After the text record is entered correctly, navigate back to the Website > Domains page and you will see a "Validate" button next to that domain which will allow you to validate your domain.

Once your Domain has been validated by our system, you will receive another email message with the DeltaNET NameServer (NS) records. These will also need to be updated in your domain's DNS. These records will point the domain to Delta Media Group's servers, so the domain can be fully connected to your DeltaNET site. Setting up the NS records will take a bit of time before the change is fully propagated over into your DeltaNET account, but once it is, you'll be able to set your domain up as your site's Primary one, as well as purchase an SSL security certificate.

* Red: The Domain has been added, but is awaiting Validation
* Blue: The domain has been validated, but is not set as the primary domain
* Green: The Domain has been set up as the primary domain, and has purchased the SSL certificate

GoDaddy! Video Walk Through: https://www.youtube.com/watch?v=Vccl4czoYNg&t=20s
`
}


for (let shortCode in shortcutCodes) {
if(replyArea.value.includes(shortCode)) {
const currentScroll = replyArea.scrollTop;
const currentSelection = replyArea.selectionStart;
replyArea.value = replyArea.value.replace(shortCode, shortcutCodes[shortCode]);
setTimeout(function() {
replyArea.scrollTop = currentScroll;
replyArea.selectionStart = currentSelection + shortcutCodes[shortCode].length - shortCode.length;
replyArea.selectionEnd = currentSelection + shortcutCodes[shortCode].length - shortCode.length }, 10);
}
}
}
}, 800, 99999999999999999)

//end

/* autofill fix */
let shortened = {
"cbreg": "Coldwell Banker Real Estate Group",
"weigand": "JP Weigand",
"cbg": "Coldwell Banker Gosslee",
"cbam": "Coldwell Banker American Homes",
"rmdfw": "RE/MAX DFW",
"rmcc": "RE/MAX Capital",
"key realty": "Key Realty, LTD",
"cbp": "Coldwell Banker Prime Properties",
"hpw": "Howard Perry and Walston",
"masiello": "BHG The Masiello Group",
"cbboise": "North West Real Estate Brokers, LLC dba Coldwell Banker Tomlinson Group",
"spokane": "Tomlinson Real Estate Group"

}
waitForElementToDisplay("#frmTicketPeek",function(){
if(document.getElementsByClassName('ui-autocomplete-input').length > 0) {
document.getElementsByClassName('ui-autocomplete-input')[0].oninput = function(){
for (let short in shortened) {
if (short == document.getElementsByClassName('ui-autocomplete-input')[0].value.toLowerCase()) {
document.getElementsByClassName('ui-autocomplete-input')[0].value = shortened[short];
setTimeout(function() {
document.getElementsByClassName('ui-dialog')[0].childNodes[13].firstChild.click();
}, 600);
}
}
}
}
},1000,900000000);

} // end cerb tools



/* cid and aid in deltanet */
if(document.getElementsByClassName('user-panel')[0]) {
const info = document.getElementsByClassName('user-panel')[0].getElementsByClassName('info')[0];
const agentName = info.children[0].textContent;
createElm('span', '0'+DMG_AGENT_ID, info);
createElm('button', 'C', info, 'margin-left:10px; padding:5px; padding-top:0px; padding-bottom:0px; font-size:14px', function() { copy(""+agentName+" (0"+DMG_AGENT_ID+")"); }, false, 'btn btn-primary');
//info.innerHTML += "0"+DMG_AGENT_ID+"<button onclick='copy(\""+agentName+" (0"+DMG_AGENT_ID+")\")'>C</button>";
document.getElementsByClassName('sidebar-menu')[0].getElementsByClassName('header')[0].innerHTML += " | CID: "+DMG_COMPANY_ID;
}

if(typeof(DMG_ADM) !== "undefined" && DMG_ADM == 0 && typeof(DMG_AGENT_DOMAIN) !== "undefined") {
// function createElm(type, html, parent, style, func, id)
createElm("button", "Agent Website", document.getElementsByClassName('navbar')[0], "position: relative; top:15px; margin-left: 15px;", function(){ window.open(DMG_AGENT_DOMAIN) }, false, "btn btn-primary");
}

if(typeof(DMG_ADM) !== "undefined" && DMG_ADM == 0) {
createElm("div", "", document.getElementsByClassName('navbar-custom-menu')[0], "position: absolute; top:67.5px; right:0%; border: none;", false, "custBtnHolder");
createElm("button", "Password", document.getElementById('custBtnHolder'), "border: none; border-radius: 0px", function() { navPage('/?body_content=edagentsite/Control.php&EdAgentAction=UpdatePass&lm_area=610&sub_area=98&tileid=194'); }, false, "btn btn-primary");
createElm("button", "Lead Settings", document.getElementById('custBtnHolder'), "border: none; border-radius: 0px", function() { navPage('/?body_content=leads/Control.php&LeadAction=Preferences&lm_area=610&sub_area=99&tileid=58'); }, false, "btn btn-primary");
createElm("button", "Domain Settings", document.getElementById('custBtnHolder'), "border: none; border-radius: 0px", function() { navPage('/?body_content=domains/Control.php&lm_area=610&sub_area=1&tileid=71'); }, false, "btn btn-primary");
createElm("button", "Notification Settings", document.getElementById('custBtnHolder'), "border: none; border-radius: 0px", function() { navPage('/?body_content=notifications/Control.php&lm_area=610&sub_area=99&tileid=848'); }, false, "btn btn-primary");
createElm("button", "AutoResponders", document.getElementById('custBtnHolder'), "border: none; border-radius: 0px", function() { navPage('/?body_content=responders/Control.php&lm_area=610&sub_area=99&tileid=82'); }, false, "btn btn-primary");
createElm("button", "Queued Emails", document.getElementById('custBtnHolder'), "border: none; border-radius: 0px", function() { navPage('/?body_content=email/Control.php&EmailAction=queue&lm_area=610&sub_area=99&tileid=83'); }, false, "btn btn-primary");
createElm("button", "Payment Profiles", document.getElementById('custBtnHolder'), "border: none; border-radius: 0px", function() { navPage('/?body_content=authorizenet%2FControl.php&action=profile&lm_area=60&sub_area=10&Adm=0'); }, false, "btn btn-primary");
createElm("button", "Quick Search Settings", document.getElementById('custBtnHolder'), "border: none; border-radius: 0px", function() { navPage('/?body_content=searchsettings/Control.php&searchSettingsAction=quicksearch&lm_area=610&sub_area=2&tileid=72'); }, false, "btn btn-primary");
createElm("button", "Privileges", document.getElementById('custBtnHolder'), "border: none; border-radius: 0px", function() { navPage('/?body_content=edagentsite/Control.php&EdAgentAction=UpdatePriv&lm_area=610&sub_area=98&tileid=190'); }, false, "btn btn-primary");


}
//end

/* show theme id on agent site */
// the font
var link = document.createElement('link');
link.setAttribute('rel', 'stylesheet');
link.setAttribute('type', 'text/css');
link.setAttribute('href', 'https://fonts.googleapis.com/css2?family=Prompt:wght@300;400&display=swap');
document.head.appendChild(link);

let e = document.getElementById('dmg_layout_wrapper');
if(e) {
let themeID = "<p style='font-family: \"Prompt\", sans-serif; color: white;padding:15px; max-width: 185px; border-radius:5px; text-shadow: 4px 4px 4px black; position: fixed; bottom: 10px; left: 10px'>" + e.classList[1] + "</p>";
let themeID2 = "<p style='font-family: \"Prompt\", sans-serif; color: white;padding:15px; max-width: 185px; border-radius:5px; text-shadow: 4px 4px 4px black; position: fixed; bottom: 10px; left: 110px'>" + e.classList[2] + "</p>";
//e.innerHTML += themeID;
createElm("span", themeID, e);
if(e.classList[1] == "isTeamSite") {
//e.innerHTML += themeID2;
createElm("span", themeID2, e);
}
}
//end

/* show puid */
if(typeof PUID != "undefined") {
createElm("p", "PUID: <span id='puidP'>"+PUID+"</span>", document.getElementsByClassName('basic-info')[0].children[0]);
const puid_name = 'PUID: '+document.getElementsByClassName('basic-info')[0].children[0].children[0].children[0].textContent + ' (' + PUID + ')';
createElm('button', 'C', document.getElementById('puidP'), 'margin-left:10px; padding:2.5px; padding-top:0px; padding-bottom:0px; font-size:14px', function() { copy(puid_name); }, false, 'btn btn-primary');
//document.getElementsByClassName('basic-info')[0].children[0].innerHTML += "PUID: " + PUID;
}
//end


}, 350)


///
}
}, 100);


function createElm(type, html, parent, style, func, id, cssClass, childType) {
let newElm = document.createElement(type);
newElm.innerHTML = html;
if(style) {
newElm.style = style;
}
if(type == "button" && func) {
newElm.onclick = func;
}
if(id) {
newElm.id = id;
}
if(cssClass) {
newElm.classList = cssClass;
}
console.log(childType);
if(childType && childType == 'pre') {
parent.prepend(newElm);
} else {
parent.appendChild(newElm);
}
}

function waitForElementToDisplay(selector, callback, checkFrequencyInMs, timeoutInMs) {
var startTimeInMs = Date.now();
(function loopSearch() {
if (document.querySelector(selector) != null) {
callback();
return;
}
else {
setTimeout(function () {
if (timeoutInMs && Date.now() - startTimeInMs > timeoutInMs)
return;
loopSearch();
}, checkFrequencyInMs);
}
})();
}

function copy(text) {
let textarea = document.createElement('textarea');
document.body.appendChild(textarea);
textarea.value = text;
textarea.select();
document.execCommand('copy');
textarea.remove();
}

function refreshTickOptions() {
let searchTools = document.getElementById('search_cerberusweb_contexts_ticket_output_container').parentElement.children[1]
searchTools.innerHTML = searchToolString;
}

function ticketSearch(value1, value2) {
document.getElementsByClassName('ace_text-input')[0].value = value1+': "'+value2+'"';
if(document.getElementById('searchToolOpened').checked) {
document.getElementsByClassName('ace_text-input')[0].value += ' status:"O"';
}
if(document.getElementById('searchToolIncoming').checked) {
document.getElementsByClassName('ace_text-input')[0].value += ' group:"CS - Incoming"';
}
if(document.getElementById('searchToolCompleted').checked) {
document.getElementsByClassName('ace_text-input')[0].value += ' group:"CS - Completed"';
}
if(document.getElementById('searchToolClosed').checked) {
document.getElementsByClassName('ace_text-input')[0].value += ' status:"C"';
}
if(document.getElementById('searchToolWeek').checked) {
document.getElementsByClassName('ace_text-input')[0].value += ' created: "last friday"';
}
let searchEvent = document.createEvent('Event');
searchEvent.initEvent('input', true, true);
document.getElementsByClassName('ace_text-input')[0].dispatchEvent(searchEvent);

searchEvent = document.createEvent('Event');
searchEvent.initEvent('compositionend', true, true);
document.getElementsByClassName('ace_text-input')[0].dispatchEvent(searchEvent);

searchEvent = document.createEvent("Event")
searchEvent.initEvent("keydown", true, true)
searchEvent.keyCode = 13
searchEvent.key = event.code = "Enter"
document.getElementsByClassName('ace_text-input')[0].dispatchEvent(searchEvent);
setTimeout(function() {
refreshTickOptions();
}, 800)
}

function tickNMI() {
document.getElementsByClassName('ace_text-input')[0].value = 'bucket:"NMI" (status:"open" OR status:"waiting")';

let searchEvent = document.createEvent('Event');
searchEvent.initEvent('input', true, true);
document.getElementsByClassName('ace_text-input')[0].dispatchEvent(searchEvent);

searchEvent = document.createEvent('Event');
searchEvent.initEvent('compositionend', true, true);
document.getElementsByClassName('ace_text-input')[0].dispatchEvent(searchEvent);

searchEvent = document.createEvent("Event")
searchEvent.initEvent("keydown", true, true)
searchEvent.keyCode = 13
searchEvent.key = event.code = "Enter"
document.getElementsByClassName('ace_text-input')[0].dispatchEvent(searchEvent);
setTimeout(function() {
refreshTickOptions();
}, 800)
}

function incomingUnassigned() {
document.getElementsByClassName('ace_text-input')[0].value = 'group:"CS - Incoming" status:"O" (assignedTsr:!"Edward Y" AND assignedTsr:!"Logan W" AND assignedTsr:!"Christian Moreland" AND assignedTsr:!"Roy K" AND assignedTsr:!"Chaundra T" AND assignedTsr:!"Jake D")'

let searchEvent = document.createEvent('Event');
searchEvent.initEvent('input', true, true);
document.getElementsByClassName('ace_text-input')[0].dispatchEvent(searchEvent);

searchEvent = document.createEvent('Event');
searchEvent.initEvent('compositionend', true, true);
document.getElementsByClassName('ace_text-input')[0].dispatchEvent(searchEvent);

searchEvent = document.createEvent("Event")
searchEvent.initEvent("keydown", true, true)
searchEvent.keyCode = 13
searchEvent.key = event.code = "Enter"
document.getElementsByClassName('ace_text-input')[0].dispatchEvent(searchEvent);
setTimeout(function() {
refreshTickOptions();
}, 800)

}

function selfAssign() {
document.getElementById('btnProfileCardEdit').click();
setTimeout(function() { document.getElementsByClassName('chooser-shortcut')[1].click(); }, 300)
setTimeout(function() { document.querySelector('button.submit').click(); }, 300)
}

function toggleCSS() {
if(!getCookie('theme')) {
document.cookie = "theme=1";
}

if(getCookie('theme') == '1') { deleteCookie('theme=1'); document.cookie = 'theme=2; expires=Fri, 31 Dec 9999 23:59:59 GMT'; } else { deleteCookie('theme=2'); document.cookie = 'theme=1; expires=Fri, 31 Dec 9999 23:59:59 GMT'; };
window.location.reload();
}

function cmtAutoFill() {
const orgName = document.getElementById("profileWidget101Fields").getElementsByClassName('cerb-peek-trigger')[0].textContent;
const orgSite = document.querySelectorAll('[rel="noopener"]')[0].textContent;
const dnSite = getSite(orgSite, 1);
const pbSite = getSite(orgSite, 0);
setTimeout(function() {
let cmtBox = document.getElementsByName("comment")[0];
// cmtBox.value += orgName;
// cmtBox.value += "\n\n";
// cmtBox.value += orgSite;
cmtBox.value = orgName+`\nRequester: \n`+pbSite+`\n`+dnSite+`\n

`;
//OVERVIEW + SUPPORTING INFO + REPRODUCTION STEPS + RESEARCH
//`;

/* QAT */
let subject = document.querySelector('h1').textContent;
if(subject.substring(document.querySelector('h1').textContent.length, document.querySelector('h1').textContent.length-2) == "-r") {

document.querySelectorAll('[data-context="cerberusweb.contexts.project.board.column"]')[2].click();
setTimeout(function() {
releaseDate = document.getElementsByClassName('worklistBody')[2].childNodes[3].childNodes[1].childNodes[3].childNodes[3].textContent;
document.getElementsByClassName('ui-dialog-titlebar-close')[1].click();
cmtBox.value = "Internal | "+subject.substring(17, document.querySelector('h1').textContent.length-2)+"\nRelease Cycle | "+releaseDate+"\nNew Feature Added - Documentation and Explanation\n\n";
}, 400)
}
}, 300);
}

function updateUnclaimedTicketCount() {
const ticketBody = document.getElementsByClassName('worklistBody')[1];
let unclaimedTickCount = 0;
for (let i = 1; i < ticketBody.children.length; i++) {
if (ticketBody.children[i].children[1].children[4].childElementCount == 0) {
unclaimedTickCount++;
}
}
createElm('span', unclaimedTickCount, document.getElementsByClassName('title')[1], 'margin-left: 10px; font-weight: bold; color: blue');
}

function navPage(urlPage) { console.log(urlPage);
window.location.href = urlPage;
}

function activitySearch(id) {
document.querySelectorAll('textarea.ace_text-input')[0].value = 'actor.worker:(id:'+id+') created:"-1 day"';
let searchEvent = document.createEvent('Event');
searchEvent.initEvent('input', true, true);
document.getElementsByClassName('ace_text-input')[0].dispatchEvent(searchEvent);

searchEvent = document.createEvent('Event');
searchEvent.initEvent('compositionend', true, true);
document.getElementsByClassName('ace_text-input')[0].dispatchEvent(searchEvent);

searchEvent = document.createEvent("Event")
searchEvent.initEvent("keydown", true, true)
searchEvent.keyCode = 13
searchEvent.key = event.code = "Enter"
document.getElementsByClassName('ace_text-input')[0].dispatchEvent(searchEvent);

setTimeout(function() {
let activityTools = document.querySelectorAll('td[data-column="c_created"]')[0].parentNode.parentNode.parentNode.parentNode.parentNode.firstElementChild.firstElementChild;
activityTools.innerHTML += activitySearchString;
}, 800)

}

function getSite(orgSite2, type) {
let dnSite = '';
let pubSite = '';

if (orgSite2.substring(0, 14) == "https://online") {
dnSite = orgSite2;
pubSite = "https://www." + orgSite2.substring(15);
}

if(orgSite2.substring(0, 13) == "http://online") {
dnSite = orgSite2;
pubSite = "http://www." + orgSite2.substring(14);
}

if(pubSite == "") {
if(orgSite2.substring(0,5) == "https") {
dnSite = "https://online."+orgSite2.substring(12);
pubSite = orgSite2;
} else if(orgSite2.substring(0,4) == "http") {
dnSite = "http://online."+orgSite2.substring(11);
pubSite = orgSite2;
}
}

if(type == 0) {
return pubSite;
}
if(type == 1) {
return dnSite;
}

}

function randomSanta() {
createElm('img', '', document.body, "position: fixed; margin-left: 100%; top:50px; z-index: 99;", false, 'xmasSanta', false, 'pre');
document.getElementById('xmasSanta').setAttribute('src', 'https://edward.coolpage.biz/TS/srcs/xmas21/animated-santa-claus-image-0420.gif');
setTimeout(function() {
document.getElementById('xmasSanta').remove();
console.log('santa goes');
randomSanta();
}, Math.floor(Math.random() * (950000 - 40000) + 40000))
}


function cerbUpgrade(pageType) {
switch(pageType) {
case "dash":
createElm('div', `<style>
@import 'https://edward.coolpage.biz/bulma/css/bulma.css';

.cat-title {
top: -50px;
position: relative;
margin-left: 5px;
color: white !important;
font-size: 16px;
font-weight: bold;
margin-bottom: -20px;
}

.odd, .even {
background-color: #fefefe !important
}

td {
border-bottom: 3px solid #e3e3e3 !important;
}

TABLE.worklist TD SPAN.title {
visibility: hidden;
}

.summary > tr > td {
border-bottom: 0px !important;
}

</style>


<div class="columns" style="height: 100%">
<div class="column is-one-fifth" style="width: 12%; padding: 2%;">
<a href="/index.php/" style="margin-bottom:10px">
<img src="https://s3.amazonaws.com/helpsite-uploads/ppqrdz-w06mndw8v7eklwtom2ps%2FeysQ-T1wWpc1638544574510-DeltaMediaGroup_noURL_blue.png" alt="Delta Media Group Support Center">
</a>
<aside class="menu">
<p class="menu-label">Cerberus 2.0</p>
<ul class="menu-list">
<li><a href="/index.php/pages/220-TS1/cs-incoming-open" class="subtitle is-6" role="presentation" tabindex="-1" id="ui-id-26">
Incoming
</a></li>
<li><a href="/index.php/pages/220-TS1/cs-incoming-waiting" class="subtitle is-6" role="presentation" tabindex="-1" id="ui-id-26">
Waiting
</a></li>
<li><a href="/index.php/pages/220-TS1/cs-completed" class="subtitle is-6" role="presentation" tabindex="-1" id="ui-id-26">
Completed
</a></li>
<li><a href="/index.php/pages/220-TS1/all-tickets" class="subtitle is-6">
All Tickets
</a></li>
<li>
<a class="subtitle is-6" href="/index.php/pages/208-Knowledgebase/ts-documentation">Knowledgebase</a>
</li>
<li>
<a class="subtitle is-6" href="/index.php/pages/220-TS1/resources">Resources</a>
</li>
<li>
<a class="subtitle is-6" onclick="toggleCSS()">Toggle Cerb 2.0</a>
</li>
</ul>
</aside>

</div>

<div class="columns is-multiline column box">
<div class="column is-full box">
<div id="tick1" style="margin-top:2%; background-color: #f9f9f9 !important; border-radius: 6px; border-top: 35px solid #6ca7ee;" class="box">
<h3 class="cat-title">
<a style="color: inherit" href="#">Your `+ticketType+` Tickets <span style="margin-left: 10px" id="numberExtraTickets"></span></a>
</h3>
</div>
</div>

<div class="column is-full box">
<div id="tick2" style="margin-top:2%; background-color: #f9f9f9 !important; border-radius: 6px; border-top: 35px solid #6ca7ee;" class="box">
<h3 class="cat-title">
<a style="color: inherit" href="#">All `+ticketType+` Tickets</a>
</h3>
</div>
</div>
</div>


</div>

<!--
document.getElementById('tick1').appendChild(document.getElementsByClassName('worklistBody')[0]);
document.getElementById('tick2').appendChild(document.getElementsByClassName('worklistBody')[1]);
-->


`, document.body, false, false, false, false, 'pre');
setTimeout(function() {
if(document.getElementsByClassName('worklistBody').length > 3) {
numGuides = document.getElementsByClassName('worklistBody')[2].childElementCount -1;
numReassign = document.getElementsByClassName('worklistBody')[3].childElementCount - 1;
let numGuidesColor = 'green';
let numReassignColor = 'green';
if(numGuides > 0) { numGuidesColor = 'red'; }
if(numReassign > 0) { numReassignColor = 'red'; }
document.getElementById('numberExtraTickets').innerHTML = "<span style='color: "+numGuidesColor+"'>" + numGuides + "</span> Guides | <span style='color: "+numReassignColor+"'>" + numReassign + "</span> Reassign";
}
document.getElementById('tick1').appendChild(document.getElementsByClassName('worklistBody')[0].parentElement.parentElement.parentElement.parentElement.parentElement);
document.getElementById('tick2').appendChild(document.getElementsByClassName('worklistBody')[1].parentElement.parentElement.parentElement.parentElement.parentElement);
document.body.prepend(document.getElementsByClassName('cerb-no-print')[0]);
document.getElementsByClassName('cerb-no-print')[0].appendChild(document.querySelectorAll('.submenu')[0].parentElement);
if (document.getElementById('cerb-logo')) {
document.getElementById('cerb-logo').parentElement.remove();
}
document.getElementById('lnkSignedIn').parentElement.parentElement.style = 'z-index: 9999 !important' }, 500);
break;
}
}

function refreshTickets() {
document.getElementsByClassName('glyphicons-refresh')[1].parentElement.click();
console.log('refresh');
setTimeout(function() {
refreshTickets();
}, 25000)
}

function getCookie(name) {
var match = document.cookie.match(RegExp('(?:^|;\\s*)' + name + '=([^;]*)'));
return match ? match[1] : null;
}

function deleteCookie(name) {
document.cookie = name +"; Expires=Thu, 01 Jan 1970 00:00:01 GMT";
}

Back to list