From 3b06ee0d381dc1be5f40ca98ad4278046d869d21 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 17 Nov 2019 20:57:39 +0100 Subject: checked in initial customized verison for Archlinux32 --- common.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 common.js (limited to 'common.js') diff --git a/common.js b/common.js new file mode 100644 index 0000000..47a7155 --- /dev/null +++ b/common.js @@ -0,0 +1,38 @@ + +/** + * Copyright (C) 2008-2012 FluxBB + * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB + * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher + */ + +function select_checkboxes(curFormId, link, new_string) +{ + var curForm = document.getElementById(curFormId); + var inputlist = curForm.getElementsByTagName("input"); + for (i = 0; i < inputlist.length; i++) + { + if (inputlist[i].getAttribute("type") == 'checkbox' && inputlist[i].disabled == false) + inputlist[i].checked = true; + } + + link.setAttribute('onclick', 'return unselect_checkboxes(\'' + curFormId + '\', this, \'' + link.innerHTML + '\')'); + link.innerHTML = new_string; + + return false; +} + +function unselect_checkboxes(curFormId, link, new_string) +{ + var curForm = document.getElementById(curFormId); + var inputlist = curForm.getElementsByTagName("input"); + for (i = 0; i < inputlist.length; i++) + { + if (inputlist[i].getAttribute("type") == 'checkbox' && inputlist[i].disabled == false) + inputlist[i].checked = false; + } + + link.setAttribute('onclick', 'return select_checkboxes(\'' + curFormId + '\', this, \'' + link.innerHTML + '\')'); + link.innerHTML = new_string; + + return false; +} -- cgit v1.2.3-54-g00ecf