Skip to content

Commit

Permalink
Merge pull request #46 from ecomfe/dev
Browse files Browse the repository at this point in the history
v0.2.2
  • Loading branch information
Justineo committed Nov 28, 2014
2 parents cee1c2d + d639ff8 commit d2fc2fa
Show file tree
Hide file tree
Showing 56 changed files with 3,414 additions and 558 deletions.
Empty file added .edpproj/.gitignore
Empty file.
5 changes: 5 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rules": {
"no-else-return": 0
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
dep
node_modules
npm-debug.log
.npmignore
.DS_Store
test/coverage
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
* 0.2.2
- 增加了 `SearchTree` 控件
- 增加了 `RichBoxGroup` 控件
- 更新了 `Uploader` 控件的逻辑
- `util` 列表生成操作时支持配置为禁用的功能
- 增加了部分单测 case
-`window` / `history` 相关的逻辑封装到 `location` 模块中
- 升级了 `system/constants` 模块的逻辑,更健壮

* 0.2.1
- 优化了样式
- 增加了 `Sidebar` 的默认处理
Expand Down
56 changes: 56 additions & 0 deletions module.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"baseUrl": "src",
"paths": {},
"packages": [
{
"name": "ef",
"location": "../dep/ef/3.1.0-beta.2/src",
"main": "main"
},
{
"name": "eoo",
"location": "../dep/eoo/0.1.1/src",
"main": "main"
},
{
"name": "er",
"location": "../dep/er/3.1.0-beta.5/src",
"main": "main"
},
{
"name": "er-track",
"location": "../dep/er-track/0.9.1/src",
"main": "main"
},
{
"name": "esui",
"location": "../dep/esui/3.1.0-beta.3/src",
"main": "main"
},
{
"name": "etpl",
"location": "../dep/etpl/3.0.0/src",
"main": "main"
},
{
"name": "mini-event",
"location": "../dep/mini-event/1.0.2/src",
"main": "main"
},
{
"name": "moment",
"location": "../dep/moment/2.7.0/src",
"main": "moment"
},
{
"name": "underscore",
"location": "../dep/underscore/1.6.0/src",
"main": "underscore"
},
{
"name": "urijs",
"location": "../dep/urijs/1.12.0/src",
"main": "URI"
}
]
}
65 changes: 33 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
{
"name": "bat-ria",
"version": "0.2.1",
"description": "RIA extension for Brand Ads Team",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/ecomfe/bat-ria.git"
},
"keywords": [
"RIA",
"esui",
"er"
],
"dependencies": {
"er": ">=3.1.0-beta.3",
"esui": ">=3.1.0-beta.3",
"ef": "3.1.x",
"er-track": "~0.9.1",
"underscore": ">=1.6.0",
"moment": "2.x",
"etpl": ">=2.0.8",
"urijs": ">=1.12.0"
},
"author": "Justineo, chestnutchen, leeight",
"license": "BSD-2-Clause",
"bugs": {
"url": "https://github.com/ecomfe/bat-ria/issues"
},
"homepage": "https://github.com/ecomfe/bat-ria"
"name": "bat-ria",
"version": "0.2.2",
"description": "RIA extension for Brand Ads Team",
"main": "main.js",
"repository": {
"type": "git",
"url": "https://github.com/ecomfe/bat-ria.git"
},
"keywords": [
"RIA",
"esui",
"er"
],
"edp": {
"dependencies": {
"er": ">=3.1.0-beta.3",
"esui": ">=3.1.0-beta.3",
"ef": "3.1.x",
"er-track": "~0.9.1",
"underscore": ">=1.6.0",
"moment": "2.x",
"etpl": ">=2.0.8",
"urijs": ">=1.12.0",
"eoo": "~0.0.9",
"mini-event": "~1.0.2"
}
},
"author": "Justineo, chestnutchen, leeight",
"license": "BSD-2-Clause",
"bugs": {
"url": "https://github.com/ecomfe/bat-ria/issues"
},
"homepage": "https://github.com/ecomfe/bat-ria"
}
1 change: 0 additions & 1 deletion src/css/common.less
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
// text colors
@bat-text-blue: #0c3ca0;


