PHPIndex

This page lists files in the current directory. You can view content, get download/execute commands for Wget, Curl, or PowerShell, or filter the list using wildcards (e.g., `*.sh`).

images
oauth
main.css
wget 'https://sme10.lists2.roe3.org/kodbox/plugins/oauth/static/main.css'
View Content
/* 登录页 */
.page-model-login .more-login-area {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
    width: 90%;
    /* margin: 20px auto 20px; */
    margin: 10px auto 15px;
}
.page-model-login .more-login-area .more-login-words {
    position: relative;
    top: 9px;
    padding: 4px 10px;
    border-radius: 20px;
    background: #fff;
    font-size: 0.9em;
}

.page-model-login .login-third-box{
    height: 30px;
    line-height: 30px;
}
.page-model-login .login-third-box .third-item {
    display: inline-block;
    cursor: pointer;
    /* width: 35px;
    height: 30px;
    background: url("../../../static/images/common/icon-sn-cr.png") -80px 0px no-repeat; */
    font-size: 20px;
    margin: 0px 3px;
}

.page-model-login .login-third-box .third-item:active,
.page-model-login .login-third-box .third-item:hover {opacity: 0.6;}
/* .page-model-login .login-third-box .box-qq {background-position:-80px 0px;}
.page-model-login .login-third-box .box-weixin {background-position:-248px 0px;}
.page-model-login .login-third-box .box-github {background-position:-24px 0px;}
.page-model-login .login-third-box .box-google {background-position:4px 0px;}
.page-model-login .login-third-box .box-facebook {background-position:-136px -0px;} */

/* 插件配置 */
.app-config-oauth.dialog-plugin-config .panel-form-body .form-row[data-key=list] .type-list p{
    /* height: 32px;line-height: 32px; */
    height: 28px;line-height: 28px;
}
.app-config-oauth.dialog-plugin-config .panel-form-body .form-row[data-key=list] .type-list p>i{
    display: inline-block; 
    width: 30px;
    text-align: left;
}
.app-config-oauth.dialog-plugin-config .panel-form-body .form-row[data-key=list] .type-list p>span{
    display: inline-block; 
    width: calc(100% - 120px);
    text-align: left;
}
.app-config-oauth.dialog-plugin-config .panel-form-body .form-row[data-key=list] .type-list .fq-desc{
    font-size: 0.8em;
    color: #949494;
    display: block;
    /* text-align: center; */
    padding-left: 30px;
}
.app-config-oauth.dialog-plugin-config .panel-form-body .form-row[data-key=list] .type-list .web-url{
    color: #949494;
}

/* 插件接口描述 */
.admin-main-content .plugin-page .app-descript .data-app[data-app='oauth']+.right-content .api-title{
    display: inline-block;
    width: 80px;
}

