-
Notifications
You must be signed in to change notification settings - Fork 74
Implemented changes to add support for HTML templates #199
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
Open
irsheep
wants to merge
13
commits into
AndrewPaglusch:master
Choose a base branch
from
irsheep:html_form
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
278fe9e
Implemented changes to add support for HTML templates
irsheep 76a6269
Update js/templates.js
irsheep 91e94cf
Update js/templates.js
irsheep 18891a0
Update includes/functions.php
irsheep 50e65e2
Update includes/functions.php
irsheep e9dcbfa
Update README.md
irsheep 3ce182b
Update js/templates.js
irsheep 58dc69a
Update includes/functions.php
irsheep 4c68e6f
Update js/templates.js
irsheep 01cd339
Fixed duplicated datetime in includes/functions.php
irsheep 08f5344
Applied missed recommendations
irsheep 40d14c7
Fixed weird behaviour when using ?t=
irsheep 4140f29
HTML values are now escaped for html special characters
irsheep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <?php | ||
| define("_DIRECT_ACCESS_CHECK", 1); | ||
| require_once("includes/sanitycheck.php"); # check everything before we proceed | ||
| require_once("includes/functions.php"); # load functions | ||
|
|
||
| if ( !empty($_GET["select"]) ) { | ||
| $template_path = "templates/" . urldecode(basename($_GET["select"])) . ".txt"; | ||
| $templates = glob('templates/*.txt'); | ||
|
|
||
| if ( ! in_array($template_path, $templates, true) ) { | ||
| echo "TEMPLATE_NOT_FOUND"; | ||
| } else if ( file_exists($template_path) ) { | ||
| $template_text = file_get_contents($template_path); | ||
| $formdata["select"] = $_GET["select"]; | ||
| echo get_template_html($formdata, true); | ||
| } | ||
| } | ||
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| ul { | ||
| width: 100%; | ||
| list-style-type: none; | ||
| margin: 0; | ||
| padding: 0; | ||
| display: inline-flex; | ||
| } | ||
| ul li label { | ||
| margin: 0 10px 0 5px; | ||
| } | ||
|
|
||
| li select { | ||
| height: -webkit-fill-available; | ||
| } | ||
|
|
||
| .html_secret { | ||
| border: 1px solid var(--bs-border-color); | ||
| padding: 15px; | ||
| } | ||
| .html_secret > ul { | ||
| margin-bottom: 10px; | ||
| } | ||
|
|
||
| .icon { | ||
| margin: 0px 0px 0px 5px; | ||
| position:relative; | ||
| bottom: -3px; | ||
| } | ||
|
|
||
| .pulse { | ||
| -webkit-animation: pulse 1s ease-in-out infinite alternate; | ||
| animation: pulse 1s ease-in-out infinite alternate; | ||
| } | ||
|
|
||
| @-webkit-keyframes pulse { | ||
| 0% { | ||
| } | ||
| 50% { | ||
| color: var(--bs-success); | ||
| } | ||
| 100% { | ||
| } | ||
| } | ||
| @keyframes pulse { | ||
| 0% { | ||
| } | ||
| 50% { | ||
| color: var(--bs-success); | ||
| } | ||
| 100% { | ||
| } | ||
| } | ||
|
|
||
| .overlay { | ||
| position: absolute; | ||
| top: -20px; | ||
| width: 100%; | ||
| height: 100%; | ||
| display: none; | ||
| opacity: 0; | ||
| background-color: #000000ad !important; | ||
| transition: visibility 0s, opacity .30s linear; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <?php defined('_DIRECT_ACCESS_CHECK') or exit(); ?> | ||
| <div id="form-div"> | ||
| <fieldset> | ||
| <div> | ||
| <label style="font-family: 'Enriqueta', arial, serif; line-height: 1.25; margin: 0 0 10px; font-size: 30px; font-weight: bold;"><?php echo $settings['messages']['view_secret_header'] ?></label> | ||
| <div style="font-style: italic"> | ||
| <label style="font-family: 'Enriqueta', arial, serif; line-height: 1.25; margin: 0 0 10px; font-size: 15px; font-weight: bold;"><?php echo $settings['messages']['view_secret_subheader'] ?></label> | ||
| </div> | ||
| <?php echo $html ?> | ||
| <div class="col"> | ||
| <button class="btn btn-primary" type="button" onclick="copyText()">Copy</button> | ||
| </div> | ||
| </div> | ||
| </fieldset> | ||
| </div> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ability to include the template as part of the URL is something I personally use quite often. I would imagine this is used by others as well. It's useful for sending a template URL to someone to have them fill out and send back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feature is still available, but there was an weird behaviour when ?t= was used, also now when specifying the template the combo box is updated with the name of the template.