GureWiki > Ezagutza partekatzen / Compartiendo conocimiento
GureWiki: "Ezagutza partekatzen / Compartiendo conocimiento"
Template:@himikel > PageFooter
    Aurkibidea
    Goibururik ez

    This template shows the page footer with InteractiveComments section

    Paramters: Page, Theme

    var mPars = {     
      mPage: (__request.args.page ? string.deserialize(__request.args.page) : null ) ?? args.page ?? page,
      slLang: ((__request.args.lang) ? ((__request.args.lang is list) ? __request.args.lang : [__request.args.lang]) : null) ??
              ((args.lang) ? ((args.lang is list) ? args.lang : [args.lang]) : null) ??
              null,
      sTheme: __request.args.theme ?? args.theme ?? null
    };
    //Set CoDoer paths
    //var sCoDoerPath=":MindTouch/CoDoer/";
    //var sCoDoerWdtPath=sCoDoerPath.."Widgets/CoDoer-4/";
    //var sCoDoerVerSfx="-CoDoer-4";
    var sCoDoerPath="User:CoDoer/";
    var sCoDoerWdtPath=sCoDoerPath.."Widgets/";
    var sCoDoerVerSfx="";
    //Get Language(s)
    var sLang=null;
    var slLang=null;
    var smDesc=mPars.smDesc;
    if (mPars.slLang==null) {
      let sLang=String.ToLower(mPars.mPage.language);
      if (sLang not in ["en","es","eu"])
        let sLang='en';  //by default
      let slLang= [sLang];
      let smDesc..={ (sLang) : smDesc["__"] };
    }//if
    else {
      //@himikel #mod 2011-02-02: Set Main Language
      var nMainLang=0;
      foreach (var sLang in mPars.slLang)
      {
        if (String.StartsWith(sLang,"*"))
        {
          let nMainLang=__index;
          let sLang=String.SubStr(sLang,1);
        }//if
        if (sLang not in ["en","es","eu"])
          let sLang='en';  //by default
        if (sLang not in slLang)
          let slLang..= [sLang];    
      }
      let sLang=slLang[nMainLang]; //set main language
    }//el
    //Web.Pre(Json.Format(smDesc));
    //Web.Text("Lang: '"..sLang.."'");
    //Web.Pre(Json.Format(slLang));
    
    //Set Main Theme
    var smLangThemes= { en: "pink", es: "orange", eu: "green" };
    var sTheme= (mPars.sTheme ? String.ToLower(mPars.sTheme) : null) ?? smLangThemes[sLang] ?? "white";
    //Web.Pre(Json.Format(sTheme));
    
    //Set Theme Colors
    var sLgtCol,sDrkCol;
    var smLgtCol= { pink: "rgb(255, 204, 255)", orange: "rgb(255, 204, 153)", green: "rgb(204, 255, 204)", white: "white" };
    var smDrkCol= { pink: "rgb(204, 153, 255)", orange: "rgb(255, 153, 0)", green: "rgb(51, 153, 102)", white: "white" };
    var sLgtCol=smLgtCol[sTheme];
    var sDrkCol=smDrkCol[sTheme];
    
    //Prepare Interactive Comments: Interactive Discussion
    var smIntComSect={
      en: "Interactive discussion",
      es: "Discusión interactiva",
      eu: "Eztabaida interaktiboa"
    };
    var smIntComNote={
      en: "Use @user to publish it on his/her wall immediately",
      es: "Utilice @usuario para publicarlo en su muro inmediatamente",
      eu: "@erabiltzailea erabili bere horman zuzenean zabaldu nahi baduzu"
    };
    
    var sIntComSect=smIntComSect[sLang];
    var sIntComNote=smIntComNote[sLang];
    
    //Put Interactive Comments Section
    var sIntComHeader="<h3 class='editable'><span><span style='background-color: "..sDrkCol..";'>:)</span><span> "..sIntComSect.."</span></span></h3>";
    Web.Html(sIntComHeader);
    
    //Compose Multilanguage Note
    var sIntComNote="";
    foreach (var sLang1 in slLang)
    {
      var sTheme1= (mPars.sTheme ? String.ToLower(mPars.sTheme) : null) ?? smLangThemes[sLang1] ?? "white";  
      var sLgtCol1=smLgtCol[sTheme1];
      let sIntComNote..="<p><span style='background-color: "..sLgtCol1..";'>&nbsp;"..smIntComNote[sLang1].."&nbsp;</span></p>";
    }
    Web.Html(sIntComNote);
    //Run Interactive Comments
    
    //Using CoDoer #4 & GigyaSocialize
    Wiki.Template(sCoDoerPath.."Engines/Activator",{
      action: "Run",
      widget: sCoDoerWdtPath.."GigyaSocialize"..sCoDoerVerSfx..":0",
      engine: "#4",
      id: "gsoc",
      page: page,
      language: sLang,
      logging: {evt:0,par:0,wdt:0,ctr:0}
    });
    Wiki.Template(sCoDoerPath.."Engines/Activator",{
      action: "Run",
      widget: sCoDoerWdtPath.."InteractiveComments"..sCoDoerVerSfx..":0",
      engine: "#4",
      page: page,
      //page: Wiki.GetPage(String.Replace(Page.TalkUri,"http://"..Site.HostName,"")),
      id: "icom",
      language: sLang,
      logging: {evt:0,par:0,wdt:0,ctr:0}
    });
    
     
    

    Webgune hau MindTouch Core "DekiWiki" software askearekin dabil

    Hemengo edukiak Creative Commons BY-NC-SA baimen baten mende daude