Wikia


//
////////////////////////////////////////////////////////////////////////////////////////////////////
// Module: Service Desk
// This add-on replaces the content of a page named:
// * "Service Desk Front Page" (English)
// * "Service Balie Start Pagina" (Dutch)
// with a help navigator (=Service Desk Front Page) in the same language.
//
// Documentation
// http://documentalists-sandbox.wikia.com/wiki/Service_Desk
//
// Dependencies
// These files shall be included before this file is included:
// - Utilities
// - Localization
// - HTML
// - Editing Assistant
////////////////////////////////////////////////////////////////////////////////////////////////////

/***************************************************************************************************
User-defined object ServiceDeskWizard
This object replaces the content of the source editor with the predefined text, when the next page
loads and the wizard is active.
***************************************************************************************************/
function ServiceDeskWizard() {
  /*----------------------------------------------------------------------------------------------*/
  /*Publications:                                                                                 */
  this.activate = activate;
  /*----------------------------------------------------------------------------------------------*/
  function activate() {
    track.enter('ServiceDeskWizard.activate()');
    var key = 'wizard=1';
    if (document.URL.substr(document.URL.length - key.length) === key) {
      track.log('Key found');
      var textBox = document.getElementById('wpTextbox1');
      textBox.innerHTML =
        '__NOTOC__\n' +
        '<!--Ruler-------------------------------------------------------------------------------------------\n' +
        '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\n' +
        '----------------------------------------------------------------------------------------------------\n' +
        '\n' +
        '----Aantal personen-------------------------------------------------------------------------------->\n' +
        '<div style="position: relative; float: left; width: auto; "><!--\n' +
        '  --><div style="display: none;" class="if-instruction">Het aantal porties dat met dit recept\n' +
        '      gemaakt wordt.</div><!--\n' +
        '  --><span class="if-hide" style="display: inline;"><!--\n' +
        '    -->[[File:Aantal_porties.png|16px|Aantal porties]]<!--\n' +
        '  --></span><!--\n' +
        '  --><span class="if-show" style="display: none; margin: 0px 0px 0px 10px;"><!--\n' +
        '    --><img src="http://static2.wikia.nocookie.net/__cb20131208073454/recepten/nl/images/f/f3/Aantal_porties.png" alt="Aantal porties" height="16"><!--\n' +
        '  --></span><!--\n' +
        '  --><p class="if-editable" style="display: inline; width: 40px; margin: 0px 10px 0px 14px;">4</p><!--\n' +
        '--></div><!--\n' +
        '\n' +
        '<!--Bereidingstijd--------------------------------------------------------------------------------->\n' +
        '<div style="position: relative; float: left; display: inline; width: auto; "><!--\n' +
        '  --><div style="display: none;" class="if-instruction">Het aantal minuten dat de bereiding van dit\n' +
        '    gerecht duurt, inclusief eventuele voorbereidingstijd en wachttijd.</div><!--\n' +
        '  --><span class="if-hide" style="display: inline;"><!--\n' +
        '    -->[[File:Bereidingstijd.png|16px|Bereidingstijd]]<!--\n' +
        '  --></span><!--\n' +
        '  --><span class="if-show" style="display: none; margin: 0px 0px 0px 10px;"><!--\n' +
        '    --><img src="http://static1.wikia.nocookie.net/__cb20131208074019/recepten/nl/images/2/2e/Bereidingstijd.png" alt="Bereidingstijd" height="16"><!--\n' +
        '  --></span><!--\n' +
        '  --><p class="if-editable" style="display: inline; width: 40px; margin: 0px 10px 0px 14px;">20</p>minuten<!--\n' +
        '--></div><br clear="all"/><!--\n' +
        '\n' +
        '--><h2>Ingrediënten</h2>\n' +
        '<!--Ingrediënten----------------------------------------------------------------------------------->\n' +
        '<div style="width: auto; ">\n' +
        '  <div style="display: none;" class="if-instruction">Per regel één ingredient. Per ingredient de\n' +
        '    hoeveelheid, de eenheid en de naam.</div>\n' +
        '  <ul class="if-list"></ul>\n' +
        '</div>\n' +
        '\n' +
        '<h2>Voorbereiding</h2>\n' +
        '<!--Voorbereiding---------------------------------------------------------------------------------->\n' +
        '<div style="width: auto; ">\n' +
        '  <div style="display: none;" class="if-instruction">Per regel één stap. Begin elke stap met een werkwoord.</div>\n' +
        '  <ol class="if-list"></ol>\n' +
        '</div>\n' +
        '\n' +
        '<h2>Bereiding</h2>\n' +
        '<!--Bereiding-------------------------------------------------------------------------------------->\n' +
        '<div style="width: auto; ">\n' +
        '  <div style="display: none;" class="if-instruction">Per regel één stap. Begin elke stap met een werkwoord.</div>\n' +
        '  <ol class="if-list"></ol>\n' +
        '</div>\n' +
        '\n' +
        '<h2>Serveertips</h2>\n' +
        '<!--Serveertips------------------------------------------------------------------------------------>\n' +
        '<div style="width: auto; ">\n' +
        '  <div style="display: none;" class="if-instruction">Per regel één tip.</div>\n' +
        '  <ol class="if-list"></ol>\n' +
        '</div>\n' +
        '\n' +
        '<h2>Variaties</h2>\n' +
        '<!--Variaties-------------------------------------------------------------------------------------->\n' +
        '<div style="width: auto; ">\n' +
        '  <ol class="if-list"></ol>\n' +
        '</div>\n';
    }
  }
}; //ServiceDeskWizard
serviceDeskWizard = new ServiceDeskWizard;

