mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-25 17:23:00 +00:00
Added history support to the raw action.
This commit is contained in:
parent
0253ab6c0e
commit
dfeb2a9399
4 changed files with 14 additions and 13 deletions
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
## v0.13-dev
|
## v0.13-dev
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Added history support to the `raw` action.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Overhauled internal history logic - history logic is now done in core.
|
- Overhauled internal history logic - history logic is now done in core.
|
||||||
- Added `$env->page_filename`, which points to the current page on disk.
|
- Added `$env->page_filename`, which points to the current page on disk.
|
||||||
|
|
|
@ -1596,7 +1596,7 @@ register_module([
|
||||||
|
|
||||||
register_module([
|
register_module([
|
||||||
"name" => "Raw page source",
|
"name" => "Raw page source",
|
||||||
"version" => "0.6",
|
"version" => "0.7",
|
||||||
"author" => "Starbeamrainbowlabs",
|
"author" => "Starbeamrainbowlabs",
|
||||||
"description" => "Adds a 'raw' action that shows you the raw source of a page.",
|
"description" => "Adds a 'raw' action that shows you the raw source of a page.",
|
||||||
"id" => "action-raw",
|
"id" => "action-raw",
|
||||||
|
@ -1621,9 +1621,8 @@ register_module([
|
||||||
add_action("raw", function() {
|
add_action("raw", function() {
|
||||||
global $env;
|
global $env;
|
||||||
|
|
||||||
header("x-filename: " . rawurlencode($env->page) . ".md");
|
|
||||||
header("content-type: text/markdown");
|
header("content-type: text/markdown");
|
||||||
exit(file_get_contents("$env->storage_prefix$env->page.md"));
|
exit(file_get_contents($env->page_filename));
|
||||||
exit();
|
exit();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -4689,7 +4688,7 @@ register_module([
|
||||||
|
|
||||||
register_module([
|
register_module([
|
||||||
"name" => "Page viewer",
|
"name" => "Page viewer",
|
||||||
"version" => "0.15",
|
"version" => "0.16",
|
||||||
"author" => "Starbeamrainbowlabs",
|
"author" => "Starbeamrainbowlabs",
|
||||||
"description" => "Allows you to view pages. You really should include this one.",
|
"description" => "Allows you to view pages. You really should include this one.",
|
||||||
"id" => "page-view",
|
"id" => "page-view",
|
||||||
|
|
|
@ -19,11 +19,11 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Raw page source",
|
"name": "Raw page source",
|
||||||
"version": "0.6",
|
"version": "0.7",
|
||||||
"author": "Starbeamrainbowlabs",
|
"author": "Starbeamrainbowlabs",
|
||||||
"description": "Adds a 'raw' action that shows you the raw source of a page.",
|
"description": "Adds a 'raw' action that shows you the raw source of a page.",
|
||||||
"id": "action-raw",
|
"id": "action-raw",
|
||||||
"lastupdate": 1465757909,
|
"lastupdate": 1476812239,
|
||||||
"optional": false
|
"optional": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -181,11 +181,11 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Page viewer",
|
"name": "Page viewer",
|
||||||
"version": "0.15",
|
"version": "0.16",
|
||||||
"author": "Starbeamrainbowlabs",
|
"author": "Starbeamrainbowlabs",
|
||||||
"description": "Allows you to view pages. You really should include this one.",
|
"description": "Allows you to view pages. You really should include this one.",
|
||||||
"id": "page-view",
|
"id": "page-view",
|
||||||
"lastupdate": 1476811748,
|
"lastupdate": 1476812218,
|
||||||
"optional": false
|
"optional": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
register_module([
|
register_module([
|
||||||
"name" => "Raw page source",
|
"name" => "Raw page source",
|
||||||
"version" => "0.6",
|
"version" => "0.7",
|
||||||
"author" => "Starbeamrainbowlabs",
|
"author" => "Starbeamrainbowlabs",
|
||||||
"description" => "Adds a 'raw' action that shows you the raw source of a page.",
|
"description" => "Adds a 'raw' action that shows you the raw source of a page.",
|
||||||
"id" => "action-raw",
|
"id" => "action-raw",
|
||||||
|
@ -26,9 +26,8 @@ register_module([
|
||||||
add_action("raw", function() {
|
add_action("raw", function() {
|
||||||
global $env;
|
global $env;
|
||||||
|
|
||||||
header("x-filename: " . rawurlencode($env->page) . ".md");
|
|
||||||
header("content-type: text/markdown");
|
header("content-type: text/markdown");
|
||||||
exit(file_get_contents("$env->storage_prefix$env->page.md"));
|
exit(file_get_contents($env->page_filename));
|
||||||
exit();
|
exit();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue