mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2026-04-29 06:17:11 +00:00
optimise vars
This commit is contained in:
@@ -48,22 +48,22 @@
|
||||
<strong>Style</strong>
|
||||
|
||||
<label for="diffWords" class="pure-checkbox">
|
||||
<input type="radio" name="diff_type" id="diffWords" value="diffWords" {% if diff_prefs.diff_type == 'diffWords' %}checked=""{% endif %}> Words</label>
|
||||
<input type="radio" name="type" id="diffWords" value="diffWords" {% if diff_prefs.type == 'diffWords' %}checked=""{% endif %}> Words</label>
|
||||
<label for="diffLines" class="pure-checkbox">
|
||||
<input type="radio" name="diff_type" id="diffLines" value="diffLines" {% if diff_prefs.diff_type == 'diffLines' %}checked=""{% endif %}> Lines</label>
|
||||
<input type="radio" name="type" id="diffLines" value="diffLines" {% if diff_prefs.type == 'diffLines' %}checked=""{% endif %}> Lines</label>
|
||||
|
||||
<label for="ignoreWhitespace" class="pure-checkbox" id="label-diff-ignorewhitespace">
|
||||
<input type="checkbox" id="ignoreWhitespace" name="ignoreWhitespace" {% if diff_prefs.ignoreWhitespace %}checked=""{% endif %}> Ignore Whitespace</label>
|
||||
|
||||
<label for="diff_changesOnly" class="pure-checkbox" id="label-diff-changes">
|
||||
<input type="checkbox" id="diff_changesOnly" name="diff_changesOnly" {% if diff_prefs.diff_changesOnly %}checked=""{% endif %}> Same/non-changed</label>
|
||||
<label for="changesOnly" class="pure-checkbox" id="label-diff-changes">
|
||||
<input type="checkbox" id="changesOnly" name="changesOnly" {% if diff_prefs.changesOnly %}checked=""{% endif %}> Same/non-changed</label>
|
||||
|
||||
<label for="diff_removed" class="pure-checkbox" id="label-diff-removed">
|
||||
<input type="checkbox" id="diff_removed" name="diff_removed" {% if diff_prefs.diff_removed %}checked=""{% endif %}> Removed</label>
|
||||
<label for="diff_added" class="pure-checkbox" id="label-diff-added">
|
||||
<input type="checkbox" id="diff_added" name="diff_added" {% if diff_prefs.diff_added %}checked=""{% endif %}> Added</label>
|
||||
<label for="diff_replaced" class="pure-checkbox" id="label-diff-replaced">
|
||||
<input type="checkbox" id="diff_replaced" name="diff_replaced" {% if diff_prefs.diff_replaced %}checked=""{% endif %}> Replaced</label>
|
||||
<label for="removed" class="pure-checkbox" id="label-diff-removed">
|
||||
<input type="checkbox" id="removed" name="removed" {% if diff_prefs.removed %}checked=""{% endif %}> Removed</label>
|
||||
<label for="added" class="pure-checkbox" id="label-diff-added">
|
||||
<input type="checkbox" id="added" name="added" {% if diff_prefs.added %}checked=""{% endif %}> Added</label>
|
||||
<label for="replaced" class="pure-checkbox" id="label-diff-replaced">
|
||||
<input type="checkbox" id="replaced" name="replaced" {% if diff_prefs.replaced %}checked=""{% endif %}> Replaced</label>
|
||||
</fieldset>
|
||||
{%- if note -%}<span class="note"><strong>{{ note }}</strong></span>{%- endif -%}
|
||||
</form>
|
||||
|
||||
@@ -93,12 +93,12 @@ def construct_blueprint(datastore: ChangeDetectionStore, update_q, queuedWatchMe
|
||||
|
||||
# Diff display preferences configuration - single source of truth
|
||||
DIFF_PREFERENCES_CONFIG = {
|
||||
'diff_changesOnly': {'default': True, 'type': 'bool'},
|
||||
'changesOnly': {'default': True, 'type': 'bool'},
|
||||
'ignoreWhitespace': {'default': False, 'type': 'bool'},
|
||||
'diff_removed': {'default': True, 'type': 'bool'},
|
||||
'diff_added': {'default': True, 'type': 'bool'},
|
||||
'diff_replaced': {'default': True, 'type': 'bool'},
|
||||
'diff_type': {'default': 'diffLines', 'type': 'value'},
|
||||
'removed': {'default': True, 'type': 'bool'},
|
||||
'added': {'default': True, 'type': 'bool'},
|
||||
'replaced': {'default': True, 'type': 'bool'},
|
||||
'type': {'default': 'diffLines', 'type': 'value'},
|
||||
}
|
||||
|
||||
@views_blueprint.app_template_filter('diff_unescape_difference_spans')
|
||||
@@ -341,12 +341,12 @@ def construct_blueprint(datastore: ChangeDetectionStore, update_q, queuedWatchMe
|
||||
|
||||
content = diff.render_diff(previous_version_file_contents=from_version_file_contents,
|
||||
newest_version_file_contents=to_version_file_contents,
|
||||
include_replaced=diff_prefs['diff_replaced'],
|
||||
include_added=diff_prefs['diff_added'],
|
||||
include_removed=diff_prefs['diff_removed'],
|
||||
include_equal=diff_prefs['diff_changesOnly'],
|
||||
include_replaced=diff_prefs['replaced'],
|
||||
include_added=diff_prefs['added'],
|
||||
include_removed=diff_prefs['removed'],
|
||||
include_equal=diff_prefs['changesOnly'],
|
||||
ignore_junk=diff_prefs['ignoreWhitespace'],
|
||||
word_diff=diff_prefs['diff_type'] == 'diffWords',
|
||||
word_diff=diff_prefs['type'] == 'diffWords',
|
||||
)
|
||||
|
||||
# Build cell grid visualizer before applying HTML color (so we can detect placemarkers)
|
||||
|
||||
Reference in New Issue
Block a user