context-help.js 1.1 KB

12345678910111213141516171819202122232425
  1. define(["require", "util"], function (require, util) {
  2. $(document).ready(function () {
  3. // If we have a contextID, we must to redirect to the corresponding topic
  4. var contextId = util.getParameter('contextId');
  5. var appname = util.getParameter('appname');
  6. if (contextId != undefined && contextId != "") {
  7. require(["context-help-map"], function (helpContext) {
  8. if (helpContext != undefined) {
  9. for (var i = 0; i < helpContext.length; i++) {
  10. var ctxt = helpContext[i];
  11. if (contextId == ctxt["appid"] && (appname == undefined || appname == ctxt["appname"])) {
  12. var path = ctxt["path"];
  13. if (path != undefined) {
  14. var anchor = window.location.hash;
  15. window.location = path + anchor;
  16. }
  17. break;
  18. }
  19. }
  20. }
  21. });
  22. }
  23. });
  24. });