MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / pdf

Function pdf

codebase/sources/dhtmlxscheduler.es.js:14943–15271  ·  view source on GitHub ↗
(scheduler2)

Source from the content-addressed store, hash-verified

14941 });
14942}
14943function pdf(scheduler2) {
14944 var dx, dy, html_regexp = new RegExp("<[^>]*>", "g"), newline_regexp = new RegExp("<br[^>]*>", "g");
14945 function clean_html(val) {
14946 return val.replace(newline_regexp, "\n").replace(html_regexp, "");
14947 }
14948 function x_norm(x, offset) {
14949 x = parseFloat(x);
14950 offset = parseFloat(offset);
14951 if (!isNaN(offset))
14952 x -= offset;
14953 var w = colsWidth(x);
14954 x = x - w.width + w.cols * dx;
14955 return isNaN(x) ? "auto" : 100 * x / dx;
14956 }
14957 function x_norm_event(x, offset, is_left) {
14958 x = parseFloat(x);
14959 offset = parseFloat(offset);
14960 if (!isNaN(offset) && is_left)
14961 x -= offset;
14962 var w = colsWidth(x);
14963 x = x - w.width + w.cols * dx;
14964 return isNaN(x) ? "auto" : 100 * x / (dx - (!isNaN(offset) ? offset : 0));
14965 }
14966 function colsWidth(width) {
14967 var r = 0;
14968 var header = scheduler2._els.dhx_cal_header[0].childNodes;
14969 var els = header[1] ? header[1].childNodes : header[0].childNodes;
14970 for (var i = 0; i < els.length; i++) {
14971 var el = els[i].style ? els[i] : els[i].parentNode;
14972 var w = parseFloat(el.style.width);
14973 if (width > w) {
14974 width -= w + 1;
14975 r += w + 1;
14976 } else
14977 break;
14978 }
14979 return { width: r, cols: i };
14980 }
14981 function y_norm(y) {
14982 y = parseFloat(y);
14983 if (isNaN(y))
14984 return "auto";
14985 return 100 * y / dy;
14986 }
14987 function get_style(node, style) {
14988 return (window.getComputedStyle ? window.getComputedStyle(node, null)[style] : node.currentStyle ? node.currentStyle[style] : null) || "";
14989 }
14990 function de_day(node, n) {
14991 var x = parseInt(node.style.left, 10);
14992 for (var dx2 = 0; dx2 < scheduler2._cols.length; dx2++) {
14993 x -= scheduler2._cols[dx2];
14994 if (x < 0)
14995 return dx2;
14996 }
14997 return n;
14998 }
14999 function de_week(node, n) {
15000 var y = parseInt(node.style.top, 10);

Callers

nothing calls this directly

Calls 1

api_dateMethod · 0.65

Tested by

no test coverage detected