-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4aec54f
Showing
35 changed files
with
2,006 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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,39 @@ | ||
<?php | ||
|
||
/* | ||
Plugin Name: Gist Theme Wp | ||
Plugin URI: https://datogedon.com/wordpress/plugins/gist-theme-wp/ | ||
Description: Change the theme of your embedded gists. | ||
Version: 1.0.0 | ||
Author: Baldomero Cho | ||
Author URI: https://datogedon.com | ||
License: GPLv2 or later | ||
*/ | ||
|
||
$option_name = "current_gist_theme_wp"; | ||
$defaultTheme = "obsidian"; | ||
|
||
if(get_option($option_name)){ | ||
$currentTheme = get_option($option_name); | ||
} | ||
else { | ||
add_option($option_name, $defaultTheme); | ||
} | ||
|
||
add_action('admin_menu', 'gist_theme_wp_setup_menu'); | ||
|
||
function gist_theme_wp_setup_menu(){ | ||
add_menu_page( 'Gist Theme Config', 'Gist Theme', 'manage_options', 'gist-theme-wp', 'gist_theme_wp' ); | ||
} | ||
|
||
|
||
wp_register_style('gistthemecode', plugins_url('stylesheets/'.$currentTheme.'.css',__FILE__ )); | ||
wp_register_style('defaultvalues', plugins_url('stylesheets/defaultvalues.css',__FILE__ )); | ||
|
||
wp_enqueue_style( 'gistthemecode' ); | ||
wp_enqueue_style( 'defaultvalues' ); | ||
|
||
function gist_theme_wp(){ | ||
echo "<h1>Gist Theme Config</h1>"; | ||
include "make.php"; | ||
} |
This file contains 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,75 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
|
||
<!-- IMPORT SCRIPTS JS [VUEJS, SWEET ALERT 2] --> | ||
<script src="https://unpkg.com/vue@2.5.2"></script> | ||
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script> | ||
</head> | ||
|
||
<body> | ||
|
||
<?php | ||
// VALIDATE IF CURRENT GIST THEME WP IS CHANGED ON POST | ||
$option_name = "current_gist_theme_wp"; | ||
$new_value = $_POST["newGistThemeWPSelected"]; | ||
$get_option = get_option($option_name); | ||
if ($_POST["theme"] != "" && $_POST["theme"] != $get_option) { | ||
if ($get_option != $new_value) { | ||
update_option($option_name, $new_value); | ||
echo '<script type="text/javascript"> | ||
Swal.fire( | ||
`' . strtoupper($_POST["theme"]) . ' selected`, | ||
`Gist Theme Updated`, | ||
`success` | ||
); | ||
</script>'; | ||
} else { | ||
$deprecated = ' '; | ||
$autoload = 'no'; | ||
add_option($option_name, $new_value, $deprecated, $autoload); | ||
} | ||
$get_option = get_option($option_name); | ||
|
||
|
||
} | ||
|
||
|
||
// CREATE FORM FOR UPDATE OR CHANGE GIST THEME WP | ||
|
||
|
||
?> | ||
<div id="app"> | ||
<h2>Current theme: {{selection.toUpperCase()}}</h2> | ||
<img v-bind:src="ruta+selection+'.png'" alt="" style="margin:20px 0"> | ||
<form id="updateGistThemeWP" name="updateGistThemeWP" method="POST"> | ||
<select id="newGistThemeWPSelected" size="1" v-model="selection" name="newGistThemeWPSelected"> | ||
<option v-for="item in items" :value="item">{{item.toUpperCase()}}</option> | ||
</select> | ||
<input type="submit" value="Save" style=""/> | ||
|
||
</form> | ||
</div> | ||
|
||
|
||
<script> | ||
(async () => { | ||
const productsResponse = await fetch(<?php echo '"' . plugins_url('gist-theme-wp/options.json', dirname(__FILE__)) . '"'?>); | ||
const products = await productsResponse.json(); | ||
|
||
new Vue({ | ||
el: '#app', | ||
data() { | ||
return { | ||
items: products, | ||
selection: <?php echo '"' . $get_option . '"'?>, | ||
ruta: <?php echo '"' . plugins_url('gist-theme-wp/themes-gist/', dirname(__FILE__)) . '"'?> | ||
} | ||
} | ||
}) | ||
})(); | ||
</script> | ||
</body> | ||
|
||
</html> |
This file contains 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,14 @@ | ||
[ | ||
"chaos", | ||
"cobalt", | ||
"idle-fingers", | ||
"monokai", | ||
"obsidian", | ||
"one-dark", | ||
"pastel-on-dark", | ||
"solarized-dark", | ||
"solarized-light", | ||
"terminal", | ||
"tomorrow-night", | ||
"twilight" | ||
] |
This file contains 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,32 @@ | ||
=== Gist Theme WP === | ||
Contributors: baldomerocho | ||
Tags: github gist, gist theme github, gist code, code with gist theme, change theme gist | ||
Donate link: https://www.paypal.com/donate?hosted_button_id=FY8NBZJSJ6RXW | ||
Requires at least: 5.0 | ||
Tested up to: 5.0 | ||
Requires PHP: 7.4 | ||
Stable tag: stable | ||
License: GPLv2 or later | ||
|
||
Change the theme of your embedded gists. | ||
|
||
== Description == | ||
Change the theme of your embedded gists. | ||
When you insert your gist from github.com it is displayed with the default theme or git layout. | ||
But we can change the layout of the code to display as in our code editors. | ||
|
||
== Installation == | ||
Upload the Gist Theme WP plugin to your blog, activate it and you\'re done. | ||
|
||
== Frequently Asked Questions == | ||
is official Github? | ||
No, not is official plugin. | ||
|
||
== Screenshots == | ||
1. Simple Panel Admin | ||
|
||
== Changelog == | ||
1.0.0 | ||
|
||
== Upgrade Notice == | ||
All ready |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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,90 @@ | ||
body .gist .highlight { | ||
background: #161616; | ||
} | ||
body .gist .blob-num, | ||
body .gist .blob-code-inner, | ||
body .gist .pl-st { | ||
color: #e6e1dc; | ||
} | ||
body .gist .pl-c, | ||
body .gist .pl-c span { | ||
color: #555; | ||
font-style: italic; | ||
} | ||
body .gist .pl-mb { | ||
color: #1edafb; | ||
font-weight: 700; | ||
} | ||
body .gist .pl-mh .pl-en { | ||
color: #fdc251; | ||
font-weight: 700; | ||
} | ||
body .gist .pl-mi { | ||
color: #00698f; | ||
font-style: italic; | ||
} | ||
body .gist .pl-mq { | ||
color: #555; | ||
} | ||
body .gist .pl-sc { | ||
color: #999; | ||
} | ||
body .gist .pl-c1, | ||
body .gist .pl-mh, | ||
body .gist .pl-sr .pl-cce { | ||
color: #fdc251; | ||
} | ||
body .gist .pl-e, | ||
body .gist .pl-en, | ||
body .gist .pl-ent, | ||
body .gist .pl-s, | ||
body .gist .pl-v, | ||
body .gist .pl-vpf { | ||
color: #974; | ||
} | ||
body .gist .pl-k, | ||
body .gist .pl-mdh, | ||
body .gist .pl-mdr, | ||
body .gist .pl-ml, | ||
body .gist .pl-mm, | ||
body .gist .pl-mo, | ||
body .gist .pl-mp, | ||
body .gist .pl-mr, | ||
body .gist .pl-ms, | ||
body .gist .pl-s1 .pl-v, | ||
body .gist .pl-s3 { | ||
color: #00698f; | ||
} | ||
body .gist .pl-pds, | ||
body .gist .pl-s1, | ||
body .gist .pl-s1 .pl-pse .pl-s2 { | ||
color: #58c554; | ||
} | ||
body .gist .pl-s1 .pl-s2, | ||
body .gist .pl-sv { | ||
color: #1edafb; | ||
} | ||
body .gist .pl-smi, | ||
body .gist .pl-smp, | ||
body .gist .pl-stj, | ||
body .gist .pl-vo { | ||
color: #be53e6; | ||
} | ||
body .gist .pl-sr, | ||
body .gist .pl-sr .pl-sra, | ||
body .gist .pl-sr .pl-sre, | ||
body .gist .pl-src { | ||
color: #ff308f; | ||
} | ||
body .gist .pl-mi1, | ||
body .gist .pl-mdht { | ||
color: #fff; | ||
background: rgba(0, 64, 0, .5); | ||
} | ||
body .gist .pl-md, | ||
body .gist .pl-mdhf, | ||
body .gist .pl-id, | ||
body .gist .pl-ii { | ||
color: #fff; | ||
background: #900; | ||
} |
This file contains 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,96 @@ | ||
body .gist .highlight { | ||
background: #002240; | ||
} | ||
body .gist .blob-num, | ||
body .gist .blob-code-inner, | ||
body .gist .pl-en { | ||
color: #fff; | ||
} | ||
body .gist .pl-mb, | ||
body .gist .pl-mh .pl-en { | ||
font-weight: 700; | ||
} | ||
body .gist .pl-c, | ||
body .gist .pl-c span, | ||
body .gist .pl-mi { | ||
font-style: italic; | ||
} | ||
body .gist .pl-ent, | ||
body .gist .pl-v { | ||
color: #fd0; | ||
} | ||
body .gist .pl-mh, | ||
body .gist .pl-mh .pl-en, | ||
body .gist .pl-sr .pl-cce { | ||
color: #eb939a; | ||
} | ||
body .gist .pl-pds, | ||
body .gist .pl-s, | ||
body .gist .pl-s1, | ||
body .gist .pl-s1 .pl-pse .pl-s2, | ||
body .gist .pl-s1 .pl-v { | ||
color: #3ad900; | ||
} | ||
body .gist .pl-s1 .pl-s2, | ||
body .gist .pl-smi, | ||
body .gist .pl-smp, | ||
body .gist .pl-stj, | ||
body .gist .pl-vo, | ||
body .gist .pl-vpf { | ||
color: #ccc; | ||
} | ||
body .gist .pl-s3, | ||
body .gist .pl-sc { | ||
color: #ffb054; | ||
} | ||
body .gist .pl-sr, | ||
body .gist .pl-sr .pl-sra, | ||
body .gist .pl-sr .pl-sre, | ||
body .gist .pl-src { | ||
color: #80ffc2; | ||
} | ||
body .gist .pl-mdht, | ||
body .gist .pl-mi1 { | ||
color: #f8f8f8; | ||
background: rgba(0, 64, 0, .5); | ||
} | ||
body .gist .pl-id, | ||
body .gist .pl-ii, | ||
body .gist .pl-md, | ||
body .gist .pl-mdhf { | ||
color: #f8f8f8; | ||
background: #800f00; | ||
} | ||
body .gist .highlight-source-js .pl-st { | ||
color: #ffee80; | ||
} | ||
body .gist .highlight-source-css .pl-s3 { | ||
color: #80ffbb; | ||
} | ||
body .gist .highlight-text-html-basic .pl-ent { | ||
color: #9effff; | ||
} | ||
body .gist .pl-c, | ||
body .gist .pl-c span, | ||
body .gist .pl-mq { | ||
color: #08f; | ||
} | ||
body .gist .pl-c1, | ||
body .gist .pl-sv, | ||
body .gist .pl-mb { | ||
color: #ff628c; | ||
} | ||
body .gist .pl-e, | ||
body .gist .pl-k, | ||
body .gist .pl-mdh, | ||
body .gist .pl-mdr, | ||
body .gist .pl-ml, | ||
body .gist .pl-mm, | ||
body .gist .pl-mo, | ||
body .gist .pl-mp, | ||
body .gist .pl-mr, | ||
body .gist .pl-ms, | ||
body .gist .pl-st, | ||
body .gist .pl-mi { | ||
color: #ff9d00; | ||
} |
Oops, something went wrong.