NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Ascom IMS-Helper // @namespace http://darkspot.ch/c/imshelper // @version 0.1 // @description In Ascom IMS-Systems, this script adds an Export button in the groups for exporting the numbers into a text window // @match http://*/cgi-bin/admin/createxml?edms_topmenu.xml+system_leftmenu.xml+PARAMETER+dgh+dghg+dectgroup* // @copyright 2014+, T. Soltermann // @require http://code.jquery.com/jquery-latest.min.js // ==/UserScript== function _x(STR_XPATH) { var xresult = document.evaluate(STR_XPATH, document, null, XPathResult.ANY_TYPE, null); var xnodes = []; var xres; while (xres = xresult.iterateNext()) { xnodes.push(xres); } return xnodes; } $(document).ready(function() { var button = " " $(_x('/html/body/table/tbody/tr[3]/td/table/tbody/tr/td/table/tbody/tr[2]/td[2]/table/tbody/tr/td/table/tbody/tr[2]/td[2]')).append("<button id=\"exportNumbers\" style=\"background-color: yellow\">Export</button>") $("#exportNumbers").click( function() { var text = "<code>"; $("[name=member]").map( function(id,elem) { text += elem.value; text += "<br>\n"; } ); text += "</code>"; var w = window.open('', "", "width=600, height=400, scrollbars=yes"); var html = $("#modeltext").html(); $(w.document.body).html(text); } ); });