Changeset 1247 for trunk/autoquest-htmlmonitor/src/main/js
- Timestamp:
- 07/01/13 17:34:55 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-htmlmonitor/src/main/js/autoquest-htmlmonitor.js
r1244 r1247 92 92 //{ "tag": "details", "actions": [ ] }, 93 93 { "tag": "dfn", "actions": [ "onclick" ] }, 94 { "tag": "div", "actions": [ "onclick" ] }, 94 { "tag": "div", "actions": [ "onclick", 95 "onscroll" ] }, 95 96 //{ "tag": "dl", "actions": [ ] }, 96 97 { "tag": "dt", "actions": [ "onclick" ] }, … … 116 117 { "tag": "img", "actions": [ "onabort", 117 118 "onclick" ] }, 118 { "tag": "input_text", "actions": [ "onchange", 119 { "tag": "input_button", "actions": [ "onclick", 120 "onfocus" ] }, 121 { "tag": "input_checkbox", "actions": [ "onchange", 122 "onclick", 123 "onfocus" ] }, 124 { "tag": "input_color", "actions": [ "onchange", 125 "onclick", 126 "onfocus", 127 "onselect" ] }, 128 { "tag": "input_date", "actions": [ "onchange", 129 "onclick", 119 130 "onfocus", 120 131 "onselect" ] }, 132 { "tag": "input_datetime", "actions": [ "onchange", 133 "onclick", 134 "onfocus", 135 "onselect" ] }, 136 { "tag": "input_datetime-local", "actions": [ "onchange", 137 "onclick", 138 "onfocus", 139 "onselect" ] }, 140 { "tag": "input_email", "actions": [ "onchange", 141 "onclick", 142 "onfocus", 143 "onselect" ] }, 144 { "tag": "input_file", "actions": [ "onchange", 145 "onclick", 146 "onfocus", 147 "onselect" ] }, 148 { "tag": "input_image", "actions": [ "onclick", 149 "onfocus" ] }, 150 { "tag": "input_month", "actions": [ "onchange", 151 "onclick", 152 "onfocus", 153 "onselect" ] }, 154 { "tag": "input_number", "actions": [ "onchange", 155 "onclick", 156 "onfocus", 157 "onselect" ] }, 121 158 { "tag": "input_password", "actions": [ "onchange", 122 "onfocus" ] },123 { "tag": "input_checkbox", "actions": [ "onchange",124 159 "onclick", 125 160 "onfocus" ] }, … … 127 162 "onclick", 128 163 "onfocus" ] }, 164 { "tag": "input_range", "actions": [ "onchange", 165 "onclick", 166 "onfocus", 167 "onselect" ] }, 168 { "tag": "input_reset", "actions": [ "onclick", 169 "onfocus" ] }, 170 { "tag": "input_search", "actions": [ "onchange", 171 "onclick", 172 "onfocus", 173 "onselect" ] }, 129 174 { "tag": "input_submit", "actions": [ "onclick", 130 175 "onfocus" ] }, 131 { "tag": "input_reset", "actions": [ "onclick", 132 "onfocus" ] }, 133 { "tag": "input_file", "actions": [ "onclick", 134 "onfocus" ] }, 135 { "tag": "input_image", "actions": [ "onclick", 136 "onfocus" ] }, 137 { "tag": "input_button", "actions": [ "onclick", 138 "onfocus" ] }, 176 { "tag": "input_tel", "actions": [ "onchange", 177 "onclick", 178 "onfocus", 179 "onselect" ] }, 180 { "tag": "input_text", "actions": [ "onchange", 181 "onclick", 182 "onfocus", 183 "onselect" ] }, 184 { "tag": "input_time", "actions": [ "onchange", 185 "onclick", 186 "onfocus", 187 "onselect" ] }, 188 { "tag": "input_url", "actions": [ "onchange", 189 "onclick", 190 "onfocus", 191 "onselect" ] }, 192 { "tag": "input_week", "actions": [ "onchange", 193 "onclick", 194 "onfocus", 195 "onselect" ] }, 139 196 { "tag": "input", "actions": [ "onchange", 197 "onclick", 140 198 "onfocus" ] }, 141 199 { "tag": "ins", "actions": [ "onclick" ] }, … … 437 495 function registerEventHandler(node, nodePath, action) { 438 496 var parameters = { action : action, path : nodePath}; 497 498 if ((action === "onscroll") && (node === document.body)) { 499 node = window; 500 } 501 439 502 if (jQuery(node).on) { 440 503 jQuery(node).on(action.substring(2), parameters, handleJQueryEvent); … … 535 598 eventType = eventName.toLowerCase(); 536 599 600 // check, if the preceeding event is more concrete, i.e. the new event to be handled is only 601 // a propagation through the DOM and needs, therefore, not be handled 537 602 if (autoquestRecordedEvents.length > 0) { 538 603 eventObj = autoquestRecordedEvents[autoquestRecordedEvents.length - 1]; 539 604 540 // check if an event showed up several times either for the same or for a parent GUI element541 605 if ((eventObj.type === eventName) && (eventObj.nodePath.indexOf(nodePath) === 0)) { 542 606 // the event is of the same type. 543 607 if (eventObj.nodePath.length > nodePath.length) { 544 // the same event showed up for the parent GUI element. This must not be handled.545 // So ignore it608 // the new event is the same event as the previous one, but fired for the parent 609 // GUI element of the previous event. This must not be handled. So ignore it 546 610 log("discarding event " + eventName + " on " + node + 547 611 " as it is already handled by a child"); … … 561 625 562 626 if (!eventObj) { 563 // create a new event and add it to the list627 // we can not reuse the previous event. So create a new event and add it to the list 564 628 eventObj = new Event(eventType, nodePath); 565 629 log("storing event " + eventName); … … 574 638 tagName = getTagName(node); 575 639 640 // ensure to not monitor details for GUI elements marked as unmonitored 576 641 if (node.getAttribute && node.getAttribute("class")) { 577 642 unmonitored = node.getAttribute("class").indexOf("autoquest-unmonitored") >= 0; … … 582 647 583 648 if (!unmonitored && ("input_password" !== tagName)) { 649 // add further parameters for GUI elements which are monitored and which are no password 650 // fields 584 651 if ((eventType === "onkeypress") || 585 652 (eventType === "onkeydown") || … … 605 672 } 606 673 674 // finally send the recorded data 607 675 if (autoquestRecordedEvents.length >= autoquestPackageSize) { 608 676 log("initiating sending events");
Note: See TracChangeset
for help on using the changeset viewer.