💥 Rename create_handle!() to new_handle!()
This commit is contained in:
parent
d786ea1052
commit
1e554aac68
40 changed files with 49 additions and 49 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(APP_DRUST);
|
||||
new_handle!(APP_DRUST);
|
||||
|
||||
struct Drust;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(APP_HELLO_NAME);
|
||||
new_handle!(APP_HELLO_NAME);
|
||||
|
||||
struct HelloName;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(APP_HELLO_WORLD);
|
||||
new_handle!(APP_HELLO_WORLD);
|
||||
|
||||
struct HelloWorld;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(MODULE_ADMIN);
|
||||
new_handle!(MODULE_ADMIN);
|
||||
|
||||
static_locales!(LOCALES_ADMIN);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(THEME_ALINER);
|
||||
new_handle!(THEME_ALINER);
|
||||
|
||||
static_files!(aliner);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use pagetop::prelude::*;
|
||||
use pagetop_jquery::JQuery;
|
||||
|
||||
create_handle!(THEME_BOOTSIER);
|
||||
new_handle!(THEME_BOOTSIER);
|
||||
|
||||
static_locales!(LOCALES_BOOTSIER);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use pagetop::prelude::*;
|
|||
use pagetop_jquery::JQuery;
|
||||
use pagetop_minimal::component::*;
|
||||
|
||||
create_handle!(THEME_BULMIX);
|
||||
new_handle!(THEME_BULMIX);
|
||||
|
||||
static_files!(bulmix);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use pagetop::prelude::*;
|
||||
use pagetop_minimal::component::*;
|
||||
|
||||
create_handle!(MODULE_HOMEDEMO);
|
||||
new_handle!(MODULE_HOMEDEMO);
|
||||
|
||||
static_locales!(LOCALES_HOMEDEMO);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(MODULE_JQUERY);
|
||||
new_handle!(MODULE_JQUERY);
|
||||
|
||||
static_locales!(LOCALES_JQUERY);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use pagetop::prelude::*;
|
||||
use pagetop_jquery::JQuery;
|
||||
|
||||
create_handle!(COMPONENT_MEGAMENUITEM);
|
||||
new_handle!(COMPONENT_MEGAMENUITEM);
|
||||
|
||||
type Label = OneComponent<L10n>;
|
||||
type Content = OneComponent<L10n>;
|
||||
|
|
@ -144,7 +144,7 @@ impl MegaMenuItem {
|
|||
|
||||
// MegaMenu.
|
||||
|
||||
create_handle!(COMPONENT_MEGAMENU);
|
||||
new_handle!(COMPONENT_MEGAMENU);
|
||||
|
||||
actions_for_component!(MegaMenu);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use pagetop::prelude::*;
|
|||
|
||||
pub mod component;
|
||||
|
||||
create_handle!(MODULE_MEGAMENU);
|
||||
new_handle!(MODULE_MEGAMENU);
|
||||
|
||||
static_files!(megamenu);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use pagetop::prelude::*;
|
|||
|
||||
use crate::component::Icon;
|
||||
|
||||
create_handle!(COMPONENT_ANCHOR);
|
||||
new_handle!(COMPONENT_ANCHOR);
|
||||
|
||||
#[derive(Default)]
|
||||
pub enum AnchorType {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(COMPONENT_BLOCK);
|
||||
new_handle!(COMPONENT_BLOCK);
|
||||
|
||||
actions_for_component!(Block);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(COMPONENT_CONTAINER);
|
||||
new_handle!(COMPONENT_CONTAINER);
|
||||
|
||||
actions_for_component!(Container);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(COMPONENT_BUTTON);
|
||||
new_handle!(COMPONENT_BUTTON);
|
||||
|
||||
#[derive(Default)]
|
||||
pub enum ButtonType {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(COMPONENT_DATE);
|
||||
new_handle!(COMPONENT_DATE);
|
||||
|
||||
#[rustfmt::skip]
|
||||
#[derive(Default)]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(COMPONENT_FORM);
|
||||
new_handle!(COMPONENT_FORM);
|
||||
|
||||
actions_for_component!(Form);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(COMPONENT_HIDDEN);
|
||||
new_handle!(COMPONENT_HIDDEN);
|
||||
|
||||
#[rustfmt::skip]
|
||||
#[derive(Default)]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(COMPONENT_INPUT);
|
||||
new_handle!(COMPONENT_INPUT);
|
||||
|
||||
#[derive(Default)]
|
||||
pub enum InputType {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(COMPONENT_COLUMN);
|
||||
new_handle!(COMPONENT_COLUMN);
|
||||
|
||||
actions_for_component!(Column);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use pagetop::prelude::*;
|
|||
|
||||
use crate::component::grid;
|
||||
|
||||
create_handle!(COMPONENT_ROW);
|
||||
new_handle!(COMPONENT_ROW);
|
||||
|
||||
actions_for_component!(Row);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(COMPONENT_HEADING);
|
||||
new_handle!(COMPONENT_HEADING);
|
||||
|
||||
#[derive(Default)]
|
||||
pub enum HeadingType {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(COMPONENT_ICON);
|
||||
new_handle!(COMPONENT_ICON);
|
||||
|
||||
#[rustfmt::skip]
|
||||
#[derive(Default)]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(COMPONENT_IMAGE);
|
||||
new_handle!(COMPONENT_IMAGE);
|
||||
|
||||
#[rustfmt::skip]
|
||||
#[derive(Default)]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(COMPONENT_PARAGRAPH);
|
||||
new_handle!(COMPONENT_PARAGRAPH);
|
||||
|
||||
#[derive(Default)]
|
||||
pub enum ParagraphDisplay {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use crate::{Minimal, LOCALES_MINIMAL};
|
|||
|
||||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(COMPONENT_POWEREDBY);
|
||||
new_handle!(COMPONENT_POWEREDBY);
|
||||
|
||||
#[derive(Default, Eq, PartialEq)]
|
||||
pub enum PoweredByLogo {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use pagetop::prelude::*;
|
|||
|
||||
pub mod component;
|
||||
|
||||
create_handle!(MODULE_MINIMAL);
|
||||
new_handle!(MODULE_MINIMAL);
|
||||
|
||||
static_locales!(LOCALES_MINIMAL);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
create_handle!(MODULE_NODE);
|
||||
new_handle!(MODULE_NODE);
|
||||
|
||||
static_locales!(LOCALES_NODE);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use pagetop::prelude::*;
|
||||
use pagetop_minimal::component::*;
|
||||
|
||||
create_handle!(MODULE_USER);
|
||||
new_handle!(MODULE_USER);
|
||||
|
||||
static_locales!(LOCALES_USER);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ macro_rules! actions_for_component {
|
|||
// ACTION BEFORE PREPARE COMPONENT
|
||||
// *************************************************************************************
|
||||
|
||||
$crate::create_handle!([<ACTION_BEFORE_PREPARE_ $Component:upper>] for Action);
|
||||
$crate::new_handle!([<ACTION_BEFORE_PREPARE_ $Component:upper>] for Action);
|
||||
|
||||
pub struct [<BeforePrepare $Component>] {
|
||||
action: Option<[<Action $Component>]>,
|
||||
|
|
@ -87,7 +87,7 @@ macro_rules! actions_for_component {
|
|||
// ACTION AFTER PREPARE COMPONENT
|
||||
// *************************************************************************************
|
||||
|
||||
$crate::create_handle!([<ACTION_AFTER_PREPARE_ $Component:upper>] for Action);
|
||||
$crate::new_handle!([<ACTION_AFTER_PREPARE_ $Component:upper>] for Action);
|
||||
|
||||
pub struct [<AfterPrepare $Component>] {
|
||||
action: Option<[<Action $Component>]>,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
use crate::core::component::{ComponentTrait, Context};
|
||||
use crate::html::{html, Markup, PrepareMarkup};
|
||||
use crate::{create_handle, fn_builder, Handle};
|
||||
use crate::{fn_builder, new_handle, Handle};
|
||||
|
||||
create_handle!(COMPONENT_HTML);
|
||||
new_handle!(COMPONENT_HTML);
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Html(Markup);
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
use crate::core::component::{ComponentTrait, Context};
|
||||
use crate::html::{html, PreEscaped, PrepareMarkup};
|
||||
use crate::locale::{Loader, Locales};
|
||||
use crate::{create_handle, fn_builder, Handle};
|
||||
use crate::{fn_builder, new_handle, Handle};
|
||||
|
||||
use std::collections::HashMap;
|
||||
|
||||
create_handle!(COMPONENT_L10N);
|
||||
new_handle!(COMPONENT_L10N);
|
||||
|
||||
#[derive(Default)]
|
||||
pub enum L10nOp {
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ use crate::core::theme::{ThemeRef, ThemeTrait};
|
|||
use crate::html::{Favicon, StyleSheet};
|
||||
use crate::response::page::Page;
|
||||
use crate::service;
|
||||
use crate::{create_handle, serve_static_files, static_files, Handle};
|
||||
use crate::{new_handle, serve_static_files, static_files, Handle};
|
||||
|
||||
create_handle!(THEME_DEFAULT);
|
||||
new_handle!(THEME_DEFAULT);
|
||||
|
||||
static_files!(theme);
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
//! ```rust
|
||||
//! use pagetop::prelude::*;
|
||||
//!
|
||||
//! create_handle!(APP_HELLO_WORLD);
|
||||
//! new_handle!(APP_HELLO_WORLD);
|
||||
//!
|
||||
//! struct HelloWorld;
|
||||
//!
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ pub use crate::{Handle, HashMapResources, LazyStatic, ResultExt, Weight};
|
|||
// Funciones y macros útiles.
|
||||
pub use crate::util;
|
||||
pub use crate::{action, actions_for_component};
|
||||
pub use crate::{create_handle, default_settings, kv};
|
||||
pub use crate::{default_settings, kv, new_handle};
|
||||
pub use crate::{serve_static_files, static_files, static_locales};
|
||||
|
||||
// API.
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
use crate::core::component::{ComponentTrait, Context};
|
||||
use crate::html::{html, PrepareMarkup};
|
||||
use crate::{create_handle, Handle};
|
||||
use crate::{new_handle, Handle};
|
||||
|
||||
create_handle!(ERROR_403);
|
||||
new_handle!(ERROR_403);
|
||||
|
||||
pub struct Error403;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
use crate::core::component::{ComponentTrait, Context};
|
||||
use crate::html::{html, PrepareMarkup};
|
||||
use crate::{create_handle, Handle};
|
||||
use crate::{new_handle, Handle};
|
||||
|
||||
create_handle!(ERROR_404);
|
||||
new_handle!(ERROR_404);
|
||||
|
||||
pub struct Error404;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
use crate::core::action::{action_ref, run_actions, ActionTrait};
|
||||
use crate::response::page::action::ActionPage;
|
||||
use crate::response::page::Page;
|
||||
use crate::{create_handle, Handle, Weight};
|
||||
use crate::{new_handle, Handle, Weight};
|
||||
|
||||
create_handle!(ACTION_AFTER_PREPARE_BODY for Action);
|
||||
new_handle!(ACTION_AFTER_PREPARE_BODY for Action);
|
||||
|
||||
pub struct ActionAfterPrepareBody {
|
||||
action: Option<ActionPage>,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
use crate::core::action::{action_ref, run_actions, ActionTrait};
|
||||
use crate::response::page::action::ActionPage;
|
||||
use crate::response::page::Page;
|
||||
use crate::{create_handle, Handle, Weight};
|
||||
use crate::{new_handle, Handle, Weight};
|
||||
|
||||
create_handle!(ACTION_BEFORE_PREPARE_BODY for Action);
|
||||
new_handle!(ACTION_BEFORE_PREPARE_BODY for Action);
|
||||
|
||||
pub struct ActionBeforePrepareBody {
|
||||
action: Option<ActionPage>,
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ macro_rules! default_settings {
|
|||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! create_handle {
|
||||
macro_rules! new_handle {
|
||||
( $HANDLE:ident ) => {
|
||||
/// Public constant handle to represent a unique PageTop building element.
|
||||
pub const $HANDLE: $crate::Handle =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue