This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSON.parse("true"); //true | |
JSON.parse("false"); //false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**************** | |
* Can you pass values from a widget to a UI Script, and back again? | |
* The Widget is used as the $scope source and grabbed by using angular.element and class of the widget | |
* The MutationObserver is used to detect changes at the DOM level as UI Scripts are loaded once at the load of the portal, need to know a change happens when page changes | |
* This may not be pratical, as for my use case I found it working as expected just using the widget to control the changes I needed, but it's cool to know you can interact with with the scope/widgets outside the scope/widget | |
****************/ | |
(function(angular) { | |
MutationObserver = window.MutationObserver || window.WebKitMutationObserver; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********** | |
* Need to be able to bulk upload Stand Change Proposals | |
* onBefore Transform Script | |
***********/ | |
//convert impact to value | |
var impactRaw = source.u_i + ""; | |
var impact = ""; | |
switch (impactRaw) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Flatten array [a,[a,b],b,[c,d]] into [a,a,b,b,c,d] | |
var flattenList = [].concat.apply([], c.data.records); | |
//remove dupes [a,a,b,b,c,d] into [a,b,c,d] | |
flattenList = [...new Set(flattenList.map(JSON.stringify))].map(JSON.parse); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Use case: Need multiple "containers" of a specific widget (in this case something like the icon widget | |
or image link widget, where you might have a grid of 3x3 or a single row of 3 or something). There are | |
different styles needed for each "container" | |
of the widget(s) | |
* You can assign a CSS name on the container, but what does SCSS offer me? | |
**/ | |
//CSS Include |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$location.hash('anchorString'); //no # | |
$anchorScroll(); | |
//https://docs.angularjs.org/api/ng/service/$anchorScroll#! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_getDataDriven: function(table, condition, valueField) { | |
var gr = new GlideRecord(table); | |
gr.addEncodedQuery(condition); | |
gr.query(); | |
while (gr.next()) { | |
return gr.getValue(valueField) || ""; | |
} | |
return ""; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h1 , h2, h3{ | |
font-family: 'Alfa Slab One', cursive; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p> | |
<link href="https://fonts.googleapis.com/css?family=Alfa+Slab+One" rel="stylesheet"> | |
<link href="e7a8db83db3123c025350f95ca96197f.cssdbx" rel="stylesheet" type="text/css" /> | |
</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p><link href="e7a8db83db3123c025350f95ca96197f.cssdbx" rel="stylesheet" type="text/css" /></p> |
NewerOlder