<commit_before>// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// MIT License. See license.txt
/* globals jscolor */
frappe.provide("frappe.website_theme");
$.extend(frappe.website_theme, {
	color_variables: ["background_color", "top_bar_color", "top_bar_text_color",
		"footer_color", "footer_text_color", "text_color", "link_color"]
});

frappe.ui.form.on('Website Theme', {
	onload_post_render(frm) {
		frappe.require('assets/frappe/js/lib/jscolor/jscolor.js', function() {
			$.each(frappe.website_theme.color_variables, function(i, v) {
				$(frm.fields_dict[v].input).addClass('color {required:false,hash:true}');
			});
			jscolor.bind();
		});
	},
	refresh(frm) {
		frm.set_intro(__('Default theme is set in {0}', ['<a href="#Form/Website Settings">'
			+ __('Website Settings') + '</a>']));

		frm.toggle_display(["module", "custom"], !frappe.boot.developer_mode);

		if (!frm.doc.custom && !frappe.boot.developer_mode) {
			frm.set_read_only();
			frm.disable_save();
		} else {
			frm.enable_save();
		}
	}
})<commit_msg>fix: Bootstrap default custom theme<commit_after>// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// MIT License. See license.txt
/* globals jscolor */
frappe.provide("frappe.website_theme");
$.extend(frappe.website_theme, {
	color_variables: ["background_color", "top_bar_color", "top_bar_text_color",
		"footer_color", "footer_text_color", "text_color", "link_color"]
});

frappe.ui.form.on('Website Theme', {
	onload_post_render(frm) {
		frappe.require('assets/frappe/js/lib/jscolor/jscolor.js', function() {
			$.each(frappe.website_theme.color_variables, function(i, v) {
				$(frm.fields_dict[v].input).addClass('color {required:false,hash:true}');
			});
			jscolor.bind();
		});
	},
	refresh(frm) {
		frm.set_intro(__('Default theme is set in {0}', ['<a href="#Form/Website Settings">'
			+ __('Website Settings') + '</a>']));

		frm.toggle_display(["module", "custom"], !frappe.boot.developer_mode);

		if (!frm.doc.custom && !frappe.boot.developer_mode) {
			frm.set_read_only();
			frm.disable_save();
		} else {
			frm.enable_save();
		}
	},
	apply_custom_theme(frm) {
		if (frm.doc.apply_custom_theme && !frm.doc.custom_theme) {
			frm.set_value('custom_theme', '$primary: #7575ff;\n\n@import "website";')
		}
	}
})
{'fraction_non_alphanumeric': 0.19062092922275292, 'fraction_numerical': 0.0060790273556231, 'mean_word_length': 5.031413612565445, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2763485', 'n_tokens_mistral': 952, 'n_tokens_neox': 871, 'n_words': 132}