How to use the watch.SendMessage function in watch

To help you get started, we’ve selected a few watch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Kenshin / simpread / src / options / options.js View on Github external
function vernotify( first ) {
    const hash = location.hash;
    if ( hash.startsWith( "#firstload?ver=" ) || hash.startsWith( "#update?ver=" ) ) {
        const prefix  = hash.match( /\w+/      )[0],
              version = hash.match( /[0-9\.]+/ )[0],
              msg     = ver.Notify( first, prefix, version );

        new Notify().Render( "简悦 版本提示", msg );

        loadState = { first: true };
        if ( hash.startsWith( "#update?ver=" )) {
            watch.SendMessage( "version", true );
            loadState = { first: true, update: true };
            welcomeRender( false, version );
            ///////////////////////////////////////////////////////////////////////////
            // hard code
            // option.origins rework
            storage.option.origins = storage.option.origins.filter( item => item != "http://sr.ksria.cn/origins/website_list_en.json" && item != "http://sr.ksria.cn/origins/website_list_tw.json" ) 
            if ( storage.option.origins.length > 0 ) {
                new Notify().Render( `检测到你曾经修改过第三方适配源,请重新导入,详细说明 <a href="http://ksria.com/simpread/docs/#/站点适配源?id=重新导入">请看这里</a>`, "确认", () =&gt; {
                    tabChange( 3 );
                });
            }
            ///////////////////////////////////////////////////////////////////////////
            // verify and remove old plugins
            ver.VerifyPlugins( storage.option, version ) &amp;&amp; storage.Write( () =&gt; {
                new Notify().Render({ content: `新版升级后,会自动删除一些已失效的插件,详细请看 <a href="http://ksria.com/simpread/welcome/version_${version}.html#badplugins">自定义主题</a>`, state: "holdon" });
            }, storage.simpread );
github Kenshin / simpread / src / options / sitemgr.js View on Github external
flag != -1 && storage.Writesite( pr.sites, ()=> {
                console.log( "current site is ", cur_site, org_site )
                watch.SendMessage( "site", true );
                new Notify().Render( `当前站点${ flag == 0 ? "更新" : "删除" }成功,请刷新本页。` );
            });
        };
github Kenshin / simpread / src / module / account.jsx View on Github external
storage.Write( () => {
                console.log( "current user info is ", storage.user )
                this.setState({ uid_err : "" });
                watch.SendMessage( "option", true );
            }, storage.simpread );
        }
github Kenshin / simpread / src / module / sitebar.jsx View on Github external
storage.Writesite( storage.pr.sites, ()=> {
            console.log( "current site is ", storage.pr.sites )
            watch.SendMessage( "site", true );
            new Notify().Render( "已成功切到换到此适配站点,请刷新本页。" );
        });
    }
github Kenshin / simpread / src / module / notice.jsx View on Github external
storage.Write( () => {
        console.log( "current notice is ", storage.notice )
        watch.SendMessage( "option", true );
        callback && callback();
    });
}
github Kenshin / simpread / src / options / custom.js View on Github external
storage.Write( () => {
            watch.SendMessage( "option", true );
            state == "clear" ? 
                new Notify().Render( "snackbar", "清除成功,此页面需刷新后才能生效!", "刷新 ", ()=>{
                    location.href = location.origin + location.pathname;
                })
            : new Notify().Render( 0, "保存成功,页面刷新后生效!" );
        });
    };
github Kenshin / simpread / src / options / options.js View on Github external
storage.Write( ()=> {
                    watch.SendMessage( "option", true );
                    state && new Notify().Render( 0, "保存成功,页面刷新后生效!" );
                });
          };
github Kenshin / simpread / src / module / plugins.jsx View on Github external
writecb() {
        watch.SendMessage( "option", true );
    }

watch

Utilities for watching file trees.

Apache-2.0
Latest version published 7 years ago

Package Health Score

65 / 100
Full package analysis