Skip to content

Commit 87ad9be

Browse files
author
William Troup
committed
Added 4 new configuration options.
1 parent c491f7d commit 87ad9be

3 files changed

Lines changed: 49 additions & 40 deletions

File tree

dist/syntax.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,16 @@
146146
_cached_Comments = {};
147147
_cached_Comments_Count = 0;
148148
} else {
149-
result = logError("No code is available available to render, skipping.");
149+
result = logError(_configuration.noCodeAvailableToRenderErrorText);
150150
}
151151
} else {
152152
result = !_configuration.safeMode;
153153
}
154154
} else {
155-
result = logError("Language '" + syntaxLanguage + "' is not supported.");
155+
result = logError(_configuration.languageNotSupportedErrorText.replace("{{language}}", syntaxLanguage));
156156
}
157157
} else {
158-
result = logError("The attribute '" + _attribute_Name_Language + "' has not been set correctly.");
158+
result = logError(_configuration.attributeNotSetErrorText.replace("{{attribute_name}}", _attribute_Name_Language));
159159
}
160160
}
161161
return {rendered:result, tabContents:tabContents, tabTitle:tabTitle, tabBindingOptions:tabBindingOptions, syntaxLanguage:syntaxLanguage};
@@ -775,7 +775,7 @@
775775
result = result();
776776
}
777777
} catch (e2) {
778-
parsed = logError("Errors in object: " + e1.message + ", " + e2.message);
778+
parsed = logError(_configuration.objectErrorText.replace("{{error_1}}", e1.message).replace("{{error_2}}", e2.message));
779779
result = null;
780780
}
781781
}
@@ -955,6 +955,10 @@
955955
function buildDefaultConfigurationStrings() {
956956
_configuration.buttonsOpenerText = getDefaultString(_configuration.buttonsOpenerText, "<");
957957
_configuration.buttonsCloserText = getDefaultString(_configuration.buttonsCloserText, ">");
958+
_configuration.objectErrorText = getDefaultString(_configuration.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}");
959+
_configuration.attributeNotSetErrorText = getDefaultString(_configuration.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly.");
960+
_configuration.languageNotSupportedErrorText = getDefaultString(_configuration.languageNotSupportedErrorText, "Language '{{language}}' is not supported.");
961+
_configuration.noCodeAvailableToRenderErrorText = getDefaultString(_configuration.noCodeAvailableToRenderErrorText, "No code is available available to render.");
958962
}
959963
function buildDefaultConfigurationCustomTriggers() {
960964
_configuration.onBeforeRender = getDefaultFunction(_configuration.onBeforeRender, null);

0 commit comments

Comments
 (0)