Skip to content

Commit

Permalink
Merge pull request #69 from PierreLebedel/pleb-fix-jqueryui
Browse files Browse the repository at this point in the history
jQuery UI demo page
Powerful 🎉  @PierreLebedel, Thanks a lot.
  • Loading branch information
bueltge authored Dec 22, 2023
2 parents 5e1c3e4 + 94275d5 commit 20ccd3d
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 97 deletions.
6 changes: 3 additions & 3 deletions WpAdminStyle.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ public function get_style_examples() {
include_once $patterns;
echo '<details class="primer" style="display: inline-block; width: 100%;">';
echo '<summary title="Show markup and usage">&#8226;&#8226;&#8226; '
. esc_attr__( 'Show markup and usage', 'WpAdminStyle' )
. '</summary>';
. esc_attr__( 'Show markup and usage', 'WpAdminStyle' )
. '</summary>';
echo '<section>';
echo '<pre><code class="language-php">';
echo htmlspecialchars(
Expand All @@ -167,7 +167,7 @@ public function get_style_examples() {
'scroll to top',
'WpAdminStyle'
)
. '</a><br class="clear" />';
. '</a><br class="clear" />';
echo '</p>';
echo '</section><!--/.pattern-->';
echo '<hr>';
Expand Down
Binary file modified images/ui-icons_21759b_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ui-icons_333333_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ui-icons_999999_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/ui-icons_cc0000_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
183 changes: 89 additions & 94 deletions inc/WpAdminJqueryUi.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,13 @@ public function get_jquery_ui_demo() {
</div>
</div>

style="margin:3px 0 0 30px;">
<?php
_e(
'scroll to top',
'WpAdminStyle'
);
?>
</a><br class="clear"/></p>
<p>
<a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);"
style="margin:3px 0 0 30px;">
<?php _e( 'scroll to top', 'WpAdminStyle' ); ?>
</a>
<br class="clear"/>
</p>

<!-- Tabs -->
<h2>Tabs</h2>
Expand All @@ -175,28 +174,26 @@ public function get_jquery_ui_demo() {
</div>
</div>

style="margin:3px 0 0 30px;">
<?php
_e(
'scroll to top',
'WpAdminStyle'
);
?>
</a><br class="clear"/></p>
<p>
<a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);"
style="margin:3px 0 0 30px;">
<?php _e( 'scroll to top', 'WpAdminStyle' ); ?>
</a>
<br class="clear"/>
</p>

<!-- Dialog NOTE: Dialog is not generated by UI in this demo so it can be visually styled in themeroller-->
<h2 id="anker_dialog">Dialog</h2>
<p><a href="#" id="dialog_link" class="ui-state-default ui-corner-all"><span
class="ui-icon ui-icon-newwin"></span>Open Dialog</a></p>

style="margin:3px 0 0 30px;">
<?php
_e(
'scroll to top',
'WpAdminStyle'
);
?>
</a><br class="clear"/></p>
<p>
<a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);"
style="margin:3px 0 0 30px;">
<?php _e( 'scroll to top', 'WpAdminStyle' ); ?>
</a>
<br class="clear"/>
</p>

<h2 id="overlay_shadow">Overlay and Shadow Classes <em>(not currently used in UI widgets)</em></h2>
<div style="position: relative; width: 90%; height: 200px; padding:1% 4%; overflow:hidden;"
Expand Down Expand Up @@ -240,14 +237,13 @@ class="ui-widget ui-widget-content ui-corner-all">
</div>
</div>

style="margin:3px 0 0 30px;">
<?php
_e(
'scroll to top',
'WpAdminStyle'
);
?>
</a><br class="clear"/></p>
<p>
<a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);"
style="margin:3px 0 0 30px;">
<?php _e( 'scroll to top', 'WpAdminStyle' ); ?>
</a>
<br class="clear"/>
</p>

<!-- ui-dialog -->
<div id="dialog" title="Dialog Title">
Expand All @@ -257,6 +253,7 @@ class="ui-widget ui-widget-content ui-corner-all">
</div>

<h2>Framework Icons (content color preview)</h2>

<ul id="icons" class="ui-widget ui-helper-clearfix">

<li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-n"><span
Expand Down Expand Up @@ -626,27 +623,25 @@ class="ui-icon ui-icon-gripsmall-diagonal-se"></span></li>
class="ui-icon ui-icon-grip-diagonal-se"></span></li>
</ul>

style="margin:3px 0 0 30px;">
<?php
_e(
'scroll to top',
'WpAdminStyle'
);
?>
</a><br class="clear"/></p>
<p>
<a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);"
style="margin:3px 0 0 30px;">
<?php _e( 'scroll to top', 'WpAdminStyle' ); ?>
</a>
<br class="clear"/>
</p>

<!-- Slider -->
<h2>Slider</h2>
<div id="slider"></div>

style="margin:3px 0 0 30px;">
<?php
_e(
'scroll to top',
'WpAdminStyle'
);
?>
</a><br class="clear"/></p>
<p>
<a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);"
style="margin:3px 0 0 30px;">
<?php _e( 'scroll to top', 'WpAdminStyle' ); ?>
</a>
<br class="clear"/>
</p>

