about summary refs log tree commit diff stats
path: root/archive/1.vm.arc/charterm/planet-docs/doc/scribble-common.js
diff options
context:
space:
mode:
Diffstat (limited to 'archive/1.vm.arc/charterm/planet-docs/doc/scribble-common.js')
-rw-r--r--archive/1.vm.arc/charterm/planet-docs/doc/scribble-common.js153
1 files changed, 0 insertions, 153 deletions
diff --git a/archive/1.vm.arc/charterm/planet-docs/doc/scribble-common.js b/archive/1.vm.arc/charterm/planet-docs/doc/scribble-common.js
deleted file mode 100644
index 00eec767..00000000
--- a/archive/1.vm.arc/charterm/planet-docs/doc/scribble-common.js
+++ /dev/null
@@ -1,153 +0,0 @@
-// Common functionality for PLT documentation pages
-
-// Page Parameters ------------------------------------------------------------
-
-var page_query_string =
-  (location.href.search(/\?([^#]+)(?:#|$)/) >= 0) && RegExp.$1;
-
-var page_args =
-  ((function(){
-      if (!page_query_string) return [];
-      var args = page_query_string.split(/[&;]/);
-      for (var i=0; i<args.length; i++) {
-        var a = args[i];
-        var p = a.indexOf('=');
-        if (p >= 0) args[i] = [a.substring(0,p), a.substring(p+1)];
-        else args[i] = [a, false];
-      }
-      return args;
-    })());
-
-function GetPageArg(key, def) {
-  for (var i=0; i<page_args.length; i++)
-    if (page_args[i][0] == key) return unescape(page_args[i][1]);
-  return def;
-}
-
-function MergePageArgsIntoLink(a) {
-  if (page_args.length == 0 ||
-      (!a.attributes["data-pltdoc"]) || (a.attributes["data-pltdoc"].value == ""))
-    return;
-  a.href.search(/^([^?#]*)(?:\?([^#]*))?(#.*)?$/);
-  if (RegExp.$2.length == 0) {
-    a.href = RegExp.$1 + "?" + page_query_string + RegExp.$3;
-  } else {
-    // need to merge here, precedence to arguments that exist in `a'
-    var i, j;
-    var prefix = RegExp.$1, str = RegExp.$2, suffix = RegExp.$3;
-    var args = str.split(/[&;]/);
-    for (i=0; i<args.length; i++) {
-      j = args[i].indexOf('=');
-      if (j) args[i] = args[i].substring(0,j);
-    }
-    var additions = "";
-    for (i=0; i<page_args.length; i++) {
-      var exists = false;
-      for (j=0; j<args.length; j++)
-        if (args[j] == page_args[i][0]) { exists = true; break; }
-      if (!exists) str += "&" + page_args[i][0] + "=" + page_args[i][1];
-    }
-    a.href = prefix + "?" + str + suffix;
-  }
-}
-
-// Cookies --------------------------------------------------------------------
-
-function GetCookie(key, def) {
-  var i, cookiestrs;
-  try {
-    if (document.cookie.length <= 0) return def;
-    cookiestrs = document.cookie.split(/; */);
-  } catch (e) { return def; }
-  for (i = 0; i < cookiestrs.length; i++) {
-    var cur = cookiestrs[i];
-    var eql = cur.indexOf('=');
-    if (eql >= 0 && cur.substring(0,eql) == key)
-      return unescape(cur.substring(eql+1));
-  }
-  return def;
-}
-
-function SetCookie(key, val) {
-  var d = new Date();
-  d.setTime(d.getTime()+(365*24*60*60*1000));
-  try {
-    document.cookie =
-      key + "=" + escape(val) + "; expires="+ d.toGMTString() + "; path=/";
-  } catch (e) {}
-}
-
-// note that this always stores a directory name, ending with a "/"
-function SetPLTRoot(ver, relative) {
-  var root = location.protocol + "//" + location.host
-           + NormalizePath(location.pathname.replace(/[^\/]*$/, relative));
-  SetCookie("PLT_Root."+ver, root);
-}
-
-// adding index.html works because of the above
-function GotoPLTRoot(ver, relative) {
-  var u = GetCookie("PLT_Root."+ver, null);
-  if (u == null) return true; // no cookie: use plain up link
-  // the relative path is optional, default goes to the toplevel start page
-  if (!relative) relative = "index.html";
-  location = u + relative;
-  return false;
-}
-
-// Utilities ------------------------------------------------------------------
-
-var normalize_rxs = [/\/\/+/g, /\/\.(\/|$)/, /\/[^\/]*\/\.\.(\/|$)/];
-function NormalizePath(path) {
-  var tmp, i;
-  for (i = 0; i < normalize_rxs.length; i++)
-    while ((tmp = path.replace(normalize_rxs[i], "/")) != path) path = tmp;
-  return path;
-}
-
-// `noscript' is problematic in some browsers (always renders as a
-// block), use this hack instead (does not always work!)
-// document.write("<style>mynoscript { display:none; }</style>");
-
-// Interactions ---------------------------------------------------------------
-
-function DoSearchKey(event, field, ver, top_path) {
-  var val = field.value;
-  if (event && event.keyCode == 13) {
-    var u = GetCookie("PLT_Root."+ver, null);
-    if (u == null) u = top_path; // default: go to the top path
-    u += "search/index.html?q=" + escape(val);
-    if (page_query_string) u += "&" + page_query_string;
-    location = u;
-    return false;
-  }
-  return true;
-}
-
-function TocviewToggle(glyph, id) {
-  var s = document.getElementById(id).style;
-  var expand = s.display == "none";
-  s.display = expand ? "block" : "none";
-  glyph.innerHTML = expand ? "&#9660;" : "&#9658;";
-}
-
-// Page Init ------------------------------------------------------------------
-
-// Note: could make a function that inspects and uses window.onload to chain to
-// a previous one, but this file needs to be required first anyway, since it
-// contains utilities for all other files.
-var on_load_funcs = [];
-function AddOnLoad(fun) { on_load_funcs.push(fun); }
-window.onload = function() {
-  for (var i=0; i<on_load_funcs.length; i++) on_load_funcs[i]();
-};
-
-AddOnLoad(function(){
-    var links = document.getElementsByTagName("a");
-    for (var i=0; i<links.length; i++) MergePageArgsIntoLink(links[i]);
-    var label = GetPageArg("ctxtname",false);
-    if (!label) return;
-    var indicator = document.getElementById("contextindicator");
-    if (!indicator) return;
-    indicator.innerHTML = label;
-    indicator.style.display = "block";
-  });
8' href='#n388'>388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621