Site Notice

hello, world

Difference between revisions of "中文变量名"

From Project-EPB Commons
([InPageEdit] 没有编辑摘要)
([InPageEdit] 没有编辑摘要)
Line 8: Line 8:
 
     用户名 = 常用变量.wgUserName,
 
     用户名 = 常用变量.wgUserName,
 
     内容,
 
     内容,
     空值 = null,
+
     空值 = null;
    对话框 = 'dialog',
 
    真 = true, 假 = false;
 
 
   if (用户名 === 空值) {
 
   if (用户名 === 空值) {
 
     内容 = '你尚未登录 ' + 网站名 +'!';
 
     内容 = '你尚未登录 ' + 网站名 +'!';
Line 18: Line 16:
 
   模态框.show({
 
   模态框.show({
 
     title: 标题,
 
     title: 标题,
     content: 内容
+
     content: 内容,
 +
    center: 真,
 +
    sizeClass: 对话框
 
   });
 
   });
 
}
 
}

Revision as of 03:18, 24 January 2020

<html> <button onclick="函数()">点击这里,执行函数</button> *字面意思 <script> function 函数() { var 模态框 = ssi_modal,

   常用变量 = mw.config.get(['wgSiteName','wgUserName']),
   标题 = 网站名 = 常用变量.wgSiteName,
   用户名 = 常用变量.wgUserName,
   内容,
   空值 = null;
 if (用户名 === 空值) {
   内容 = '你尚未登录 ' + 网站名 +'!';
 } else {
   内容 = '你的用户名是: ' + 用户名;
 }
 模态框.show({
   title: 标题,
   content: 内容,
   center: 真,
   sizeClass: 对话框
 });

} </script> </html>

function 函数() {
var 模态框 = ssi_modal,
    常用变量 = mw.config.get(['wgSiteName','wgUserName']),
    标题 = 网站名 = 常用变量.wgSiteName,
    用户名 = 常用变量.wgUserName,
    内容,
    空值 = null;
  if (用户名 === 空值) {
    内容 = '你尚未登录 ' + 网站名 +'!';
  } else {
    内容 = '你的用户名是: ' + 用户名;
  }
  模态框.show({
    title: 标题,
    content: 内容,
    center: 真,
    sizeClass: 对话框
  });
}