Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancements by @wkraft-fablabka #208

Merged
merged 1 commit into from
Aug 18, 2017
Merged

Enhancements by @wkraft-fablabka #208

merged 1 commit into from
Aug 18, 2017

Conversation

me-no-dev
Copy link
Owner

  • Added "SAVE-Button
  • Upgraded to ACE 1.2.6
  • Added additional field, which shows name of the current edited File
  • Reset upload path after uploading or creating a File (avoid confusion about which file is shown in editor)
  • added the possibility, to run the editor completly from flash. When ace.js.gz or ace.js and the corresponding files are found on SPIFFS, the editor can be used in AP mode also. Otherwise the files are searched on cloudflare like before.
  • added all gzipped js-files in data directory
  • added an exclude list, containing wildcards, telling which files should not be listed in the editor (to prevent deletion of needed files)
  • minified the embedded HTML/Javascript with https://kangax.github.io/html-minifier/ before gzipping. With all additions the resulting hex-code is now 700 bytes smaller
  • embedded the plain html as documentation

- Added "SAVE-Button
- Upgraded to ACE 1.2.6
- Added additional field, which shows name of the current edited File
- Reset upload path after uploading or creating a File (avoid confusion about which file is shown in editor)
- added the possibility, to run the editor completly from flash. When ace.js.gz or ace.js and the corresponding files are found on SPIFFS, the editor can be used in AP mode also.  Otherwise the files are searched on cloudflare like before.
- added all gzipped js-files in data directory
- added an exclude list, containing wildcards, telling which files should not be listed in the editor (to prevent deletion of needed files)
- minified the embedded HTML/Javascript with https://kangax.github.io/html-minifier/ before gzipping.  With all additions the resulting hex-code is now 700 bytes smaller
- embedded the plain html as documentation
@me-no-dev me-no-dev merged commit 2540507 into master Aug 18, 2017
@me-no-dev me-no-dev deleted the pr/139 branch August 18, 2017 17:14
@hallard
Copy link
Contributor

hallard commented Aug 28, 2017

"added the possibility, to run the editor completly from flash. When ace.js.gz or ace.js and the corresponding files are found on SPIFFS, the editor can be used in AP mode also. Otherwise the files are searched on cloudflare like before"

This is a great feature, but I think, it should be done the reverse way, IE if ace source found on Internet (client has internet connection) download from Internet, if ace source not found (mainly client connected on ESP AP) then load from flash, because the way it's implemented today if files are on flash all is loaded from flash.

may be

<script id='ace' src="/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
  if  (typeof ace.edit == "undefined") {
    var script = document.createElement('script');
    script.src = "https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.6/ace.js";
    script.async = false;
    document.head.appendChild(script);
  }
</script>

should be

<script id='ace' src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.6/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
  if  (typeof ace.edit == "undefined") {
    var script = document.createElement('script');
    script.src = "/ace.js";
    script.async = false;
    document.head.appendChild(script);
  }
</script>

Doing this change, enable back editing of json files working again (because you can't have all language syntax editing profile on flash) but from internet it's okay
From Internet
image

From Flash with missing mode-json.js
image

I let you decide what's the best implementation, but anyway, it's a really nice improvement ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants