wangxl vor 10 Jahren
Ursprung
Commit
95ca34ee42

+ 2 - 2
display-client/project.properties

@ -12,6 +12,6 @@
12 12
13 13
# Project target.
14 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 17
proguard.config=proguard-project.txt

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

@ -2,6 +2,10 @@ local Class = require("util.Class")
2 2
local Tag = require("engine.Tag")
3 3
local WmDialog = Class(Tag)
4 4

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

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

36 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 42
	self.htmlbuff:append('var dialog_'..attr.id..' = new WmDialog("'..attr.id..'");')
39 43
	if attr.contentId then
40 44
		self.htmlbuff:append(' dialog_'..attr.id..'.setContent("'..attr.contentId..'","html");')

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

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

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

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

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

@ -2,6 +2,10 @@ local Class = require("util.Class")
2 2
local Tag = require("engine.Tag")
3 3
local WmNavBarItem = Class(Tag)
4 4

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

5 9
function WmNavBarItem:doStartTag(attr)
6 10
	if attr.type == "back" then
7 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,6 +2,10 @@ local Class = require("util.Class")
2 2
local Tag = require("engine.Tag")
3 3
local WmProgress = Class(Tag)
4 4

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

5 9
function WmProgress:doStartTag(attr)
6 10

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

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

@ -2,6 +2,10 @@ local Class = require("util.Class")
2 2
local Tag = require("engine.Tag")
3 3
local WmSegment = Class(Tag)
4 4

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

5 9
function WmSegment:doStartTag(attr)
6 10
	local texts = self.Split(attr.texts, ",")
7 11
	local values = self.Split(attr.values, ",")
@ -13,21 +17,21 @@ function WmSegment:doStartTag(attr)
13 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 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 25
	else
22
		self.htmlbuff:append('segment_'..attr.id..'.activeItemIndex(0);')
26
		self.htmlbuff:append('segment_'..attr.id..'.activeItemIndex(0);\n')
23 27
	end 
24 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 30
	else
27
		self.htmlbuff:append('segment_'..attr.id..'.setAction()')
31
		self.htmlbuff:append('segment_'..attr.id..'.setAction();\n')
28 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 35
	self.htmlbuff:append('</script>')
32 36
end
33 37


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

@ -2,6 +2,11 @@ local Class = require("util.Class")
2 2
local Tag = require("engine.Tag")
3 3
local WmToolTip = Class(Tag)
4 4

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

9

5 10
function WmToolTip:doStartTag(attr)
6 11
	self.id = attr.id
7 12
	local align = ""
@ -28,7 +33,7 @@ function WmToolTip:doStartTag(attr)
28 33
	end
29 34
	self.htmlbuff:append('</div></div>')
30 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 37
	self.htmlbuff:append('var tooltip_'..self.id..' = new WmToolTip("'..self.id..'");')
33 38
	if attr.action then
34 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,8 +13,9 @@ require(["domReady!","wmWebUI","jcl","mobile"],function(doc,WmWebUI,$,Mobile){
13 13
	$("#setLabel").on("tap",function(){
14 14
		var dropmenu=WmWebUI.select("dropmenu01");
15 15
		var str=prompt("请输入菜单名。示例:我的活动");
16
		if(str == ""){
17
			str = "默认名称";
16
		if(str == null || str == ""){
17
			//don't do anything
18
			return;
18 19
		}
19 20
		dropmenu.setLabel(str);
20 21
	});
@ -74,5 +75,5 @@ require(["domReady!","wmWebUI","jcl","mobile"],function(doc,WmWebUI,$,Mobile){
74 75
		items[0].html(str);
75 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,3 +1,9 @@
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 7
define(["jcl","iScroll","wmWebUI"],function($,iScrol,WmWebUI){
2 8
	function DropmenuItem(obj,parent){
3 9
		this.entity=obj;

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

@ -25,8 +25,7 @@ define(['util'], function(){
25 25
	WmSegment.prototype.bindAction = function(ele){
26 26
		var action = this.action;
27 27
		var hiddenId = this.hiddenId;
28
		var tapEvent = function(e){
29
			var ele = e.target;
28
		var tapEvent = function(ele){
30 29
			var re;
31 30
			if(typeof action =="function"){
32 31
				re = action($(ele).attr("segValue"),$(ele).text());
@ -40,9 +39,11 @@ define(['util'], function(){
40 39
			}
41 40
		};
42 41
		if(ele){
43
			$(ele).tap(tapEvent);
42
			$(ele).tap(tapEvent,ele);
44 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,7 +35,7 @@ define([ "jcl", "tap", "wmUI", "wmBase", "wmAnimate" ], function($) {
35 35
	/* 根据标签id查询标签对象 */
36 36
	wmWebUI.select = function(id) {
37 37
		var tag = $("#" + id);
38
		if (tag.length == 0 && wmWebUI.tags[id])
38
		if (tag.length > 0 && wmWebUI.tags[id])
39 39
			return wmWebUI.tags[id];
40 40
	}
41 41


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

@ -2,7 +2,7 @@
2 2
<html class="s_bs">
3 3
<head>
4 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 6
	<title>web UI 组件</title>
7 7
	{%>template/common/head.html%}
8 8
</head>