<!-- Datepicker -->
<h2>Datepicker</h2>
Expand All @@ -655,55 +650,51 @@ class="ui-icon ui-icon-grip-diagonal-se"></span></li>
<p>John maintain a CSS file that you can include with WordPress plugins or themes to make the jQuery UI
Datepicker widget match WordPress color schemes. <a href="https://github.com/stuttter/wp-datepicker-styling">WP Datepicker Styling</a></p>

style="margin:3px 0 0 30px;">
<?php
_e(
'scroll to top',
'WpAdminStyle'
);
?>
</a><br class="clear"/></p>
<p>
<a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);"
style="margin:3px 0 0 30px;">
<?php _e( 'scroll to top', 'WpAdminStyle' ); ?>
</a>
<br class="clear"/>
</p>

<!-- Autocomplete -->
<h2 id="anker_autocomplete" class="demoAutocomplete">Autocomplete</h2>
<label for="autocomplete">Tags: </label>
<input id="autocomplete" type="text"/>

style="margin:3px 0 0 30px;">
<?php
_e(
'scroll to top',
'WpAdminStyle'
);
?>
</a><br class="clear"/></p>
<p>
<a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);"
style="margin:3px 0 0 30px;">
<?php _e( 'scroll to top', 'WpAdminStyle' ); ?>
</a>
<br class="clear"/>
</p>

<!-- Autocomplete -->
<h2 class="demoAutocompleteCore">Autocomplete (Core style) - needs work</h2>
<label for="autocomplete-core">Tags: </label>
<input id="autocomplete-core" type="text"/>

style="margin:3px 0 0 30px;">
<?php
_e(
'scroll to top',
'WpAdminStyle'
);
?>
</a><br class="clear"/></p>
<p>
<a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);"
style="margin:3px 0 0 30px;">
<?php _e( 'scroll to top', 'WpAdminStyle' ); ?>
</a>
<br class="clear"/>
</p>

<!-- Progressbar -->
<h2>Progressbar</h2>
<div id="progressbar"></div>

style="margin:3px 0 0 30px;">
<?php
_e(
'scroll to top',
'WpAdminStyle'
);
?>
</a><br class="clear"/></p>
<p>
<a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);"
style="margin:3px 0 0 30px;">
<?php _e( 'scroll to top', 'WpAdminStyle' ); ?>
</a>
<br class="clear"/>
</p>

<!-- Highlight / Error -->
<h2 id="anker_highlight">Highlight / Error</h2>
Expand All @@ -721,14 +712,13 @@ class="ui-icon ui-icon-grip-diagonal-se"></span></li>
</div>
</div>

style="margin:3px 0 0 30px;">
<?php
_e(
'scroll to top',
'WpAdminStyle'
);
?>
</a><br class="clear"/></p>
<p>
<a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);"
style="margin:3px 0 0 30px;">
<?php _e( 'scroll to top', 'WpAdminStyle' ); ?>
</a>
<br class="clear"/>
</p>

</div><!-- .wrap -->
<?php
Expand All @@ -737,7 +727,7 @@ class="ui-icon ui-icon-grip-diagonal-se"></span></li>
public function register_scripts() {
wp_enqueue_script(
'jquery-ui-demo',
plugin_dir_url( __FILE__ ) . '../js/jquery-ui-demo.js',
plugin_dir_url( dirname(__FILE__) ) . 'js/jquery-ui-demo.js',
array(
'jquery-ui-core',
'jquery-ui-accordion',
Expand All @@ -747,30 +737,35 @@ public function register_scripts() {
'jquery-ui-slider',
'jquery-ui-progressbar',
'jquery-ui-autocomplete',
'jquery-ui-progressbar',
),
false,
array(
'strategy' => 'defer',
'in_footer' => true
)
);

// wp_enqueue_style( 'jquery-ui-demo', plugin_dir_url( __FILE__ ) . '../css/jquery-ui-demo.css' );
$wp_scripts = wp_scripts();
wp_register_style(
'jquery-ui',
'http://ajax.googleapis.com/ajax/libs/jqueryui/' . $wp_scripts->registered['jquery-ui-core']->ver . '/themes/smoothness/jquery-ui.css'
'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $wp_scripts->registered['jquery-ui-core']->ver . '/themes/smoothness/jquery-ui.css'
);

if ( 'classic' === get_user_option( 'admin_color' ) ) {
wp_enqueue_style(
'jquery-ui-css',
plugin_dir_url( __FILE__ ) . '../css/jquery-ui-classic.css',
plugin_dir_url( dirname(__FILE__) ) . 'css/jquery-ui-classic.css',
array( 'jquery-ui' )
);
} else {
wp_enqueue_style(
'jquery-ui-css',
plugin_dir_url( __FILE__ ) . '../css/jquery-ui-fresh.css',
plugin_dir_url( dirname(__FILE__) ) . 'css/jquery-ui-fresh.css',
array( 'jquery-ui' )
);
}

wp_enqueue_style( 'jquery-ui-demo', plugin_dir_url( dirname(__FILE__) ) . 'css/jquery-ui-demo.css', ['jquery-ui', 'jquery-ui-css'] );
}

} // end class

0 comments on commit 20ccd3d

Please sign in to comment.