/**
* Custom normalize
*/
Expand Down
35 changes: 0 additions & 35 deletions src/css/ui.less
Original file line number Diff line number Diff line change
Expand Up @@ -296,38 +296,3 @@ button.skin-link-button:hover {
.ui-uploader-input-container {
*float: left;
}

// bat-ria/RichSelector inside esui/Sidebar
.ui-sidebar {
.ui-richselector-empty-text {
padding: 0 10px;
line-height: 30px;
}

.ui-tree-richselector {

.ui-tree-node-indicator-level-0 {
display: none;
}

.ui-richselector-query-list {
.ui-tree-item-content {
color: @bat-link-color;
}

.ui-tree-content-wrapper-selected {
.ui-tree-item-content {
color: @bat-link-color;
font-weight: 700;
}
}
}

.ui-richselector-query-list {
.ui-tree-content-wrapper-selected,
.ui-tree-content-wrapper:hover {
background: @bat-bg-light-blue;
}
}
}
}
43 changes: 25 additions & 18 deletions src/extension/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,53 @@

define(function (require) {
var u = require('underscore');
var URI = require('urijs');
var uri = require('urijs');
var loading = require('../ui/loading');

function getAderArgMap() {
var user = require('../system/user');
var aderId = user.getAderId();
return aderId ? { aderId: aderId } : {};
return u.purify({
aderId: aderId
});
}

/**
* 激活扩展
* 可用的钩子名称如下:
* - SHOW_LOADING
* - ADD_ADER_ID
* - ADD_ER_REQUEST_HEADER
*
* @param {Object} hooks 需要启用的钩子扩展,默认为都启用,键名为钩子名称,键值为falsy值时禁用
* 默认全部启用
*/
var hooks = {
SHOW_LOADING: true,
ADD_ADER_ID: true,
ADD_ER_REQUEST_HEADER: true
};

/**
* 激活扩展
*
* 可用的钩子名称如下:
* * SHOW_LOADING
* * ADD_ADER_ID
* * ADD_ER_REQUEST_HEADER
* @param {Object} options 需要启用的钩子扩展,默认为都启用,键名为钩子名称,键值为falsy值时禁用
*/
function activate(hooks) {
function activate(options) {

// 设定默认值
hooks = u.defaults(hooks || {}, {
SHOW_LOADING: true,
ADD_ADER_ID: true,
ADD_ER_REQUEST_HEADER: true
});
u.extend(hooks, options);

var io = require('../io/serverIO');

if (hooks.ADD_ADER_ID) {
io.hooks.filterIndexUrl = function(url) {
return URI(url).addQuery(getAderArgMap()).toString();
return uri(url).addQuery(getAderArgMap()).toString();
};

var Uploader = require('bat-ria/ui/Uploader');
var Uploader = require('../ui/Uploader');
Uploader.prototype.filterAction = function (action) {
var argMap = getAderArgMap();
if (argMap) {
action = URI(action).addQuery(argMap).toString();
action = uri(action).addQuery(argMap).toString();
}
return action;
};
Expand All @@ -55,7 +62,7 @@ define(function (require) {
var url = options.url;
var argMap = getAderArgMap();
if (argMap) {
options.url = URI(url).addQuery(argMap).toString();
options.url = uri(url).addQuery(argMap).toString();
}
}

Expand Down
1 change: 1 addition & 0 deletions src/extension/track.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* er track,用来统计er应用的信息
* https://github.com/ecomfe/er-track
**/

define(function(require) {
var u = require('underscore');

Expand Down
Loading

0 comments on commit d2fc2fa

Please sign in to comment.