浏览代码

Merge branch 'master' of http://114.215.100.48:3000/ipu/android-share.git

huangbo 10 年之前
父节点
当前提交
a6b83189b7

+ 2 - 2
display-client/project.properties

12
12
13
# Project target.
13
# Project target.
14
target=android-15
14
target=android-15
15
android.library.reference.1=../../../git/android-share/wade-mobile-lib
16
android.library.reference.2=../../../git/android/wade-mobile-com
15
android.library.reference.1=../wade-mobile-common
16
android.library.reference.2=../wade-mobile-lib
17
proguard.config=proguard-project.txt
17
proguard.config=proguard-project.txt

+ 5 - 1
display-server/etc/lua/tag/WmDialog.lua

2
local Tag = require("engine.Tag")
2
local Tag = require("engine.Tag")
3
local WmDialog = Class(Tag)
3
local WmDialog = Class(Tag)
4

4

5
function WmDialog:createNew(obj,htmlbuff)
6
  self.htmlbuff=htmlbuff
7
end
8

5
function WmDialog:doStartTag(attr)
9
function WmDialog:doStartTag(attr)
6
	if not (attr.id and attr.title) then
10
	if not (attr.id and attr.title) then
7
		monitor:error("WmDialog组件 id、title属性不能为空 ")
11
		monitor:error("WmDialog组件 id、title属性不能为空 ")
34
	self.htmlbuff:append('')
38
	self.htmlbuff:append('')
35

39

36
	self.htmlbuff:append('<script type="text/javascript">')
40
	self.htmlbuff:append('<script type="text/javascript">')
37
	self.htmlbuff:append('require(["wmDialog"],function(WmDialog) {')
41
	self.htmlbuff:append('require(["wmDialog","wmWebUI"],function(WmDialog,WmWebUI) {')
38
	self.htmlbuff:append('var dialog_'..attr.id..' = new WmDialog("'..attr.id..'");')
42
	self.htmlbuff:append('var dialog_'..attr.id..' = new WmDialog("'..attr.id..'");')
39
	if attr.contentId then
43
	if attr.contentId then
40
		self.htmlbuff:append(' dialog_'..attr.id..'.setContent("'..attr.contentId..'","html");')
44
		self.htmlbuff:append(' dialog_'..attr.id..'.setContent("'..attr.contentId..'","html");')

+ 2 - 2
display-server/etc/lua/tag/WmNavBar.lua

