Esempio n. 1
0
 /**
  * Reset the compatibility settings.
  *
  * @return string
  */
 public function resetSmallScreens()
 {
     delete_option('rpbchessboard_smallScreenCompatibility');
     delete_option('rpbchessboard_smallScreenModes');
     RPBChessboardHelperCache::remove('small-screens.css');
     return self::resetMessage();
 }
Esempio n. 2
0
 /**
  * Update the plugin general options.
  *
  * @return string
  */
 public function updateOptions()
 {
     // General parameters
     self::processSquareSize();
     self::processBooleanParameter('showCoordinates');
     self::processPieceSymbols();
     self::processNavigationBoard();
     self::processAnimationSpeed();
     self::processBooleanParameter('showMoveArrow');
     // Compatibility parameters.
     self::processBooleanParameter('fenCompatibilityMode');
     self::processBooleanParameter('pgnCompatibilityMode');
     // Small-screen parameters
     self::processBooleanParameter('smallScreenCompatibility');
     self::processSmallScreenModes();
     RPBChessboardHelperCache::remove('small-screens.css');
     // Notify the user.
     return __('Settings saved.', 'rpbchessboard');
 }
Esempio n. 3
0
 public static function register()
 {
     // jQuery
     wp_enqueue_style('wp-jquery-ui-dialog');
     // Chess fonts
     wp_enqueue_style('rpbchessboard-chessfonts', RPBCHESSBOARD_URL . 'fonts/chess-fonts.css', false, RPBCHESSBOARD_VERSION);
     // Custom widgets
     wp_enqueue_style('rpbchessboard-chessboard', RPBCHESSBOARD_URL . 'css/uichess-chessboard.css', false, RPBCHESSBOARD_VERSION);
     wp_enqueue_style('rpbchessboard-chessgame', RPBCHESSBOARD_URL . 'css/uichess-chessgame.css', false, RPBCHESSBOARD_VERSION);
     // Small-screens
     RPBChessboardHelperCache::ensureExists('small-screens.css', 'Misc/SmallScreens', 'Misc/SmallScreens');
     wp_enqueue_style('rpbchessboard-smallscreens', RPBChessboardHelperCache::getURL('small-screens.css'), false, RPBChessboardHelperCache::getVersion('small-screens.css'));
     // Additional CSS for the backend.
     if (is_admin()) {
         wp_enqueue_style('rpbchessboard-jquery-ui-smoothness', RPBCHESSBOARD_URL . 'third-party-libs/jquery/jquery-ui.smoothness.min.css', false, '1.11.4');
         wp_enqueue_style('rpbchessboard-backend', RPBCHESSBOARD_URL . 'css/backend.css', false, RPBCHESSBOARD_VERSION);
     } else {
         wp_enqueue_style('rpbchessboard-frontend', RPBCHESSBOARD_URL . 'css/frontend.css', false, RPBCHESSBOARD_VERSION);
     }
 }