TEXT FOLDING
by David Andrew Bardesdavidbardes@yahoo.com
TEXT FOLDING INSTRUCTIONSTEXT FOLDING is designed to be used as a desktop application running on a Windows PC (using underlying PHP desktop server app. See section below) It can be used on corporate intranets (password protected portals) but should not be used on the public open Internet (as visitors can edit/save files) unless "kiosk mode" is turned on. Some user functions will only work on a Windows PC, like the "Print" button.
TEXT FOLDING consists of a single tiny index.php file.
(There is an optional 3rd party file library/photo gallery single file script that can be integrated – see below section on File Libraries.)
To run TEXT FOLDING:
1) Download https://textfolding.com/textfolding.zip, extract index.php file.
2) Create a new empty directory on your web server.
3) Copy index.php into the directory.
4) Run index.php
The first time you run index.php in an empty directory, it will build and populate the default project board. From there you can edit all settings and functions through the program itself.
I suggest you run the program and play around with it first, then come back and read the rest of these instructions.
LAYOUTTEXT FOLDING is a single webpage project board with dropdown menu buttons at the top of the page. Each project in the main list consists of a clickable "bar" with a folded mini-web browser that displays an editable text file in a "white-space" – allows text files to display without need for html tags, yet fully allows html tags to be inserted and rendered.
Clicking the "Settings" button brings up a secondary page with all the editable settings.
You can set up multiple project boards and link them all back to each other using the dropdown menu buttons. You can have boards on your local PC, and on remote servers, then seamlessly move back and forth. You can also nest one board inside the fold of another.
Each project board has three permanent items that appear as the first three bars.
Σ- Edit Master List FileΑΩ- TicklerΔ- Notes – Scratchpad
Below these first three bars comes the full project list, each with a bar that folds.
In Detail:Σ- Edit Master List File
The "Σ- Edit Master List File" bar is the editable text file containing the list of project items and their corresponding text files (or documents/programs/sites.)
Each project item in the editable master list file consists of two (2) things separated by the pipe "|" character (if you forget to add the pipe character, nothing will load properly until you manually edit the master list file making correction.)
Example:
To Do Item A | todo-item-a.txt
To Do Item B | todo-item-b.txt
To Do Item C | todo-item-c.txt
First comes the words/text you want to appear on the bar, then comes the "|" pipe character, then the name of the text file with the extension ".txt". Instead of a text file, you can also use PDF files, video's, audio files, pictures, php programs, websites, URL's (partial or full), or anything that can be loaded in a web browser. Documents/URL's can be loaded with full or partial paths.
The program will automatically create the text file you type into the master list file, if it does not exist. The default text file used as the template for the newly created text file is editable on the settings page. This allows for customization depending on purpose of the board.
The order of project items in the master list file sets the order in appearance on the board. You can add, remove, and reorder the project list quickly by editing the order in the master list file (cut and paste from one location in list to other.)
Note: If you are running TEXT FOLDING as a desktop application on your PC, you will not be able to load encrypted "https" websites because your browser is not in encrypted mode. If you run TEXT FOLDING from an encrypted URL, then "https" websites will work in the fold.
ΑΩ– Tickler
This provides the default chronological tickler file format. You can edit from there.
Δ- Notes – Scratchpad
Provides a quick place to store notes later to move, scratch off list.
SETTINGS PAGE
Clicking the "Settings" button brings up the settings page with the following bars.
Θ- InstructionsΠ- Edit Settings.ini FileΧ- Edit Default Text File (template.txt)Β- Edit Dropdown Buttons Master FileIn detail:Θ– Instructions
This bar folds these instructions.
Π- Edit Settings.ini File
This bar allows you to edit the settings.ini file controlling all aspects of the board. Note "Kiosk Mode" turns off all editing functions and renders the board into a static read only mode. Once Kiosk Mode is turned "on" the only way to restore edit functions is to manually edit settings.ini file setting [Kiosk Mode] to "off."
Χ- Edit Default Text File (template.txt)TEXT FOLDING automatically creates the inserted named text file if they do not already exist. It copies the default text file, named template.txt, and renames it to your chosen name.
The allows for wide customization for each board you set up. As an example, if you use for a list of employees your template.txt file can have all the data fields you want to collect.
Β- Edit Dropdown Buttons Master File
Each line in this file creates a dropdown menu button with the links stored in a text file that you name (make up a name.) The formatting is similar, first comes the text/words to appear on the button, followed by the pipe "|" character, then the name of the text file you want to store the links.
Sample Title Here|0-Drop-Sample.txt
Once you create a new button, a sub-bar is created to allow you to add/edit the links in that dropdown button.
Edit [Sample Title Here] dropdown menu button
Each line in these files contains the text/words to appear followed by the pipe "|" character then the URL (full or partial) for the link to send the user.
CNN News|https://cnn.com
Weather Underground|https://wunderground.comWhite-space, CSS and HTML Tags
When a text file is folded, a unique view space is created called a "white-space." Where text files will display without need of HTML tags, yet HTML tags will work and render correctly in the space.
Hyperlinks require the [target="_Blank"] added within the anchor to work correctly.
I have prepared a table of clickable HTML tags and CSS elements for common formatting needs, that is displayed upon editing a text file. Tags are automatically copied to the clipboard once selected, so you can just paste into file.
See bottom of this file for examples of these tags.
FILE LIBRARIES
Each bar in your project list that folds a text file, can also create a "file library" to store and retrieve files for that project. A subdirectory is created in the same name as the text file without the extension. Just click the "Create File Library" button. Once created a "View File Library" button appears.
If you have a file/photo gallery script that mimics "file explorer" you can rename it to "library.php" and place in the same directory as index.php. Then when a user first creates a file library, the "library.php" file is copied and renamed to "index.php" in the newly created subdirectory. When a user then clicks "View File Library" button, a new tab is opened loading the index.php in the subdirectory.
I found the best 3rd party single-file file/photo gallery script that is free to use but has a nag screen until you pay $40 for the license key. I highly recommend you spend the $40. But please visit their website and download their index.php file. Then rename to "library.php" and copy into the same directory as TEXT FOLDING's index.php file.
For "Files Gallery" visit:
https://www.files.gallery/Setting favicon
The default favicon is "check.ico" and it is loaded internally by data stream. To override with your own favicon, copy your icon into the directory with index.php and edit the settings.ini file changing the favicon name to your favicon name. Save and reload page.
Renaming index.php
You can safely rename "index.php" as long as you have the PHP extension.
LICENSETEXT FOLDING is free to use for personal and business use. If you are going to incorporate into something you distribute, with or without profit, for $20 I will provide a forever license and waiver with the only requirement being a reference somewhere to containing TEXT FOLDING by David Andrew Bardes.
Email me: davidbardes@yahoo.comPHP DESKTOP SERVER APPTEXT FOLDING is a PHP script that requires a PHP Server to run. There are several free Windows PC desktop PHP server apps that you can use. I prefer "phpbrowserbox" not just because it is free, but because there is nothing to install (just unzip and run) and no settings are required.
Phpbrowserbox allows PHP scripts to be run as Windows desktop applications.
Search Google for "phpbrowserbox"
1) Download phpbrowserbox.zip (71megs)
2) Create a new directory on your c: drive C:\PHP
3) Copy phpbrowserbox.zip into C:\PHP
4) Extract zip file into the \PHP directory (deselect option provided on where to extract.)
5) Once the files are extracted, click into the c:\PHP\htdocs directory (this is your live web root.
6) Download https://textfolding.com/rootindex.zip
7) Extract the index.php file from the above zip file and save in this web root C:\PHP\htdocs directory. This script provides an east clickable link to launch TEXT FOLDING (once phpbrowserbox.exe is run.)
8) Create a new directory called \todo like C:\PHP\htdocs\todo
9) Copy the TEXT FOLDINGindex.php file into the C:\PHP\htdocs\todo directory.
10) Run phpbrowserbox.exe (create a shortcut on desktop to launch)
11) When screens appear asking to accept this or that, just decline all of them. phpbrowserbox.exe runs entirely on the local machine and even runs from a USB stick.
12) When the kiosk window appears saying "PHP Server is Running" click on the link, like http://localhost:81/todo
13) This loads TEXT FOLDING in your web browser.
PREDEFINED CSS FORMATS/SHORTCUTS
(edit page to see source)
This is a sticky note, with text that wraps to the next line.
Edit file to view source.
Styles so far id="box"
id="box" draw box with shadow.id="highlight" highlight's textid="red" turns text bold redid="dred" turns text bold dark redid="blue" turns text bold blueid="dblue" turns text bold dark blueid="green" turns text bold greenid="dgreen" turns text bold dark green
Regular text size
id="large" Large text sizeid="small" Small text size
Verdana font
Tahoma font
Arial font
Trebuchet MS font
Garamond font
Times New Roman font
Consolas font