1
local Class = require("util.Class")
1
local Class = require("util.Class")
2
local Tag = require("engine.Tag")
2
local Tag = require("engine.Tag")
3
local WmNavBar = Class(Tag)
3
local WmNavBar = Class(Tag)
4
--[[
4

5
function WmNavBar:createNew(obj,htmlbuff)
5
function WmNavBar:createNew(obj,htmlbuff)
6
  self.htmlbuff=htmlbuff
6
  self.htmlbuff=htmlbuff
7
  monitor:debug("------------------------")
7
  monitor:debug("------------------------")
8
 -- monitor:debug("htmlbuff length:"..#self.htmlbuff)
8
 -- monitor:debug("htmlbuff length:"..#self.htmlbuff)
9
  self.bottoms = {}
9
  self.bottoms = {}
10
end
10
end
11
--]]
11

12
function WmNavBar:doStartTag(attr)
12
function WmNavBar:doStartTag(attr)
13
	self.id = attr.id
13
	self.id = attr.id
14
	self.bottoms = {}
14
	self.bottoms = {}

+ 4 - 0
display-server/etc/lua/tag/WmNavBarItem.lua

2
local Tag = require("engine.Tag")
2
local Tag = require("engine.Tag")
3
local WmNavBarItem = Class(Tag)
3
local WmNavBarItem = Class(Tag)
4

4

5
function WmNavBarItem:createNew(obj,htmlbuff)
6
  self.htmlbuff=htmlbuff
7
end
8

5
function WmNavBarItem:doStartTag(attr)
9
function WmNavBarItem:doStartTag(attr)
6
	if attr.type == "back" then
10
	if attr.type == "back" then
7
		self.htmlbuff:append('<div class="left"><div class="back"><span class="e_ico-back"></span>')
11
		self.htmlbuff:append('<div class="left"><div class="back"><span class="e_ico-back"></span>')

+ 4 - 0
display-server/etc/lua/tag/WmProgress.lua

2
local Tag = require("engine.Tag")
2
local Tag = require("engine.Tag")
3
local WmProgress = Class(Tag)
3
local WmProgress = Class(Tag)
4

4

5
function WmProgress:createNew(obj,htmlbuff)
6
  self.htmlbuff=htmlbuff
7
end
8

5
function WmProgress:doStartTag(attr)
9
function WmProgress:doStartTag(attr)
6

10

7
	if not (attr.id and attr.progress) then
11
	if not (attr.id and attr.progress) then

+ 13 - 9
display-server/etc/lua/tag/WmSegment.lua

2
local Tag = require("engine.Tag")
2
local Tag = require("engine.Tag")
3
local WmSegment = Class(Tag)
3
local WmSegment = Class(Tag)
4

4

5
function WmSegment:createNew(obj,htmlbuff)
6
  self.htmlbuff=htmlbuff
7
end
8

5
function WmSegment:doStartTag(attr)
9
function WmSegment:doStartTag(attr)
6
	local texts = self.Split(attr.texts, ",")
10
	local texts = self.Split(attr.texts, ",")
7
	local values = self.Split(attr.values, ",")
11
	local values = self.Split(attr.values, ",")
13
	self.htmlbuff:append('<input type="hidden" id="'..attr.name..'" name="'..attr.name..'" value="" />')
17
	self.htmlbuff:append('<input type="hidden" id="'..attr.name..'" name="'..attr.name..'" value="" />')
14
	
18
	
15
	
19
	
16
	self.htmlbuff:append('<script type="text/javascript">')
17
	self.htmlbuff:append('require(["wmSegment"],function(WmSegment) {')
18
	self.htmlbuff:append('var segment_'..attr.id..' = new WmSegment("'..attr.id..'","'..attr.name..'",false);')
20
	self.htmlbuff:append('<script type="text/javascript">\n')
21
	self.htmlbuff:append('require(["wmSegment"],function(WmSegment) {\n')
22
	self.htmlbuff:append('var segment_'..attr.id..' = new WmSegment("'..attr.id..'","'..attr.name..'",false);\n')
19
	if attr.selected then
23
	if attr.selected then
20
		self.htmlbuff:append('segment_'..attr.id..'.activeItem("'..attr.selected..'");')
24
		self.htmlbuff:append('segment_'..attr.id..'.activeItem("'..attr.selected..'");\n')
21
	else
25
	else
22
		self.htmlbuff:append('segment_'..attr.id..'.activeItemIndex(0);')
26
		self.htmlbuff:append('segment_'..attr.id..'.activeItemIndex(0);\n')
23
	end 
27
	end 
24
	if attr.action then
28
	if attr.action then
25
		self.htmlbuff:append('segment_'..attr.id..'.setAction(function(){ return '..attr.action..'.apply(window,arguments);})')
29
		self.htmlbuff:append('segment_'..attr.id..'.setAction(function(){ return '..attr.action..'.apply(window,arguments);})\n')
26
	else
30
	else
27
		self.htmlbuff:append('segment_'..attr.id..'.setAction()')
31
		self.htmlbuff:append('segment_'..attr.id..'.setAction();\n')
28
	end 
32
	end 
29
	self.htmlbuff:append('WmWebUI.store("'..attr.id..'",segment_'..attr.id..');')
30
	self.htmlbuff:append('})')
33
	self.htmlbuff:append('WmWebUI.store("'..attr.id..'",segment_'..attr.id..');\n')
34
	self.htmlbuff:append('})\n')
31
	self.htmlbuff:append('</script>')
35
	self.htmlbuff:append('</script>')
32
end
36
end
33

37


+ 6 - 1
display-server/etc/lua/tag/WmToolTip.lua

2
local Tag = require("engine.Tag")
2
local Tag = require("engine.Tag")
3
local WmToolTip = Class(Tag)
3
local WmToolTip = Class(Tag)
4

4

5
function WmToolTip:createNew(obj,htmlbuff)
6
  self.htmlbuff=htmlbuff
7
end
8

9

5
function WmToolTip:doStartTag(attr)
10
function WmToolTip:doStartTag(attr)
6
	self.id = attr.id
11
	self.id = attr.id
7
	local align = ""
12
	local align = ""
28
	end
33
	end
29
	self.htmlbuff:append('</div></div>')
34
	self.htmlbuff:append('</div></div>')
30
	self.htmlbuff:append('<script type="text/javascript">')
35
	self.htmlbuff:append('<script type="text/javascript">')
31
	self.htmlbuff:append('require(["wmToolTip"],function(WmToolTip) {')
36
	self.htmlbuff:append('require(["wmToolTip","wmWebUI"],function(WmToolTip,WmWebUI) {')
32
	self.htmlbuff:append('var tooltip_'..self.id..' = new WmToolTip("'..self.id..'");')
37
	self.htmlbuff:append('var tooltip_'..self.id..' = new WmToolTip("'..self.id..'");')
33
	if attr.action then
38
	if attr.action then
34
		self.htmlbuff:append('tooltip_'..self.id..'.setCloseAction(function(){ return '..attr.action..'.apply(window,arguments);});')
39
		self.htmlbuff:append('tooltip_'..self.id..'.setCloseAction(function(){ return '..attr.action..'.apply(window,arguments);});')

+ 4 - 3
display-server/web/biz/js/tag/WmDropmenu.js

13
	$("#setLabel").on("tap",function(){
13
	$("#setLabel").on("tap",function(){
14
		var dropmenu=WmWebUI.select("dropmenu01");
14
		var dropmenu=WmWebUI.select("dropmenu01");
15
		var str=prompt("请输入菜单名。示例:我的活动");
15
		var str=prompt("请输入菜单名。示例:我的活动");
16
		if(str == ""){
17
			str = "默认名称";
16
		if(str == null || str == ""){
17
			//don't do anything
18
			return;
18
		}
19
		}
19
		dropmenu.setLabel(str);
20
		dropmenu.setLabel(str);
20
	});
21
	});
74
		items[0].html(str);
75
		items[0].html(str);
75
		alert("添加成功");
76
		alert("添加成功");
76
	});
