17

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.

227 replies

null
    • Ninox developper
    • Jacques_TUR
    • 2 yrs ago
    • Reported - view

    exBages bug fix : I found a bug yesterday that could affect tabs that used the onUpdate event. It could lead to a display failure of the edit bar of the fields or to permission errors. The bug is fixed this morning with version 1.0.7 of exBages.

    • Alan_Cooke
    • 2 yrs ago
    • Reported - view

    Have implemented as per your email and that seems to have rectified the matter.  Thanks once more for all you hrd work for the Ninox community!!

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

    Following Alan Cooke  good idea, I added a filter box on the table view. See the result here
    Now the line "tableView:true" (line 11) must be added to window.exConfigLoadModules to access it. 

    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,
        tableView: true,      autoCloseDialog: false
    };
    </script>" + code, ["close"])

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

    Ninox has just released version 3.7.11 on the cloud. 

    Unfortunately, this version causes a bug when using the http function with only 2 or 3 parameters. Only the function with 4 parameters works correctly. 

    The result is that the hourglass loops endlessly: 

    To avoid this, use the http function with 4 parameters by putting an empty JSON in the last two parameters ( {}, {} ) like this:


    var code := http("GET", "https://raw.githubusercontent.com/JacquesTur/Ninext/main/loadModules.html", {}, {} ).result;

    I have reported the problem to Ninox and I hope they will fix it soon.

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

      Ninox developers have fixed the bug. Everything works fine now 😃

    • Alan_Cooke
    • 1 yr ago
    • Reported - view

    Once again - a big thanks to Mr TUR :-)

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

    I have added a few tools recently. I've listed them here to centralize access and prevent them from getting lost in the abundant history of this forum.

    QRCode generator :

    Allow to generate QRCode and put-it on image or file.

    Language : 

    Implementation of the muti-language user interface.

    Debug tracer :

    popup window to track debugging information.

     

    Now, to uses language and debug tracer, add this item on exConfigLoadModules :

        languages:true,
        debugTracer:true,

    This is the complete initialization code to put in the AfterOpenTrigger options:

    var code := text(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,
        tableView: true,
        languages:true,
        debugTracer:true,
    
        autoCloseDialog: false
    };
    </script>" + code, ["close"])

    note : completion and evalJS are now useless. completion has been replaced by the new script editor. evalJS is replaced by NatvieJS which is directly integrated in the Ninox script.

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

    One last thing, most of these add-ons would not have been created without your ideas and proposals. Thanks to all of you for your creativity and for sharing all these good ideas.
    And even if I don't answer every time because I don't want to put too many messages on the forum, I want you to know that I read and appreciate all your messages of support. 

      • Maurice
      • 1 yr ago
      • Reported - view

      Jacques TUR Thanks again for your work, Jacques. The functions of the Ninext project became very important for my database (esp. tabeleview). Feedback to the debugTracer: The debug-trace-icon I could see since some days even I have no initialization code. When I put debugTracer: false in the code, I can see it either. When the debug-magnifier is on besides my login-circle I can not chose anymore the overview of the views with four squares, see picture.

      Maurice

      • buy
      • 1 yr ago
      • Reported - view

      Hi Jacques TUR , there is a small issue while loading your code today (both Safari web and MacOS app : the language module seems to be unable to load 

      version 3.7.14

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

      Maurice Thanks, I'll try to fix it soon.

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

      Maurice and buy I fixed both problems in the last version.

      Thank you for your patience.

      • Maurice
      • 1 yr ago
      • Reported - view

      Jacques TUR Thanks, Jacques. In my database one of the problems is fixed (the 4-square overview works), but when I put false as parameter for debugTracer I still see see magnifier icon with the bug inside. I use Ninox on premise 3.7.7 It's not a big thing, but you should know.
      Maurice 

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

      Maurice Sorry, I forgot to answer you. 

      The icon with the magnifying glass allows to show/hide the Ninext popup window used for debugTracer and fieldsInspector. The icon is visible if you use at least one of the two options.

      This popup window is intended to receive other debugging options in the future, like the text search through all the codes of the application or a step by step debugger (that I hope to create).

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

    Following an excellent comment from Sean, I compiled the Ninext project into a single downloadable JavaScript file. I took the opportunity to do some sorting: 
    I removed The autoCompletion module which is no longer useful since the new code editor, and the EvalJS module which is now advantageously replaced by nativeJS.
    The loading code of Ninext is now the following: 

    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: false };" + getNinext() + "</script>", ["close"])

    This code has the advantage of reading 10 times faster than the previous one which loaded the files one by one. Moreover, you can save the content of the ninext.js file in one table to access it even offline. 

    Here is an example that uses the #ninextVersions table to automatically save new versions and, if GitHub access is not available, it reads the latest version from the array to use it.

    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,
    
        autoCloseDialog: false };" + getNinext() + "</script>", ["close"])

     

    This mechanism also allows you to keep the old version of Ninext and to go back when, unfortunately, an update brings more bugs than improvements. And for those who are on the Mac application (now free), it allows you to keep a couple App Ninox / Ninext that works well in case the malfunction of nient comes from an evolution of Ninox.

    The old code that loaded loadModules.html continues to work for now. It will not be maintained or updated afterwards. So I invite you to switch to the new loading code as soon as you can. Of course if you have any difficulties, I will be there to help you. You can already test the NativeJS to Forum V2 application in attachment which contains the new loading code.

    note: ninext.js, which contains the complete source code of the Ninext project, has deliberately not been minified so that you can still see what the code does. This is important for the security of your data. Moreover, it allows those who wish to debug it with the development tools of browsers.

    I wish you all a great start to the year 2023! 

    NativeJS to Forum V2.ninox

      • Fred
      • 1 yr ago
      • Reported - view

      Jacques TUR what a great next step for Ninext. 

      just thinking if there is a way that auto completion can only be loaded for ios devices since Ninox is now letting this version fall behind in features, even though they keep the same version number?

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

      Fred I'll check it out soon.

      • buy
      • 1 yr ago
      • Reported - view

      Jacques TUR what a great move, this local integration is just a great idea. I have made a test of this new implementation which is working perfectly but they're a small problem. When i click a second time on the button with the activation code, I get an empty window, twice the debug icon and and a forever wheel....I have to  go out and come back to the application. This is with Ninox 3.7.14 on Mac App (MacOS 13.1)

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

      buy Sorry for the inconvenience, it is fixed. Now, when you run Ninext again, the following message appears.

      • buy
      • 1 yr ago
      • Reported - view

      Jacques TUR it works perfectly....thank you

    • Icarus_Ralf_Becker
    • 1 yr ago
    • Reported - view

    Jacques TUR At first, thank you very much for this amazing tool. It's really great. I have one issue related to your tool I realized today.

    This error warning icons on tables are normally an on board feature of Ninox itself, but this warning only appears, when you tool is loaded. If you tool isn't loaded and I activate admin mode, it doesn't appear. 

    The problem is, that I checked all elements in the table and found no error in the scripts. 

    Do you have any idea, why this error icon is there? 

    Thank you very much.

    Best, Ralf

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

      Icarus - Ralf Becker Can you send me, in private message, your database or more information so that I can research where this phenomenon could come from?

      • Icarus_Ralf_Becker
      • 1 yr ago
      • Reported - view

      Jacques TUR I'll send you a video link via pn within the next hour.

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

      Icarus - Ralf Becker I think I have solved the problem. There were indeed compilation errors that appeared because I was compiling some scripts before resolving the global function scripts. 
      To find the origin of the errors, I created a new tab in the Ninext popup that displays the compilation errors. Tell me if this works well for your database?

      • Icarus_Ralf_Becker
      • 1 yr ago
      • Reported - view

      Jacques TUR unfortunately it doesn't work and one of the last update causes another display error now. I'll send you another videoclip. 

Content aside

  • 17 Likes
  • 19 hrs agoLast active
  • 227Replies
  • 5251Views
  • 37 Following