omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Outliner with drag/drop reordering - part 2

    Pythonista
    9
    589
    180502
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cvp
      cvp @ihf last edited by cvp

      @ihf thanks. I don't know (Ho yes, text includes a quotE) why but it is the first time that I meet

      {'text': "xxxxxxx"}
      

      in place of

      {'text': 'xxxxxxx'}
      

      In a py script, no problem, a dictionary is understood in both cases, but in my JavaScript code, I have to do it my self.

      Next version will follow today

      PS that does not explain the (old, already met) Pythonista crash

      1 Reply Last reply Reply Quote 0
      • cvp
        cvp @ihf last edited by

        @ihf new V00.03 of outline_viewer.html

        1 Reply Last reply Reply Quote 0
        • ihf
          ihf last edited by

          @cvp That fixed it!. Thank you!

          cvp 1 Reply Last reply Reply Quote 0
          • cvp
            cvp @ihf last edited by

            @ihf Finally, is this html what you wanted to replace the Mac py?

            1 Reply Last reply Reply Quote 0
            • ihf
              ihf last edited by

              @cvp I know JS is not what you want to work on, but if you are open to any enhancements to the .html file, one thing that would be nice is if it could default to the last file that was selected, rather than to have to select it each time. Or, perhaps it could open the file selection directly rather than have you click Select File which is always going to be required.

              cvp 1 Reply Last reply Reply Quote 0
              • cvp
                cvp @ihf last edited by cvp

                @ihf I don't think that html5 allows to set a default path, for security reasons. At least, I don't see how.

                Édit: I'm busy to try (actually without success) to simulate a tap on the input file selector at page load.

                I think I I'll give up. Finally, it is only to win one tap, isn' it?

                1 Reply Last reply Reply Quote 0
                • ihf
                  ihf last edited by

                  @cvp Is it also difficult to have a version which just opens a specific file (i.e., no memory of file last used and no selection). If so, I could create a few .html files wach of which would open a different outline. Not elegant but it would avoid any selection.

                  cvp 1 Reply Last reply Reply Quote 0
                  • cvp
                    cvp @ihf last edited by cvp

                    @ihf said

                    Is it also difficult to have a version which just opens a specific file

                    So far as I have already read, I think it is not authorized in html5 to access a predefined path/file.
                    But, if you find a way, I agree to incorporate it in the html.

                    1 Reply Last reply Reply Quote 0
                    • ihf
                      ihf last edited by

                      @cvp I don’t know about html5 limitations/restrictions. Perhaps it could all be done in a Python executable on the web server.

                      cvp 1 Reply Last reply Reply Quote 0
                      • cvp
                        cvp @ihf last edited by cvp

                        @ihf said:

                        Perhaps it could all be done in a Python executable on the web server.

                        Wow. what an imagination! That, if possible, seems very far of my skills. But, who knows?
                        In the mean time, what will you use: mac_outline_viewer.py or outline_viewer.html?

                        But, would you be able to configure iCloud access on the web server?

                        1 Reply Last reply Reply Quote 0
                        • ihf
                          ihf last edited by

                          @cvp I will probably use outline_viewer.html as it is accessible from any web browser that is on a machine that is logged into my iCloud account. Unless I am mistaken, the web server does not need iCloud access as you are accessing the file from the client.

                          cvp 1 Reply Last reply Reply Quote 0
                          • cvp
                            cvp @ihf last edited by cvp

                            @ihf said:

                            the web server does not need iCloud access as you are accessing the file from the client.

                            I think it needs it if the Python program runs on the web server. If you run a code on the server, it is the server which access the file, not the client, at least, I think so.

                            A solution is perhaps to modify outline.py to save at each file end (not update: end of script or new other) the outline file on the web server, via ftp, sftp, smb at your choice.
                            The .html could access these local (on the web server) files, I don't know yet how but it should be possible, either via a selection, either via a fixed path

                            cvp 1 Reply Last reply Reply Quote 0
                            • cvp
                              cvp @cvp last edited by cvp

                              @ihf sorry, I updated previous post during your connection, please read it.

                              1 Reply Last reply Reply Quote 0
                              • ihf
                                ihf last edited by

                                @cvp Sorry, I thought you were referring to the .html approach. Yes, if the viewer ran as a python script, then access to the file from the server would be needed. One problem with putting the outlines on the server that I hadn’t considered is not having any authentication for access.

                                cvp 1 Reply Last reply Reply Quote 0
                                • cvp
                                  cvp @ihf last edited by cvp

                                  @ihf you're right, it is not the right solution. Sincerely, is selecting an outline file so heavy? I had also thought to cookies but not sure it could help. I'am open to any feasible solution.

                                  Perhaps I could store the last outline file as a local cookie but if you modify the file.....
                                  But you may have max 20 x 4K bytes of cookies per site

                                  1 Reply Last reply Reply Quote 0
                                  • ihf
                                    ihf last edited by

                                    @cvp I set a due date on a line in my outline and then viewed the outline with the .html. The due date showed up but was associated with a different line (the 1st line). The dates are sorted in descending order. Also, I modified another line and the modification shows in the viewer but the update date is from a couple of days ago (probably when it was created).

                                    cvp 1 Reply Last reply Reply Quote 0
                                    • cvp
                                      cvp @ihf last edited by cvp

                                      @ihf bugs will end when I'll stop to write code 😭

                                      Could you check dates if no sort?

                                      1 Reply Last reply Reply Quote 0
                                      • ihf
                                        ihf last edited by

                                        @cvp WIth Sort=none, the dates are correctly associated with their items.

                                        1 Reply Last reply Reply Quote 0
                                        • cvp
                                          cvp last edited by cvp

                                          @ihf new V00.04 of outline_viewer.html should correct this problem of erroneously associated items after a sort

                                          1 Reply Last reply Reply Quote 0
                                          • ihf
                                            ihf last edited by

                                            @cvp Thanks! That works well.

                                            cvp 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Powered by NodeBB Forums | Contributors