
let iconTemp='<span class="iconfont wraps" style="font-size: 1.5rem;">${icon}</span>'
let arrIcon=["&#xe9dc;","&#xe9db;","&#xe9da;","&#xe9d9;","&#xe9d8;","&#xe9d7;",
            "&#xe9d6;","&#xe9d5;","&#xe9d4;","&#xe9d0;","&#xe9ce;","&#xe9c8;",
            "&#xe9c5;","&#xe9c4;","&#xe9c3;","&#xe9c0;","&#xe9bf;","&#xe9bb;",
            "&#xe9ba;","&#xe9b9;","&#xe9b8;","&#xe9b7;","&#xe9b6;","&#xe9b5;",
            "&#xe9b4;","&#xe9b3;","&#xe9b2;","&#xe9b1;","&#xe9af;","&#xe9ab;",
            "&#xe9aa;","&#xe9a6;","&#xe9a5;","&#xe9a3;","&#xe99d;","&#xe99c;",
            "&#xe99b;","&#xe99a;","&#xe999;","&#xe998;","&#xe997;","&#xe996;",
            "&#xe995;","&#xe994;","&#xe993;","&#xe992;","&#xe991;","&#xe990;",
            "&#xe98f;","&#xe98e;","&#xe98d;","&#xe98b;","&#xe989;","&#xe988;",
            "&#xe78f;","&#xe78e;","&#xe783;","&#xe782;","&#xe781;","&#xe780;",
            "&#xe77f;","&#xe77e;","&#xe77d;","&#xe77c;","&#xe77b;"]


function find(dom)
{
    dom=dom.querySelector('[alert_private_id]')
    dom=$M.find(dom)
    dom.listener
    (
        'click','span',(event,dom)=>
        {
            $Edit.copyHide(dom,true)
        }
    )
}
            
$M.find('#icon').listener
(
    'tap',(event,dom)=>
    {
        let html=''
        for (let index = 0; index < arrIcon.length; index++) 
        {
            let cur=arrIcon[index]
            html+=iconTemp.replace('${icon}',cur)
        }
        html=`<div alert_private_id="com-alert-index-icon">${html}</div>`
        $M.dispatch('html','com-alert-update',{type:'set',message:html,fun:find})
    }
)



$M.find('#full').listener
(
    'tap',(event,dom)=>
    {
        $Draw.swap
        (
            dom,
            '全屏','退出',
            $Edit.full,$Edit.fullClose
        )
    }
)


$M.find('#ped').listener
(
    'tap',(event,dom)=>
    {
        $Draw.swap
        (
            dom,
            '编辑','预览',
            ()=>GlobalEditTag=true,
            ()=>GlobalEditTag=false 
        )
    }
)

$M.find('#spr').listener
(
    'tap',(event,dom)=>
    {
        $M.stopMenu()
    }
)

$M.find('#all').listener
(
    'tap',(event,dom)=>
    {
        $Route.push('layout@content@slideList')
    }
)

$M.find('#make').listener
(
    'tap',(event,dom)=>
    {
        let date=$Time.format('y_m_d h-i-s')
        let url='模板'+date+'.html'
        $Edit.save(url,'hello')
    }
)



$M.find('#makeSer').listener
(
    'tap',(event,dom)=>
    {
        let date=$Time.format('y_m_d h-i-s')
        let url='序列化'+date+'.json'
        $Edit.save(url,'hello')
    }
)



$M.find('#makeUnSer').listener
(
    'tap',async (event,dom)=>
    {
        try 
        {
            let files=await $Edit.file()
            let result=await $Edit.load(files[0])   
        } 
        catch (error) 
        {
            $M.info('文件选择错误',error)    
        }
    }
)