.font-icon.ri-qq-fill.with-color{color: #199ae3 !important;}
.font-icon.ri-wechat-fill.with-color{color: #1ab31e !important;}
.font-icon.ri-github-fill.with-color{color: #333333 !important;}
.font-icon.ri-google-fill.with-color{color: #3785f3 !important;}
.font-icon.ri-facebook-fill.with-color{color: #4964a1 !important;}

/* .bindlogin.artDialog #wxqrcode>iframe {height: 365px;} */
main.js
wget 'https://sme10.lists2.roe3.org/kodbox/plugins/oauth/static/main.js'
View Content
kodReady.push(function(){
    var staticPath = "{{pluginHost}}static/";
	var version    = '?v={{package.version}}';

    LNG.set(jsonDecode(urlDecode("{{LNG}}")));
    var thirdItems = {
        "qq":       "QQ",
        "weixin":   LNG['common.wechat'],
        "github":   "GitHub",
        "google":   "Google",
        "facebook": "Facebook"
    };
    // 获取第三方登录项
    var getLoginWith = function(){
        if (!_.isUndefined(G.system.options.loginWith)) {
            return G.system.options.loginWith;
        }
        return _.join((_.get(G, 'system.options.loginConfig.loginWith') || []), ',');
    }

    // 1.后台设置
    Events.bind("admin.setting.initViewBefore",function(formData, options, self){
        var loginWith = getLoginWith();
        // 无法插入到指定属性(openRegist)之前,只能在定义处加初始值
        formData.loginWith = {
			"type":     "checkbox",
			"value":    loginWith,
			"display":  LNG['admin.setting.thirdLogin'],
			"desc":     LNG['admin.setting.thirdLoginDesc'],
			"info":     thirdItems
		};
        formData.sep401 = '<hr>';
	});

    // 2.插件设置
    Events.bind("plugin.config.formBefore", function(formData, options, self){
        if (_.get(options, 'id') != 'app-config-{{pluginName}}') return;
        var list = [];
        var loginWith = getLoginWith();
        var logins = loginWith ? _.split(loginWith, ',') : [];
        _.each(thirdItems, function(title, type){
            var opt = "";
            var web = "";
            if (_.includes(['google', 'facebook'], type)) {
                if (type == 'google') {
                    opt = "<hr><span class='fq-desc mb-10'>"+LNG['oauth.config.fqDesc']+"</span>";
                }
                web = "<span class='web-url'>(https://"+type+".com)</span>";
            }
            var icon = type == 'weixin' ? 'wechat' : type;
            var checked = _.includes(logins, type) ? 'checked="checked"' : '';
            opt += "<p class='mb-5'><i class='font-icon ri-"+icon+"-fill with-color'></i><span>"+title+web+"</span>\
                <input type='checkbox' name='type' value='"+type+"' class='kui-checkbox' "+checked+">\
                </p>";
            list.push(opt);
        });
        formData.list.value = "<div class='type-list'>"+(_.join(list,''))+"</div>";
        formData.loginWith.value = loginWith;
    });
    Events.bind("plugin.config.formAfter", function(_this){
        var form = _this['form{{pluginName}}'];
		if (!form || !form.$el) return;

        // 可能保存失败,暂不做处理
        form.bind('onSave', function(result){
            var loginWith = [];
            form.$("input[name=type]").each(function(){
                if ($(this).is(":checked")) {
                    loginWith.push($(this).val());
                }
            });
            result.loginWith = _.join(loginWith, ',');
            G.system.options.loginConfig.loginWith = loginWith;
            G.system.options.loginWith = result.loginWith;
        });
    });

    // 3.个人中心设置
    Events.bind('user.account.initViewAfter', function(self){
        var loginWith = getLoginWith();
        if (!loginWith) return;
        requireAsync([
            staticPath+'oauth/user.js' + version,
            staticPath+'oauth/bind.js' + version,
        ],function(User, Bind){
            new User({parent:self, load: {thirdItems: thirdItems, loginWith: loginWith}, Bind: Bind});
        });
    });

    // 4.登录页
    // Events.bind("router.after.user/login",function(){
    Events.bind("user.login.initViewAfter",function(self){
        var loginWith = getLoginWith();
        if (!loginWith) return;
		requireAsync([
            staticPath+'oauth/login.js' + version,
            staticPath+'oauth/bind.js' + version,
        ],function(Login, Bind){
            new Login({parent:self, load: {thirdItems: thirdItems, loginWith: loginWith, pluginApi: "{{pluginApi}}"}, Bind: Bind});
        });
	});

    if($.hasKey('plugin.{{package.id}}.event')) return;

    // 5.日志列表解析
    ClassBase.extendHook({
		hookMatch:'dataParseHtmlItem,dataParseOthers,dataParseUsers',
		dataParseUsers:function(){
			var type = arguments[0];
			var desc = arguments[1];
            if (_.startsWith(type, 'user.bind')) {
                var title = thirdItems[desc.type] || '';
                return [LNG['common.type'] + ':' + title];
            }
			return this.__dataParseUsers.apply(this,arguments);
		},
        normalActionGet: function(){
            var item = arguments[0];
            if (_.startsWith(item.type, 'user.bind')) {
                var actions = {
                    'user.bind.bind':   ['user', 'user'],
			        'user.bind.unbind': ['user', 'user-unbind']
                };
                return actions[item.type] || ['', ''];
            }
            return this.__normalActionGet.apply(this,arguments);
        }
	});

    if($.hasKey('plugin.{{package.id}}.style')) return;
	requireAsync("{{pluginHost}}static/main.css");
});