Name

global.ATFUtil

Description

No description available

Script

var ATFUtil = Class.create();
ATFUtil.prototype = {
  type: 'ATFUtil'
};

ATFUtil.getDocumentClonerOptions = function() {
  var result = {};

  // Helper that will only add properties to the JSON result if they are explicitly defined
  // It's important to differentiate between null (not defined) and empty string here (which are both falsy)
  function addPropertyIfDefined(jsonName, propertyName) {
  	var value = GlideProperties.get(propertyName);
  	if (value !== null) {
  		// Convert to string, then split it into a list using commas
  		result[jsonName] = String(value).split(",");
  	}
  }

  addPropertyIfDefined("ignoredTags", "sn_atf.document_cloner.ignored_tags");
  addPropertyIfDefined("ignoredStyleAttributePrfx", "sn_atf.document_cloner.ignored_style_prefixes");
  addPropertyIfDefined("alwaysCopyStyles", "sn_atf.document_cloner.always_copy_styles");
  addPropertyIfDefined("ignoredStyleCopy", "sn_atf.document_cloner.ignored_style_copy");
  addPropertyIfDefined("deepCloneTags", "sn_atf.document_cloner.deep_clone_tags");
  addPropertyIfDefined("skipChildrenTags", "sn_atf.document_cloner.skip_children_tags");

  // This one is just a normal boolean, no need to worry about null/non-null
  result["copyAllComputedStyles"] = GlideProperties.getBoolean("sn_atf.screenshots.copy_all_computed_styles", false);

  return result;
};

Sys ID

ef935239434221104402a9bb1cb8f2ed

Offical Documentation

Official Docs: