Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Apr 23, 2012
limu add tab db88bcb
Commits on Apr 24, 2012
limu add behavior 6efb6f3
Showing with 81 additions and 13 deletions.
  1. +15 −1 src/js/brix/index.js
  2. +66 −12 src/scaffolding.html
View
16 src/js/brix/index.js
@@ -1 +1,15 @@
-kissy.add("")
+KISSY.add("brix/index", function(S, $) {
+ var Brix = {};
+ function addBehavior() {
+ var pagelets = getPagelets();
+ }
+
+ function getPagelets(){
+ var res = $('[bx-pagelet]');
+ return res;
+ }
+ Brix.addBehavior = addBehavior;
+ return Brix;
+}, {
+ requires : ["sizzle"]
+});
View
78 src/scaffolding.html
@@ -10,33 +10,87 @@
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="../libs/debug/jquery-1.7.2.min.js"></script>
+ <script src="../libs/debug/mustache.js"></script>
<script src="../libs/debug/bootstrap/js/bootstrap.js"></script>
<script src="../libs/debug/kissy/kissy.js"></script>
<script>
KISSY.config({
packages : [{
- name : "brix",
- tag : "20120419",
- path : "js",
+ name : "brix",
+ tag : "20120419",
+ path : "js",
charset : "utf-8"
}]
});
- KISSY.ready(function(){
- KISSY.use("brix/",function(){
-
+ KISSY.ready(function() {
+ KISSY.use("brix/", function(S,Brix) {
+ debugger;
+ Brix.addBehavior();
})
});
+
</script>
<script src="../libs/debug/mustache.js"></script>
</head>
- <body style="margin:0px">
+ <body style="margin:0px;padding-top:40px">
<div class="container">
<div class="row">
- <div class="span4">
- left
- </div>
- <div class="span8">
- right
+ <div class="span12">
+ <!--brix begin-->
+ <script>
+ var data_brix1 = {
+ options : [{
+ id : "planList",
+ text : "计划列表",
+ __chk : true
+ }, {
+ id : "itemList",
+ text : "宝贝列表",
+ __chk : true
+ }, {
+ id : "creativeList",
+ text : "创意列表",
+ __chk : true
+ }, {
+ id : "keywordList",
+ text : "关键词列表"
+ }],
+ tabList : [{
+ id : "planList",
+ text : "计划列表",
+ __cur : true
+ }, {
+ id : "itemList",
+ text : "宝贝列表"
+ }, {
+ id : "creativeList",
+ text : "创意列表"
+ }]
+ }
+ </script>
+ <script type="text/template" id="tmpl_brix1">
+ <div brix-type="tab" id="container_brix1" bx_pagelet="">
+ <ul class="nav nav-tabs" brix-subtmpl="tabList">
+ {{#tabList}}
+ <li{{#__cur}} class="active"{{/__cur}}>
+ <a href="#" data="{{id}}">{{text}}</a>
+ </li>
+ {{/tabList}}
+ </ul>
+ <div brix-type="multiSelect">
+ {{#options}}
+ <input type="checkbox" value="{{id}}"{{#__chk}} checked{{/__chk}}/>{{text}}
+ {{/options}}
+ </div>
+ </div>
+ </script>
+ <script>
+ var tmpl = $("#tmpl_1").text();
+ var s = Mustache.to_html(tmpl,data_brix1);
+ //debugger;
+ document.write(s);
+ </script>
+ <!--brix end-->
</div>
</div>
</div>

No commit comments for this range

Something went wrong with that request. Please try again.