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

Function pdf

codebase/sources/dhtmlxscheduler.js:14947–15275  ·  view source on GitHub ↗
(scheduler2)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

api_dateMethod · 0.65

Tested by

no test coverage detected