Skip to content

Commit

Permalink
Merge pull request #3 from allen-zh/master
Browse files Browse the repository at this point in the history
  • Loading branch information
allen-zh committed Jan 14, 2016
2 parents 0540815 + 94cce5a commit a3c8eb0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
6 changes: 6 additions & 0 deletions dist/plugin/block.script.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ function smarty_block_script($params, $content, $smarty, &$repeat)
$context = BigPipe::currentContext();

if (isset($params["sync"])) {
foreach ($params["sync"] as $resource) {
BigPipeResource::registModule($resource);
}
$context->addRequire($eventType, $params["sync"]);
}

if (isset($params["async"])) {
foreach ($params["async"] as $resource) {
BigPipeResource::registModule($resource);
}
$context->addRequireAsync($eventType, $params["async"]);
}

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
"version": "0.0.1",
"description": "her的运行时,包括后端smarty插件和前端js框架",
"author": {
"name": "huangyi",
"email": "ustbhuangyi@gmail.com"
"name": "hao123-fe",
"email": "zhangwentao@baidu.com"
},
"bugs": {
"url": "https://github.com/ustbhuangyi/her-runtime/issues"
"url": "https://github.com/hao123-fe/her-runtime/issues"
},
"engines": {
"node": ">=0.9"
},
"homepage": "https://github.com/ustbhuangyi/her-runtime/",
"homepage": "https://github.com/hao123-fe/her-runtime/",
"keywords": [
"her",
"runtime",
Expand All @@ -22,7 +22,7 @@
"main": "index.js",
"repository": {
"type": "git",
"url": "git@github.com:ustbhuangyi/her-runtime.git"
"url": "git@github.com:hao123-fe/her-runtime.git"
},
"dependencies": {
"del": "^0.1.3",
Expand Down
6 changes: 6 additions & 0 deletions src/plugin/block.script.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ function smarty_block_script($params, $content, $smarty, &$repeat)
$context = BigPipe::currentContext();

if (isset($params["sync"])) {
foreach ($params["sync"] as $resource) {
BigPipeResource::registModule($resource);
}
$context->addRequire($eventType, $params["sync"]);
}

if (isset($params["async"])) {
foreach ($params["async"] as $resource) {
BigPipeResource::registModule($resource);
}
$context->addRequireAsync($eventType, $params["async"]);
}

Expand Down

0 comments on commit a3c8eb0

Please sign in to comment.