Giter Site home page Giter Site logo

googlechromelabs / text-editor Goto Github PK

View Code? Open in Web Editor NEW
487.0 14.0 115.0 130 KB

A text editor build on the Native File System APIs

Home Page: https://googlechromelabs.github.io/text-editor/

License: Apache License 2.0

JavaScript 75.80% HTML 14.75% CSS 9.45%

text-editor's Introduction

HTML5 Text Editor

A simple text editor designed to experiement with and demonstrate the new File System Access APIs.

This is not an officially supported Google product.

text-editor's People

Contributors

mkruisselbrink avatar petele avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

text-editor's Issues

Add fallback support

If the Native File System APIs aren't supported, fallback to

  • <input type="file"> for opening files
  • <a download...> for saving files

Support Default App handling

Please find a way to let me associate the Text Editor with any .txt file.

Expected behaviour
Right-click and "open as" or dimply double-clicking any text file
should 1) open Text Editor
and 2) Text Editor should subsequently open the selected .txt file

Actual current behaviour
Right click open-as / double-click .txt files opens Tex Editor with an empty screen. The actual selected .txt doc does not get openend

Screenshot
image

When will this be available on mobile?

The chrome version running on android doesn't support this.
Is there an eta on when it will be or at least note this in the readme.

The current presentation suggest that it falls on legacy mode due to browser version, but that is not true. The same version on desktop supports the new file api.

Chrome on android simply does not allow this at all. When will we get the simple ability to overwrite a file we saved in a pwa?

Blog: Install

  • Analytics
  • Events for install
  • Install promotion
  • Standalone style sheet

Deployment of Native File System API code on windows is not accessible over internet

Chrome Version : 83.0.4103.106
URLs (if applicable) : http://ec2-18-223-133-52.us-east-2.compute.amazonaws.com:8080/

What steps will reproduce the problem?
(1) Download the code from https://github.com/GoogleChromeLabs/text-editor/ on the windows machine. I have used AWS machine to make it accessible over the internet.
(2) Run it on local after running gulp serve command on node.js - working fine
(3) Hit the :port url from some other machine. The page is not accessible.
http://ec2-18-223-133-52.us-east-2.compute.amazonaws.com:8080/

What is the expected result?
This gulp app website should be accessible over the internet as I have created another hello world app on Node.js which is working over the internet on another machine.

Everything is the same, I have deployed on the same machine, ports are open etc. Simple Node js website is accessible over the internet but not the code of text editor.

See this is a simple spring app also working on the same machine
http://ec2-18-223-133-52.us-east-2.compute.amazonaws.com:5000/StellarUILoginWebService-1.0-SNAPSHOT/

How did you get it not to ask for permission on already granted folder?

I have read your article on this. Thanks for that! I have tried to follow the sample but when a user selects a folder that they have already been granted access but it still asks for permission.

Simple code example -- as in your example get and set are shorthand for getting and setting values to indexDb using idb-keyval

asyn function (){
 let dirHandle = await get("directory");
 dirHandle = await window.showDirectoryPicker();
  await set("directory", dirHandle);
}

Expected results:
Every time a user picks a folder it should not ask for permission on subsequent calls even after page refresh since I am storing and retrieving dirHande from indexDb which should give me permissions already saved. I doing a page refresh for testing immediately so should not have to reverify permissions. Although I will add that check according to your article.

Thanks.
Dan

ask for filename when saving in Chrome mobile

When I save a file in Chrome mobile (Samsung Galaxy S8), I am not asked for a file or path name.
My text is always saved in Downloads/Untitled.txt

I am OK being forced to use that Downloads path, but we should be allowed to handle different files.
In other projects like excalidraw you can choose your own file name (I used its mobile Chrome demo, not their app)

As mentioned here, looks like excalidraw uses this module:
https://github.com/GoogleChromeLabs/browser-fs-access

Thanks
@abubelinha

Save or Save As shows alert with Error

When trying to 'Save' or 'Save As' , it gives an error saying
"An error occured trying to open the file."
chrome version:
Version 86.0.4240.75 (Official Build) (64-bit)

Save As causing issue

I have a file open and when I do Save As, I get: "An error occured trying to open the file." I checked console and nothing showed up there. The Save operation works fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.