Changeset 2251591
- Timestamp:
- 02/27/2020 08:19:08 PM (6 years ago)
- Location:
- scss-library/trunk
- Files:
-
- 7 edited
-
languages/scsslib-es_ES.mo (modified) (previous)
-
languages/scsslib-es_ES.po (modified) (4 diffs)
-
languages/scsslib.pot (modified) (2 diffs)
-
scss-library.php (modified) (1 diff)
-
src/ScssLibrary.php (modified) (3 diffs)
-
src/Settings/ScssLibrary.php (modified) (1 diff)
-
vendor/autoload.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
scss-library/trunk/languages/scsslib-es_ES.po
r2250232 r2251591 5 5 "Project-Id-Version: scsslib\n" 6 6 "Report-Msgid-Bugs-To: \n" 7 "POT-Creation-Date: 2020-02-2 5 17:28-0500\n"8 "PO-Revision-Date: 2020-02-2 5 17:29-0500\n"7 "POT-Creation-Date: 2020-02-27 11:19-0500\n" 8 "PO-Revision-Date: 2020-02-27 11:19-0500\n" 9 9 "Last-Translator: Juan Sebastián Echeverry <baxtian.echeverry@gmail.com>\n" 10 10 "Language-Team: Juan Sebastián Echeverry <baxtian.echeverry@gmail.com>\n" … … 16 16 "X-Poedit-Basepath: .\n" 17 17 "Plural-Forms: nplurals=2; plural=(n != 1);\n" 18 "X-Generator: Poedit 2. 2.4\n"18 "X-Generator: Poedit 2.3\n" 19 19 "X-Poedit-SourceCharset: UTF-8\n" 20 20 "X-Poedit-SearchPath-0: ..\n" 21 21 22 #: ../src/ScssLibrary.php:1 4622 #: ../src/ScssLibrary.php:153 23 23 msgid "Source file not found." 24 24 msgstr "Archivo fuente no encontrado." 25 25 26 #: ../src/ScssLibrary.php:1 6426 #: ../src/ScssLibrary.php:171 27 27 msgid "" 28 28 "File Permissions Error, unable to create cache directory. Please make sure " … … 32 32 "Asegúrese de que el directorio <i>uploads</i> de Wordpress sea editable." 33 33 34 #: ../src/ScssLibrary.php:1 7734 #: ../src/ScssLibrary.php:184 35 35 msgid "" 36 36 "File Permissions Error, permission denied. Please make the cache directory " … … 40 40 "permisos del directorio de caché para que sea editable." 41 41 42 #: ../src/ScssLibrary.php:335 42 #: ../src/ScssLibrary.php:308 43 #, php-format 44 msgid "" 45 "The development mode from the <strong>SCSS-Library</strong> is active. " 46 "Remember to <a href='%s'>deactivate it</a> in case this is a production " 47 "environment." 48 msgstr "" 49 "El modo de desarrollo de <strong>SCSS-Library</strong> está activo. Recuerde " 50 "<a href='%s'>desactivarlo</a> en caso de que este sea un entorno de " 51 "producción." 52 53 #: ../src/ScssLibrary.php:340 54 msgid "SCSS Library" 55 msgstr "SCSS Library" 56 57 #: ../src/ScssLibrary.php:355 58 msgid "Recompile SCSS files" 59 msgstr "Recompilar archivos SCSS" 60 61 #: ../src/ScssLibrary.php:364 62 msgid "Deactivate development mode" 63 msgstr "Desactivar modo de desarrollo" 64 65 #: ../src/ScssLibrary.php:371 66 msgid "Activate development mode" 67 msgstr "Activar modo de desarrollo" 68 69 #: ../src/ScssLibrary.php:433 43 70 msgid "Sass Compiling Error" 44 71 msgstr "Error de compilación Sass" 45 72 46 73 #: ../src/Settings/ScssLibrary.php:29 47 msgid "S cssCompiler"48 msgstr "Compilador S css"74 msgid "SCSS Compiler" 75 msgstr "Compilador SCSS" 49 76 50 77 #: ../src/Settings/ScssLibrary.php:44 -
scss-library/trunk/languages/scsslib.pot
r2250232 r2251591 6 6 "Project-Id-Version: scsslib\n" 7 7 "Report-Msgid-Bugs-To: \n" 8 "POT-Creation-Date: 2020-02-2 5 17:28-0500\n"8 "POT-Creation-Date: 2020-02-27 11:19-0500\n" 9 9 "PO-Revision-Date: 2014-10-09 21:36-0500\n" 10 10 "Last-Translator: Juan Sebastián Echeverry <baxtian.echeverry@gmail.com>\n" … … 17 17 "X-Poedit-Basepath: .\n" 18 18 "Plural-Forms: nplurals=2; plural=n != 1;\n" 19 "X-Generator: Poedit 2. 2.4\n"19 "X-Generator: Poedit 2.3\n" 20 20 "X-Poedit-SourceCharset: UTF-8\n" 21 21 "X-Poedit-SearchPath-0: ..\n" 22 22 23 #: ../src/ScssLibrary.php:1 4623 #: ../src/ScssLibrary.php:153 24 24 msgid "Source file not found." 25 25 msgstr "" 26 26 27 #: ../src/ScssLibrary.php:1 6427 #: ../src/ScssLibrary.php:171 28 28 msgid "File Permissions Error, unable to create cache directory. Please make sure the Wordpress Uploads directory is writable." 29 29 msgstr "" 30 30 31 #: ../src/ScssLibrary.php:1 7731 #: ../src/ScssLibrary.php:184 32 32 msgid "File Permissions Error, permission denied. Please make the cache directory writable." 33 33 msgstr "" 34 34 35 #: ../src/ScssLibrary.php:335 35 #: ../src/ScssLibrary.php:308 36 #, php-format 37 msgid "The development mode from the <strong>SCSS-Library</strong> is active. Remember to <a href='%s'>deactivate it</a> in case this is a production environment." 38 msgstr "" 39 40 #: ../src/ScssLibrary.php:340 41 msgid "SCSS Library" 42 msgstr "" 43 44 #: ../src/ScssLibrary.php:355 45 msgid "Recompile SCSS files" 46 msgstr "" 47 48 #: ../src/ScssLibrary.php:364 49 msgid "Deactivate development mode" 50 msgstr "" 51 52 #: ../src/ScssLibrary.php:371 53 msgid "Activate development mode" 54 msgstr "" 55 56 #: ../src/ScssLibrary.php:433 36 57 msgid "Sass Compiling Error" 37 58 msgstr "" 38 59 39 60 #: ../src/Settings/ScssLibrary.php:29 40 msgid "S cssCompiler"61 msgid "SCSS Compiler" 41 62 msgstr "" 42 63 -
scss-library/trunk/scss-library.php
r2250262 r2251591 4 4 Description: Adds support for SCSS stylesheets to wp_enqueue_style. 5 5 Author: Juan Sebastián Echeverry 6 Version: 0.2. 06 Version: 0.2.3 7 7 Text Domain: scsslib 8 8 -
scss-library/trunk/src/ScssLibrary.php
r2250232 r2251591 54 54 add_filter('style_loader_src', [$this, 'style_loader_src'], 10, 2); 55 55 add_action('wp_footer', array($this, 'wp_footer')); 56 add_action('admin_notices', [$this, 'admin_notices']); 57 add_action('admin_bar_menu', [$this, 'admin_bar_menu'], 100); 56 58 57 59 $this->modo_desarrollo = false; … … 100 102 } 101 103 102 // ¿Ya sabe smos queestamos en modo de desarrollo?104 // ¿Ya sabemos si estamos en modo de desarrollo? 103 105 if(!$this->modo_desarrollo) { 104 106 // Determinar si hubo un cambio 105 107 $opciones = get_option('scsslibrary'); 108 109 // El modo de desarrollo se presenta porque este la opción develop activa 110 // en las opciones del plugin, porque esté definido WP_DEBUG o porque ne la url esté el atributo recompile_scss_files 106 111 $this->modo_desarrollo = ( 107 112 (isset($opciones['develop']) && $opciones['develop']) || 108 (defined('WP_DEBUG') && WP_DEBUG === true) 113 (defined('WP_DEBUG') && WP_DEBUG === true) || 114 (isset($_GET['recompile_scss_files'])) || 115 (isset($_GET['activate_scss_library_devmode'])) 109 116 ) ? true : false; 110 117 } … … 276 283 // venían en la URL del archivo fuente. 277 284 return empty($url['query']) ? $outputUrl : $outputUrl . '?' . $url['query']; 285 } 286 287 /** 288 * Los mensajes para ser desplegados en la parte duperior del dashboard. 289 * De momento muestra una advertencia si estamos en modo de desarrollador 290 */ 291 public function admin_notices() :void { 292 // Leer de la sopciones si estamos en modo develop 293 $opciones = get_option('scsslibrary'); 294 295 //Si hay un parámetro por get para desactivar el modo de desarrollo, desactivarlo 296 if(isset($_GET['deactivate_scss_library_development_mode'])) { 297 $opciones['develop'] = false; 298 update_option('scsslibrary', $opciones); 299 } 300 301 if(isset($opciones['develop']) && $opciones['develop'] === true) { 302 $url = parse_url($_SERVER['REQUEST_URI']); 303 parse_str($url['query'], $query); 304 $query['deactivate_scss_library_development_mode'] = true; 305 $url['query'] = http_build_query($query); 306 $url = $url['path'] . '?' . $url['query']; 307 308 $text = sprintf(__("The development mode from the <strong>SCSS-Library</strong> is active. Remember to <a href='%s'>deactivate it</a> in case this is a production environment.", 'scsslib'), $url); 309 printf('<div class="error"><p>%s</p></div>', $text); 310 } 311 } 312 313 /** 314 * Abregar items a la barra de administración para manejar scss-library 315 * @param Object $admin_bar Barra de administración 316 */ 317 public function admin_bar_menu($admin_bar): void { 318 // Solo los usuarios con permisos para editar temas pueden tener 319 // acceso a estas acciones 320 if(current_user_can('edit_theme_options')) { 321 322 // Items para habilitar o deshabilitar 323 $opciones = get_option('scsslibrary'); 324 325 // ¿Activar el modo de desarrollo? 326 if(isset( $_GET['activate_scss_library_devmode'] )) { 327 $opciones['develop'] = true; 328 update_option('scsslibrary', $opciones); 329 } 330 331 // ¿Desactivar el modo de desarrollo? 332 if(isset( $_GET['deactivate_scss_library_devmode'] )) { 333 $opciones['develop'] = false; 334 update_option('scsslibrary', $opciones); 335 } 336 337 // Item contenedor principal 338 $admin_bar->add_menu( array( 339 'id' => 'scss-library', 340 'title' => __('SCSS Library', 'scsslib'), 341 'href' => '#', 342 'meta' => array( 343 'class' => $opciones['develop'] ? 'sl-alert' : '', 344 'html' => "<style> 345 #wpadminbar .menupop.sl-alert > a.ab-item { color: white; background: #9c3e3d; } 346 </style>" 347 ) 348 )); 349 350 // Elementos para la URL 351 $url = parse_url($_SERVER['REQUEST_URI']); 352 parse_str($url['query'], $query); 353 $query1['recompile_scss_files'] = true; 354 $query2['deactivate_scss_library_devmode'] = true; 355 $query3['activate_scss_library_devmode'] = true; 356 357 // Sub item para recompilar 358 $admin_bar->add_menu( array( 359 'id' => 'clear-scss', 360 'parent' => 'scss-library', 361 'title' => __('Recompile SCSS files', 'scsslib'), 362 'href' => $url['path'] . '?' . http_build_query($query1), 363 )); 364 365 // Si no está activo el develop 366 if (isset($opciones['develop']) && $opciones['develop'] ) { 367 $admin_bar->add_menu( array( 368 'id' => 'deactivate-scss-devmode', 369 'parent' => 'scss-library', 370 'title' => __('Deactivate development mode', 'scsslib'), 371 'href' => $url['path'] . '?' . http_build_query($query2), 372 'meta' => array( 373 'class' => 'sl-active', 374 'html' => "<style> 375 #wpadminbar .ab-submenu .sl-active > a.ab-item { color: white; background: #9c3e3d; } 376 </style>" 377 ) 378 )); 379 } else { 380 $admin_bar->add_menu( array( 381 'id' => 'activate-scss-devmode', 382 'parent' => 'scss-library', 383 'title' => __('Activate development mode', 'scsslib'), 384 'href' => $url['path'] . '?' . http_build_query($query3) 385 )); 386 } 387 } 278 388 } 279 389 -
scss-library/trunk/src/Settings/ScssLibrary.php
r2250253 r2251591 27 27 'scsslibrary', 28 28 array( 29 'title' => __('S cssCompiler', 'scsslib'),29 'title' => __('SCSS Compiler', 'scsslib'), 30 30 ) 31 31 ); -
scss-library/trunk/vendor/autoload.php
r2250246 r2251591 5 5 require_once __DIR__ . '/composer/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit ff69a621beb925ab247ba89a2b55463b::getLoader();7 return ComposerAutoloaderInit96136f5df1573d3a05c847bf369c6432::getLoader();
Note: See TracChangeset
for help on using the changeset viewer.