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

More modern and secure improved spreadsheets and improved presentations app(both are still under 1kb) #38

Closed
wants to merge 7 commits into from

Conversation

Gurbuzguven
Copy link

@Gurbuzguven Gurbuzguven commented Apr 3, 2021

Presentation App(Don't let the size mislead you, just try it.This app had potential before and it has become very usable app now)

Total Size:841 bytes

data:text/html;charset=utf-8,<table id=t><script>o=(a,b)=>b=JSON.parse(a);for(I=[],D={},C={},q=_=>I.forEach(e=>{e.innerText=D[e.id]}),i=0;i<151;i++)for(r=t.insertRow(-1),j=0;j<27;j++)c=String.fromCharCode(64+j),d=r.insertCell(-1),d.innerText=i?j?'':i:c,l=t.rows[0].cells[0],l.innerText='💾',l.onclick=e=>(k=prompt('📂',JSON.stringify(C)),k&&(C=o(k,C),q())),i*j&&I.push(d.appendChild(((x,f)=>(f.id=x,f.tabIndex=j,f.contentEditable=!0,f.onfocus=e=>f.innerText=C[x]||'',f.onblur=e=>{C[x]=f.innerText,q()},get=_=>{v=C[x];!v?.trim()?v='':v;if('='!=v[0])return isNaN(v)|v==''?v:~~v;with(D)return eval(v.toUpperCase().slice(1))},a={get},Object.defineProperty(D,x,a),f))(c+i,document.createElement`p`)))</script><style>td{box-shadow:0 0 1q}p{cursor:cell;min-width:70}tr:hover{background:beige}:is(tr,td):first-child{background:tan;text-align:center}td:hover{background:peru}

Bug Fixes(Which original program has):

  • Newer versions of Chrome and Firefox can't load the original app properly when using data:text/html version.In this version this problem has been fixed.
  • Fixed a bug also original program has, which it doesn't show any entry on blur starting with number(eg. "1234 avenue")
  • (Security Update)You can no longer run any (harmful or not)javascript from cells itself(eg."=alert(a1)","=for (;;) {}"), but you may still use formulas normally.

Added functions:

  • Save/Load Function(Thanks @doekman for that.)
  • Resizable table areas(Both horizontal and vertical.)
  • Modern looking UI(Active cell highlighting, cursors, graphical save button etc.)
  • Press Tab or Shift+Tab to go down and up a row.
  • UTF-8 Support.

It is more usable now since it can save and load files, doesn't have eval security bug and supports resizing of the tables.

Spreadsheets app(Bugfix and a new function)

Total Size:641 Bytes

data:text/html,<body><script>d=document;function a(){for(s=prompt('Slide amount?')|1,i=0;i<s;i++)d.body.innerHTML+='<div style=border:double;position:relative;padding:28%;margin:5%;page-break-after:always><div contenteditable style=position:absolute;outline:0;overflow:auto;inset:8%;font-size:2em><a accesskey=n onclick=a()>'}a();d.querySelectorAll('div>div').forEach(e=>e.onkeydown=e=>{n=e.ctrlKey&&e.altKey&&e.keyCode-49,f='formatBlock',j='justify',x=[f,f,j+'Left',j+'Center',j+'Right','outdent','indent','insertUnorderedList'][n],y=['<h1>','<div>'][n],x&&d.execCommand(x,!1,y)})</script><style>@media print{@page{size:A4 landscape}*{border:0!important}}

Bug Fixes(Which original program has):

  • Fixed a problem where editable text overflow from slide page.

New Features:

  • Ask you how many slides you want at opening, you can also add slides later.

Keyboard Shortcuts for this version:

  • Ctrl+Alt+1: Header
  • Ctrl+Alt+2: Normal style
  • Ctrl+Alt+3: Align left
  • Ctrl+Alt+4: Align center
  • Ctrl+Alt+5: Align right
  • Ctrl+Alt+6: Outdent
  • Ctrl+Alt+7: Indent
  • Ctrl+Alt+8: Make a list
  • (Chrome,Edge etc.)Alt+N, (Firefox)Alt+Shift+N, (Mac)Ctrl+Alt+N: New Slide

Hope it will help

closes: #37
closes: #5

@Gurbuzguven Gurbuzguven changed the title More modern and secure improved spreadsheets app(still under 1kb) More modern and secure improved spreadsheets and improved presentations app(both are still under 1kb) Apr 4, 2021
@Gurbuzguven Gurbuzguven closed this Aug 8, 2021
@Snowflake6
Copy link

The code for the Spreadsheets app and the Presentation app are swapped.

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.

PR:(Includes Security Update)New improved spreadsheets app Suggestion for Spreadsheet Bookmarklet
2 participants