Cloud Age CMS. Implementation example
We continue the discussion about CMS, which is written in Javascript, works completely in the browser and saves to the cloud. The theory was in a previous article , and now practice. Let's make the simplest system for static sites - just three buttons and a hundred lines in JS.
TK:
Interface:

The only problem that stands in our way is access to the Selectel repository from the browser via XmlHttpRequest, bypassing the same-origin policy.
The Selectel repository itself supports CORS, but auth.selcdn.ru authorization point cannot boast of this. Ambush! It is necessary to proxy the request through some server. The ingenious and underestimated craft of Yahoo Tables comes to the rescue . Our “table” will send an authorization request through the Yahoo server and, if successful, return the key to the store.
In the words of Yahoo Query Language (YQL), everything is elementary:
The traffic goes over https, therefore it will pass for secure authorization. I trust Marissa and the NSA.
CMS code can live anywhere - for example, as a bookmarklet or as a browser extension. I put it in the same Selectel. Now, to “install” CMS on a site, it’s enough to upload an html page to it with a link to our 100-line Javascript. What is not SaaS?
So to summarize.
Our technology stack has been tousled to disgrace: HTML and jQuery on the front end, Selectel repository and Yahoo Tables - the backend. If auth.selcdn.ru starts supporting CORS, then you can get rid of the latter.
Interface: three buttons of the main menu and CKEditor. You can live.
CMS code is available at: cms.svsite.com/sv.js
Demo: demo.svsite.com/admin.html3341_democms / VdmXrmKpZe
Important! Who last saved - that and slippers. Updates are not always visible immediately (CDN cache). All functions are available in the demo, so it will work until someone breaks it.
PS.
1. This is proof of concept.
2. The code is open - send a patch or shut up.
3. Thanks yuhenobi for the story about Selectel Storage.
TK:
- Website hosting - cloud storage with the ability to bind your own domain to the container. Anyone who has an HTTP API for managing files is suitable for us: Amazon S3, Openstack Swift providers, or free GitHub Pages. In my case, it will be a Selectel cloud , because I already have an account there.
- Visual "in-place" editing is when the administrator can edit any element directly on the site page. The parts of the page that can be edited, we will mark in a special CSS class ("sv").
- The editing mode of the source code of the HTML page - in case the WYSIWYG editor fails, or if you need to change the design of the entire page.
Interface:

The only problem that stands in our way is access to the Selectel repository from the browser via XmlHttpRequest, bypassing the same-origin policy.
The Selectel repository itself supports CORS, but auth.selcdn.ru authorization point cannot boast of this. Ambush! It is necessary to proxy the request through some server. The ingenious and underestimated craft of Yahoo Tables comes to the rescue . Our “table” will send an authorization request through the Yahoo server and, if successful, return the key to the store.
In the words of Yahoo Query Language (YQL), everything is elementary:
USE 'http://cms.svsite.com/auth.selectel.xml' AS auth; /* подключили таблицу */
SELECT * FROM auth WHERE url='https://auth.selcdn.ru' AND user='пользователь' AND key='пароль';
The traffic goes over https, therefore it will pass for secure authorization. I trust Marissa and the NSA.
CMS code can live anywhere - for example, as a bookmarklet or as a browser extension. I put it in the same Selectel. Now, to “install” CMS on a site, it’s enough to upload an html page to it with a link to our 100-line Javascript. What is not SaaS?
So to summarize.
Our technology stack has been tousled to disgrace: HTML and jQuery on the front end, Selectel repository and Yahoo Tables - the backend. If auth.selcdn.ru starts supporting CORS, then you can get rid of the latter.
Interface: three buttons of the main menu and CKEditor. You can live.
CMS code is available at: cms.svsite.com/sv.js
Demo: demo.svsite.com/admin.html3341_democms / VdmXrmKpZe
Important! Who last saved - that and slippers. Updates are not always visible immediately (CDN cache). All functions are available in the demo, so it will work until someone breaks it.
PS.
1. This is proof of concept.
2. The code is open - send a patch or shut up.
3. Thanks yuhenobi for the story about Selectel Storage.