Ejemplo n.º 1
0
    ?>
"><?php 
    echo mb_strimwidth($commit->SHA, 0, 8);
    ?>
</code>
					</a>
				</td>
				<td>
					<details>
						<summary>
							<?php 
    echo array_shift($commit->Message);
    ?>
						</summary>
						<samp><?php 
    echo $parser->text(join(PHP_EOL, $commit->Message));
    ?>
</samp>
					</details>
				</td>
				<td>
					<?php 
    echo $commit->Branch;
    ?>
				</td>
				<td>
					<a href="mailto:<?php 
    echo $commit->Email;
    ?>
?subject=Commit <?php 
    echo $commit->SHA;
Ejemplo n.º 2
0
     if (array_key_exists('prompt_value', $_POST) and strlen($_POST['prompt_value'])) {
         $command = 'git ' . escapeshellcmd($_POST['prompt_value']);
         $result = `{$command}`;
         $resp->notify($command, $result, 'images/logos/git.png');
     }
     break;
 case 'recent_commits':
     $resp->remove('#recent_commits_dialog, .backdrop')->append('body', load_results('recent_commits'))->showModal('#recent_commits_dialog');
     break;
 case 'github_issues':
     $resp->append('body', load_results('github_issues'))->showModal('#github_issues_dialog');
     break;
 case 'README':
     $readme = new \shgysk8zer0\Core\File('README.md');
     $parser = new \Parsedown\Parsedown();
     $dialog = new \shgysk8zer0\Core\Elements\Dialog('README', $parser->text($readme));
     $resp->append('body', $dialog)->showModal($dialog->id);
     break;
 case 'update_icons':
     require_login('admin');
     $icons = \shgysk8zer0\Core\resources\Parser::parseFile('icons.json');
     $found = array_filter(array_unique($icons->icons), 'file_exists');
     if (count($found) === count($icons->icons)) {
         if (SVG_symbols($icons->icons, $icons->output)) {
             $resp->notify('Success!', "Icons have been saved to {$icons->output}");
         } else {
             $resp->notify('We have a problem :(', 'Was unable to update combined SVG due to an error parsing or saving the file', 'images/octicons/svg/bug.svg');
         }
     } else {
         $resp->notify('We have a problem :(', 'Some icons are missing. Check your browser\'s log', 'images/octicons/svg/bug.svg')->log(['Icons' => $icons, 'Found' => $found, 'Missing' => array_diff($icons->icons, $found)]);
     }
Ejemplo n.º 3
0
function get_readme()
{
    $parsedown = new \Parsedown\Parsedown();
    return $parsedown->text(file_get_contents(README));
}
Ejemplo n.º 4
0
					<a href="<?php 
    echo $issue->repo_url;
    ?>
" target="_blank"><?php 
    echo $issue->repo;
    ?>
</a>
				</td>
				<td>
					<details>
						<summary><?php 
    echo utf($issue->Title);
    ?>
</summary>
						<kbd><?php 
    echo $parser->text(mb_convert_encoding($issue->Body, 'utf-8'));
    ?>
</kbd>
					</details>
				</td>
				<td>
					<time><?php 
    echo date('D, M jS Y g:i A', strtotime($issue->Created));
    ?>
</time>
				</td>
				<td>
					<time><?php 
    echo date('D, M jS Y g:i A', strtotime($issue->Updated));
    ?>
</time>
Ejemplo n.º 5
0
            $result = `{$command}`;
            $resp->notify($command, $result, 'images/logos/git.png');
        }
        break;
    case 'recent_commits':
        $resp->remove('#recent_commits_dialog, .backdrop')->append('body', load_results('recent_commits'))->showModal('#recent_commits_dialog');
        break;
    case 'github_issues':
        $resp->append('body', load_results('github_issues'))->showModal('#github_issues_dialog');
        break;
    case 'README':
        $readme = new \shgysk8zer0\Core\File('README.md');
        $parser = new \Parsedown\Parsedown();
        $resp->append('body', '<dialog id="README_dialog">
			<button data-delete="#README_dialog">
			</button><br />' . $parser->text($readme) . '</dialog>')->showModal('#README_dialog');
        break;
    case 'update_icons':
        require_login('admin');
        $icons = \shgysk8zer0\Core\resources\Parser::parseFile('icons.json');
        $found = array_filter(array_unique($icons->icons), 'file_exists');
        if (count($found) === count($icons->icons)) {
            if (SVG_symbols($icons->icons, $icons->output)) {
                $resp->notify('Success!', "Icons have been saved to {$icons->output}");
            } else {
                $resp->notify('We have a problem :(', 'Was unable to update combined SVG due to an error parsing or saving the file', 'images/octicons/svg/bug.svg');
            }
        } else {
            $resp->notify('We have a problem :(', 'Some icons are missing. Check your browser\'s log', 'images/octicons/svg/bug.svg')->log(['Icons' => $icons, 'Found' => $found, 'Missing' => array_diff($icons->icons, $found)]);
        }
        break;