77
	});
77
	new IScroll("#content",{tap:true,scrollbars: true});
78
	new IScroll("#content",{tap:true,scrollbars: true,useTransform:false});
78
});
79
});

+ 6 - 0
display-server/web/res/js/ui/wm-dropmenu.js

1
/* Attention: 
2
 * if use "iscroll5" component for 'wm-dropmenu'-element's ancestor,
3
 * pleas don't set transform property,transform property will make "position-fixed" like "position-absolute";
4
 * example:
5
 * 		new IScroll("#content",{tap:true,scrollbars: true,useTransform:false});  
6
 */
1
define(["jcl","iScroll","wmWebUI"],function($,iScrol,WmWebUI){
7
define(["jcl","iScroll","wmWebUI"],function($,iScrol,WmWebUI){
2
	function DropmenuItem(obj,parent){
8
	function DropmenuItem(obj,parent){
3
		this.entity=obj;
9
		this.entity=obj;

+ 5 - 4
display-server/web/res/js/ui/wm-segment.js

25
	WmSegment.prototype.bindAction = function(ele){
25
	WmSegment.prototype.bindAction = function(ele){
26
		var action = this.action;
26
		var action = this.action;
27
		var hiddenId = this.hiddenId;
27
		var hiddenId = this.hiddenId;
28
		var tapEvent = function(e){
29
			var ele = e.target;
28
		var tapEvent = function(ele){
30
			var re;
29
			var re;
31
			if(typeof action =="function"){
30
			if(typeof action =="function"){
32
				re = action($(ele).attr("segValue"),$(ele).text());
31
				re = action($(ele).attr("segValue"),$(ele).text());
40
			}
39
			}
41
		};
40
		};
42
		if(ele){
41
		if(ele){
43
			$(ele).tap(tapEvent);
42
			$(ele).tap(tapEvent,ele);
44
		}else{
43
		}else{
45
			$(this.segment.find('span.e_segmentLi')).tap(tapEvent);
44
			this.segment.find('span.e_segmentLi').each(function(index,el){
45
				$(el).tap(tapEvent,el);
46
			});
46
		}
47
		}
47
	};
48
	};
48

49


+ 1 - 1
display-server/web/res/js/ui/wm-webui.js

35
	/* 根据标签id查询标签对象 */
35
	/* 根据标签id查询标签对象 */
36
	wmWebUI.select = function(id) {
36
	wmWebUI.select = function(id) {
37
		var tag = $("#" + id);
37
		var tag = $("#" + id);
38
		if (tag.length == 0 && wmWebUI.tags[id])
38
		if (tag.length > 0 && wmWebUI.tags[id])
39
			return wmWebUI.tags[id];
39
			return wmWebUI.tags[id];
40
	}
40
	}
41

41


+ 1 - 1
display-server/web/template/webapp/tag/WmDialog.html

2
<html class="s_bs">
2
<html class="s_bs">
3
<head>
3
<head>
4
	<meta charset="utf-8" />
4
	<meta charset="utf-8" />
5
	<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
5
	<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
6
	<title>web UI 组件</title>
6
	<title>web UI 组件</title>
7
	{%>template/common/head.html%}
7
	{%>template/common/head.html%}
8
</head>
8
</head>