15

Ninext project

good evening to all, 

I create this post to organize the Ninext project. For those who are new to it, it is composed of several JavaScript modules that allow you to add badges on tabs and buttons, catch selection events on views, execute JavaScript from Ninox script, inspect dependencies between database fields.

This post is here to talk about the project and the procedure for those who would like to implement it in your databases. I would like to take this opportunity to remind you that this is a test project that evolves regularly and I invite you to be cautious and not to use it on commercial databases for the moment.

The sources of the project are available and downloadable on Github
Thanks to all of you for all your messages of support and for your help to debug and make the project progress a little more every day 🙏.

I made the project initiation procedure evolve thanks to the precious help of M. Daaboul who told me that we could use the Ninox dialog box with HTML code. It is no longer necessary to create a window and an HTML field for this. You just have to copy the code below in the Trigger after open in the Options

 

var code := http("GET", "https://raw.githubusercontent.com/JacquesTur/Ninext/main/loadModules.html").result;
dialog("Ninext intialization", "<script>
window.exConfigLoadModules = {
    completion: false,
    badges: true,
    evalJS: true,
    viewEvent: true,
    buttonEvent : true,
    fieldsInspector: true,
    nativeJS: true,

    autoCloseDialog: true
};
</script>" + code, ["close"])

The dialog box will be displayed stealthily then disappear. If you want it to stay displayed with its "close" button, set the autoCloseDialog parameter to false.

173 replies

null
    • Fred
    • 1 yr ago
    • Reported - view

    Just installed the new JS version and saw how quick it was to load:

    Though there is a bit of a spelling error. :)

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Fred Thank you very much. I am not very good in English and it helps me a lot to improve when I am shown the mistakes I make 👍. It is corrected.

    • Icarus_Ralf_Becker
    • 1 yr ago
    • Reported - view

    Jacques TUR and I found, from my point of view, a new but little usability bug.

    After each change in the script, maybe the use of a certain variable (IMG 1), the dropdown of the table jumps back to the default or the first table in the database (IMG 2). So, to continue with the next step, you need to select the table and the variable again and again. In the former version your tool keeps the selected table and variable after each script change or saving. This saves a lot of time. Thanks.

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Icarus - Ralf Becker Thank you very much for reporting this problem. Indeed I had modified this part of the code because I had a similar problem in the fields edition window. The filter was removed after editing one of the fields of the table. 

      All this is now fixed with version 2.0.1.

    • Ninox developper
    • Jacques_TUR
    • 1 yr ago
    • Reported - view

    I just added a tab in the Ninext popup that displays all the compilation errors that may exist in the database. 

    Ninox does not necessarily display all compilation errors. So you may be surprised to find errors that didn't appear until now. 

    To activate the error list, add the line "errorViewer : true" in the Ninext initialization parameters (line 34 below): 

    function getNinext() do
        "// load the last locale version";
        var rec := last(select '#NinextVersions');
        "// load the last GitHub version";
        var res := http("GET", "https://raw.githubusercontent.com/JacquesTur/Ninext/main/dist/ninext.js", {}, {});
        "// extract code and version number from GitHub result";
        var vCode := text(res.result);
        var vVersion := extractx(vCode, "(?:var exModulesVersion = ')(.*)(')", "", "$1");
        "// in case of GitHub is not avaible, return local version";
        if res.error then
            vCode := rec.version
        else
            "// else, if GitHub version is newer, save GitHub result in local table";
            if vVersion != rec.version then
                var newRec := (create '#NinextVersions');
                newRec.(version := vVersion);
                newRec.(code := vCode)
            end
        end;
        "// return the more resently disponible code";
        vCode
    end;
    dialog("Ninext intialization", "<div style='white-space: normal;' ; id='exLoadModule'></div>
        <script>
    window.exConfigLoadModules = {
        badges: true,
        viewEvent: true,
        buttonEvent : true,
        fieldsInspector: true,
        nativeJS: true,
        tableView: true,
        debugTracer : true,
        languages : true,
        errorsViewer : true,
    
        autoCloseDialog: false
    };" + getNinext() + "</script>", ["close"])
    • Ninox developper
    • Jacques_TUR
    • 1 yr ago
    • Reported - view

    I have improved the user interface of the error viewer a little. It is now possible to directly access the formulas in error by using the key button  :

    FieldsInspector has also been improved so that cascading links are better visible and delimited:

     And if a dependent formula has an error, it is displayed with the same design as in errorsViewer.

    I also added a transparency effect when the mouse is outside the window, so that the popup hides the Ninox window as little as possible. Don't hesitate to tell me if you find it practical or not.

      • Fred
      • 1 yr ago
      • Reported - view

      Jacques TUR The transparency for the popup window was something that I was just thinking about as I do some cleanup of my DB. Thanks for reading my mind.

    • Fred
    • 1 yr ago
    • Reported - view

    Hi Jacques TUR

    I’ve started a cloud account and am using my iPad to manage my db and noticed that I can’t move the pop up window. I tried press+hold on the upper left corner and I can’t move the window.

    I don’t know if iOS is an important development platform, but if does make your radar then you can add this to your list.

    Thanks for all your hard work.

    • Icarus_Ralf_Becker
    • 1 yr ago
    • Reported - view

    Jacques TUR I still have the problem, that your tool causes this "double displaying" of form content, if the first record in an empty table is created. If you delete this record and do it again, the form is displayed correctly. Until you leave the database, open it again and create a first record again. Could you check that please? Thank you very much.

      • Alan_Cooke
      • 1 yr ago
      • Reported - view

      Icarus - Ralf Becker I have the same issue.  My home screen show everything doubled.  The only cure is to click a different view and come back to the main view.  Not every time by the way just now and again.

      • Alan_Cooke
      • 1 yr ago
      • Reported - view

      Alan Cooke Managed to get the duplication so here is a screenshot

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Alan Cooke and Icarus - Ralf Becker 

      I can't seem to reproduce this mistake. Can you tell me more? 
      - Do you use events or Ninext functions on these windows? 
      - Which modules did you load? 
      - If you delete modules (one by one), when does it work? 
      - Are there any error messages in the browser development console?

      Thanks in advance for your help

      • Icarus_Ralf_Becker
      • 1 yr ago
      • Reported - view

      Jacques TUR I load Ninext in the global onOpen-Trigger with this script#

      dialog("Ninext intialization", "<div style='white-space: normal;' ; id='exLoadModule'></div>
          <script>
      window.exConfigLoadModules = {
          badges: true,
          viewEvent: true,
          buttonEvent : true,
          fieldsInspector: true,
          nativeJS: true,
          tableView: true,
          debugTracer : true,
          languages : true,
          errorsViewer : true,
      
          autoCloseDialog: false
      };" + getNinext() + "</script>", ["close"])
      

      So, yes, I use Ninext functions in this table. I deactivated the modules one by one. It looks like, that the badges module is the source, because the display error doesn't appear with "badges: false,".

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Icarus - Ralf Becker 

      I still can't reproduce the problem.  On your side, can you reproduce it on a new database?

       if it is possible, can you share me a database with the default?  I'm sending you my email address for that.

       Does anyone else have this same duplicate display issue?

      • Icarus_Ralf_Becker
      • 1 yr ago
      • Reported - view

      Jacques TUR please understand, that I would like to try all methods to solve the problem before sharing this database. So I investigate deeper an found something, that maybe helps you.

      In the first tab "Loadplanung" I have a script in the "before load" trigger. It's a customize version of an dialog popup called by this global function:

      "
      / erzeugt eine Hinweismeldung mit Icon und Ton /";
      function custom_alert(report : text) do
          let t := report;
          let i := "<a href='' target='_new'><img height='80px' img src='https://icarus-manifest.de/manifest-data/alert.png' /></a>";
          let s := "<audio autoplay><source src='https://icarus-manifest.de/manifest-data/sound-alert.mp3' type='audio/mpeg'>";
          i := replace(i, "'", """");
          s := replace(s, "'", """");
          let e := "<center>" + i + "
      " + t + "
      " + if first(select Einstellungen).'Warnhinweise ohne Ton' = true then
                  ""
              else
                  s
              end;
          dialog("Achtung", e, ["OK"]);
          void
      end;

      If I delete this script in the trigger, the problem is gone.Alan Cooke can you confirm a similar situation as a possible cause of your duplicate form?

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Icarus - Ralf Becker It's okay, I can now reproduce the problem. I will be able to fix it.

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Jacques TUR The first initialization of Badge could cause this double display phenomenon if a code was executed in the current tab. 

      I can fix this bug and cekla allowed me to discover two others at the same time that I also fixed:

      - The automatic closing of the dialog could close another dialog if it was opened before Ninext was launched.

      - If the user was not an administrator, the debugger button could not be loaded. This caused an error that stopped the initialization of Ninext and left the popup displayed on the screen. Now the button is hidden when the user is not an admin.

      Version 2.0.5 is now online. 

      • Alan_Cooke
      • 1 yr ago
      • Reported - view

      Jacques TUR I now have this - I have to manually close.  I have made no changes my side.

       

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Alan Cooke Could you send me your initialization code ?

      • Alan_Cooke
      • 1 yr ago
      • Reported - view

      Jacques TUR I also seem to no longer have this working

      function onUpdate(event : any) do
          {
              caption: "KIT INPUT",
              color: "#fcfcfc",
              backgroundColor: "#5986f7",
              tooltip: "Click this TAB to add kit or to edit existing equipment. 📝",
              badge: {
                  caption: "",
                  color: "#b0c4f7",
                  backgroundColor: "#ff3333"
              }
          }
      end;

    • Alan_Cooke
    • 1 yr ago
    • Reported - view

    function getNinext() do
        var res := http("GET", "https://raw.githubusercontent.com/JacquesTur/Ninext/main/dist/ninext.js", {}, {});
        var version := extractx(text(res.result), "(?:var exModulesVersion = ')(.*)(')", "", "$1");
        res.result
    end;
    dialog("Ninext intialization", "<div style='white-space: normal;' ; id='exLoadModule'></div>
        <script>
    window.exConfigLoadModules = {
        badges: true,
        viewEvent: true,
        buttonEvent : true,
        fieldsInspector: true,
        nativeJS: true,
        tableView: true,
        debugTracer : true,
        languages : true,      autoCloseDialog: true };" + getNinext() + "</script>", ["close"]);
    openTable("HOME", "HOME")

      • Alan_Cooke
      • 1 yr ago
      • Reported - view

      Alan Cooke Tried placing my openTable at the top - first line - makes no difference

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Alan Cooke Indeed, a small error had slipped in my update. It should work now. Keep me informed.

      v2.0.6 is online

    • Alan_Cooke
    • 1 yr ago
    • Reported - view

     

    Still there it seems.  Doubt it matters but in the Badges line above you have betas not beta

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Alan Cooke I put your code in a blank database and it works fine on the cloud and the Mac app. What happens if you do this on your computer?

Content aside

  • 15 Likes
  • 3 wk agoLast active
  • 173Replies
  • 4096Views
  • 33 Following