/***************************************************************************************************
User-defined object: ServiceDeskFrontPage
***************************************************************************************************/
function ServiceDeskFrontPage() {
  track.enter('ServiceDeskFrontPage()');
  var mPath = '';
  var mNewPageName = '';
  /*------------------------------------------------------------------------------------------------
  Publications                                                                                    */
  this.activate = activate;
  this.setDocumentLocation = setDocumentLocation;
  this.setNewPageName = setNewPageName;
  this.setPath = setPath;
  /*----------------------------------------------------------------------------------------------*/
  function activate() {
    track.enter('ServiceDeskFrontPage::activate()');
    var enPageName = 'Service_Desk_Front_Page';
    var nlPageName = 'Service_Balie_Start_Pagina';
    var url = document.URL;
    if (
      (url.substr(url.length - enPageName.length) == enPageName) ||
      (url.substr(url.length - nlPageName.length) == nlPageName)
    ) {
      track.log('URL matches.');
      var content = document.getElementById('mw-content-text');
      content.innerHTML = '<div>' + getHTML() + '</div>';
      if (mPath === '1.') {
        document.getElementById('What shall be the name of the new page?').focus();
      }
    }
    track.leave('ServiceDeskFrontPage::activate()');
  }
  /*------------------------------------------------------------------------------------------------
  In this function the controls have a postfix number of 2 or 3 digits. The first 2 digit is the
  row, the second, if present, the column index of this control in the table. Example button032
  is a button that will be displayed on the second column of the third row in the table.          */
  function getHTML() {
    track.enter('getHTML()');
    track.log('mPath: "' + mPath + '"');
    /*Common part for all paths.------------------------------------------------------------------*/
    var HTML = '<!--Style attributes are used to get control over the style used. A cascading sty' +
      'lesheet that defines a style for a class of elements wasn\'t good enough.-->\n';
    var p01 = P(localization.translate('Welcome to the Service Desk.\n'));
    var tr01 = tr(td(3, p01));
    var p02 = P(localization.translate('This is the place to ask for help from other members of t' +
      'his wiki\'s community.\n'));
    var tr02 = tr(td(3, p02));
    var p03 = P(localization.translate('To create a new Service Request, answer these questions.\n')
      );
    var tr03 = tr(td(3, p03));
    var tr04 = tr(td(3, ''));
    var tr05 = tr(th(325, localization.translate('Questions')) + th(250, localization.translate(
      'Answers')) + th(75, ' '));
    var p061 = P(localization.translate('What can we do for you?'));
    if (mPath == '') {
      var p062 = P(localization.translate('☐ Create a new recipe page.'));
      var td062 = '<td colspan="1" onclick="serviceDeskFrontPage.setPath("1.")" style="' +
        'height: 22px; margin: 0; border: 0px solid red; padding: 0; font-size: 14; line_height: ' +
        '22px; cursor: pointer; ">' + p062 + '</td>';
      var tr06 = tr(td(1, p061) + td062 + td(1, ''));
      var p072 = P(localization.translate('☐ Something else.'));
      var td072 = '<td colspan="1" onclick="serviceDeskFrontPage.setPath("2.")" style="' +
        'height: 22px; margin: 0; border: 0px solid red; padding: 0; font-size: 14; line_height: ' +
        '22px; cursor: pointer; ">' + p072 + '</td>';
      var tr07 = tr(td(1, '') + td072 + td(1, ''));
      HTML += Table(tr01 + tr02 + tr03 + tr04 + tr05 + tr06 + tr07);
      return HTML;
    }
    /*Branch: 1."Create a new recipe page."-------------------------------------------------------*/
    if (mPath.substr(0,2) == '1.') {
      var p062 = P(localization.translate('☑ Create a new recipe page.'));
      var button063 = Button('serviceDeskFrontPage.setPath("")', '<div style="position: relative; float: lef' +
        't; "><img src="http://static1.wikia.nocookie.net/recepten/nl/images/5/57/Transparent_pen' +
        'cil.png"/></div>' + localization.translate(' Edit'));
      var tr06 = tr(td(1, p061) + td(1, p062) + td(1, button063));
      var p071 = P(localization.translate('What shall be the name of the new page?'));
      if (mPath == '1.') {
        var i072 = InputText('What shall be the name of the new page?', mNewPageName);
        var button073 = Button('serviceDeskFrontPage.setNewPageName()', localization.translate('OK'));
        var tr07 = tr(td(1, p071) + td(1, i072) + td(1, button073));
        HTML += Table(tr01 + tr02 + tr03 + tr04 + tr05 + tr06 + tr07);
        return HTML;
      }
      var p072 = P(mNewPageName);
      var button073 = Button('serviceDeskFrontPage.setPath("1.")', '<div style="position: relative; float: l' +
        'eft; "><img src="http://static1.wikia.nocookie.net/recepten/nl/images/5/57/Transparent_p' +
        'encil.png"/></div>' + localization.translate(' Edit'));
      var tr07 = tr(td(1, p071) + td(1, p072) + td(1, button073));
      var h08 = localization.translate('<h2>Dispatch</h2>\n');
      var tr08 = tr(td(3, h08));
      var p091 = P(localization.translate('Your request will be handled by the Service Desk Wizar' +
        'd. If you click the OK-button, this page will close and you\'ll land on the newly create' +
        'd page.'));
      var button093 = Button('serviceDeskFrontPage.setDocumentLocation("http://recepten.wiki' +
        'a.com/wiki/' + mNewPageName + '?action=edit&redlink=1&wizard=1")', localization.translate('OK')
        );
      var tr09 = tr(td(2, p091) + td(1, button093));
      var p10 = P(localization.translate('Thank you for using the Service Desk Front Page.'));
      var tr10 = tr(td(3, p10));
      HTML += Table(tr01 + tr02 + tr03 + tr04 + tr05 + tr06 + tr07 + tr08 + tr09 + tr10);
      return HTML;
    }
    /*Branch: 2."Something else."-----------------------------------------------------------------*/
    if (mPath.substr(0,2) == "2.") {
      var p062 = P(localization.translate('☑ Something else.'));
      var button063 = Button('serviceDeskFrontPage.setPath("")', '<div style=\"position' +
        ': relative; float: left; \"><img src=\"http://static1.wikia.nocookie.net/recepten/nl/ima' +
        'ges/5/57/Transparent_pencil.png\"/></div> ' + localization.translate('Edit'));
      var tr06 = tr(td(1, p061) + td(1, p062) + td(1, button063));
      var h07 = "<h2>" + localization.translate('Dispatch') + '</h2>\n';
      var tr07 = tr(td(3, h07));
      var p081 = P(localization.translate('The Board: "Service Balie, overige vragen" is the best ' +
        'spot to file your request. If you click the OK-button, this page will close and you\'ll ' +
        'land at that board. To file your request there, start a discussion.'));
      var button083 = Button('document.location="http://recepten.wikia.com/wiki/Board:Service_Balie,_overige_vragen"', localization.translate('OK'));
      var tr08 = tr(td(2, p081) + td(1, button083));
      var p09 = P(localization.translate('Thank you for using the Service Desk Front Page.'));
      var tr09 = tr(td(3, p09));
      HTML += Table(tr01 + tr02 + tr03 + tr04 + tr05 + tr06 + tr07 + tr08 + tr09);
      return HTML;
    }
  }
  /*----------------------------------------------------------------------------------------------*/
  function setDocumentLocation(url) {
    track.enter('ServiceDeskFrontPage::setDocumentLocation(URL: "' + url + '")');
    document.location = url;
  }
  /*----------------------------------------------------------------------------------------------*/
  function setNewPageName() {
    track.enter('ServiceDeskFrontPage::setNewPageName()');
    var input = document.getElementById('What shall be the name of the new page?');
    mNewPageName = input.value;
    mPath = '1.1.';
    activate();
    track.leave('ServiceDeskFrontPage::setNewPageName()');
  }
  /*----------------------------------------------------------------------------------------------*/
  function setPath(path) {
    mPath = path;
    activate();
  }
  track.leave('ServiceDeskFrontPage()');
}; //ServiceDeskFrontPage
var serviceDeskFrontPage = new ServiceDeskFrontPage();
includer.moduleIncluded(1);
//

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Around Wikia's network

Random Wiki