TiddlyWiki/tiddlywiki — pull request #109 by JohnHind (2012-10-18 15:58:56+00:00)
Title: Factor out savability test

This patch factors the test for TW file savability to a new function
'allowSave'. This test was hard-coded in several places as a test for
the "file:" protocol prefix. Factoring it into a function means that
plugins that add new saving methods, which may be applicable to other
protocols, can hijack the test. It is hoped that plugins that use file
saving functionality will migrate to using 'allowSave' so they can
automatically adapt to use new saver plugins.

Implementation: It is accepted that the two uses of 'allowSave' in
main.js are before plugin loading and will therefore not be adaptable.
This use is purely for coding consistency. 'useJavaSaver' is probably
not important because any saver plugin is likely to supply its own save
methods. 'readOnly' may easily be reset to the required value by the
saver plugin itself.

Testing: I have tested this patch by manually copying the changes into
an empty TW 2.6.6 file. I do not have time to master the building and
testing processes. Maybe someone who has the experience and a working
build environment could do a build and regression test?