Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大家可以在这里提交建议 #1

Open
RubyLouvre opened this issue Feb 16, 2012 · 6 comments
Open

大家可以在这里提交建议 #1

RubyLouvre opened this issue Feb 16, 2012 · 6 comments

Comments

@RubyLouvre
Copy link
Owner

比如你做一个插件,可以写在这里来。或者发现某个模块发了BUG,或者有什么改进的好建议!

@q13
Copy link

q13 commented Jul 31, 2012

拜读mass.js,innerDefine偷换scope做的高明啊,这都咋想的啊,佩服

@lzzwoodtree
Copy link

26页,checkDeps方法 
function checkDeps(){
    for (var i = 0, len = loadings.length; i < len; i++){
        var completed = true,
        module = modules[loadings[i]],
        deps = module.deps;
        for (var p in deps){
            if (deps.hasOwnProperty(p) && modules[p].state !== 2){
                completed = false;
            }
        }

        if (completed && modules[loadings[i]].state !== 2){
            loadings.splice(i, 1);
            fireFactory(module);
            checkDeps();
        }
    }
}

不明白作者为什么用loop标签这种形式,感觉用以上方式可读性更强一些

@keith990
Copy link

是的,整体感觉mass用了过多的晦涩的写法,作者有点炫技的意思

On Tue, Apr 29, 2014 at 11:26 PM, ZeZheng Li [email protected]:

function checkDeps(){
for (var i = 0, len = loadings.length; i < len; i++){
var completed = true,
module = modules[loadings[i]],
deps = module.deps;
for (var p in deps){
if (deps.hasOwnProperty(p) && modules[p].state !== 2){
completed = false;
}
}

    if (completed && modules[loadings[i]].state !== 2){
        loadings.splice(i, 1);
        fireFactory(module);
        checkDeps();
    }
}

}

不明白作者为什么用loop标签这种形式,感觉用以上方式可读性更强一些


Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-41690779
.

@jackiecookie
Copy link

attr模块

        "option:get": function() {
            //node is not defined     
            //这里的参数是不小心删了,还是我的用法问题?
            if (node.hasAttribute) {
                return node.hasAttribute("value") ? node.value : node.text.trim()
            }




测试代码


<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
        <title>massLang 测试页面</title>
        <meta http-equiv="Pragma" content="no-cache">
        <meta http-equiv="Cache-Control" content="no-cache">
        <meta http-equiv="Expires" content="0">
         <script type="text/javascript" src="..\mass.js"></script>
      <script type="text/javascript">
        require(["/node","/attr"],function() {
          var aaa=    $('#sElm').val();


        })

      </script>
      <style>
      .hide{
         display: none;
      }
      </style>
    </head>
    <body id="by">
     <div ></div>
     <span class="hide"></span>

     <input type="text">
     <select  id="sElm">
      <option value="test">aaaa</option>
     </select>
    </body>
</html>

@jackiecookie
Copy link

<!DOCTYPE html>
<html>
    <head>
         <script type="text/javascript" src="..\mass.js"></script>
       < script type = "text/javascript" >
        require(["/node", "/attr"], function() {
          var aaa = $('#sElm').val();
        })
       < /script>
    </head>
    <body >
     <select  id="sElm">
      <option value="test">aaaa</option>
     </select>
    </body>
</html>

@RubyLouvre
Copy link
Owner Author

attr模块,那个是最近从avalon里更新过来,忘了参数,已修正

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants