baidufe / tangram-base Goto Github PK
View Code? Open in Web Editor NEWHome Page: tangram-base
License: BSD 3-Clause "New" or "Revised" License
Home Page: tangram-base
License: BSD 3-Clause "New" or "Revised" License
such as add some features or fix some bugs, and so on....
IE,FIrefox,Chrome,Opera下面都有未通过的测试用例,Linux和Windows平台下面都有问题。
请检查一下。
不知道为何要限制在array中,这个从07年底al的时候就一直是array、object都支持的,为啥忽然去掉了。。。强烈要求加回来
dom.setOutter系列的改动应该同步修改baidu.element
其实在这之前,我不知道。-,- 学习了。不过。正则中 lastMatch 的短属性在 opera 是不运行的(其实所有的都不行,除了 $1~9)。so, Tangram 的代码是需要改一下滴。
如果需要clone的对象的prototype 为 Number,此对象将被直接返回。。。 应该把 instanceof Number 换成 isNumber 吧。。。 String, Boolean 也是
valign, cellpadding, tabindex, readonly, maxlength
qa看看能不能补充下case。
create一个判断不会死的,N年的问题了,记录一下。。。性能根本不是问题,一般都只作用在最上层的节点上,浏览器中render tree的改动导致重新layout才是最耗时的
缺少这个图片
需要是UTF8
我用baidu.on给一个iframe的contentWindow对象添加onload监听,如果在运行期,iframe页面跳转了,会导致原来绑定的contentWindow对象引用被移除,这导致在baidu.event._unload运行的时候,取出来的之前绑定过的元素为null,在页面卸载时要移除所有事件监听会报错。
需要是UTF8
i can't figure out which case, but it happens 3 times.
使用了 instanceof 来判断类型,这样使得从其他 frame 获取到的 Array 和 Date 对象无法正确序列化。建议改用 baidu.lang.isArray 及 baidu.lang.isDate 来判断。
为什么 magic 下载到本地运行不了,会报错!还需要额外的配置么?有的话要怎么配置??还有为啥原来的magic官网地址都跳到这里了
In the method of baidu.dom.opacity, and it set the opacity using filter with 'xxxxx(opacity__:xxx' instead of 'xxxxx(opacity=__'.
The problem is that if I set the opacity with this method, but I want to get the opacity using the baidu.dom.getStyle, and it won't work.
Frankly speaking, I can't figure out why there exists a method calling baidu.dom.opacity, do you want to provide a shortcut method? or other reasons?
baidu.dom.opacity = function(element, opacity){
element = baidu.dom.g(element);
if (!baidu.browser.ie) {
element.style.opacity = opacity;
element.style.KHTMLOpacity = opacity;
} else {
element.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity:"+
Math.floor(opacity * 100) +")";
}
};
baidu.dom._styleFixer.opacity = baidu.browser.ie ? {
get: function (element) {
var filter = element.style.filter;
return filter && filter.indexOf("opacity=") >= 0 ? (parseFloat(filter.match(/opacity=([^)]*)/)[1]) / 100) + "" : "1";
},
set: function (element, value) {
var style = element.style;
// 只能Quirks Mode下面生效??
style.filter = (style.filter || "").replace(/alpha\([^\)]*\)/gi, "") + (value == 1 ? "" : "alpha(opacity=" + value * 100 + ")");
// IE filters only apply to elements with "layout."
style.zoom = 1;
}
} : null;
thanks,
starandtina
复现:
自定义下载 - 我的选择 -
输入baidu.ajax.get,baidu.ajax.post,baidu.object.clone,baidu.object.extend,baidu.json.decode,baidu.json.encode
下载下来的js出现了异常,下面是js的一部分
java.io.FileNotFoundException: /home/g/public_html/doc/source/script/1316591308 (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:106)
at java.io.FileInputStream.(FileInputStream.java:66)
at com.yahoo.platform.yui.compressor.YUICompressor.main(YUICompressor.java:92)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:20)
在Chrome中,页面中有iframe存在的情况下,拖拽draggable块以较快速度移入iframe范围内,并立即松开鼠标,此时会出现draggable块一直跟随鼠标,怎么也停不下来。发生的原因是iframe捕捉的mouseup事件,不再向其父级页面传递,导致drag动作没有终止。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>drag</title>
<script type="text/javascript" src="http://tangram.baidu.com/download/tangram-1.3.9.js"></script>
<style type="text/css">
.container{
float:left; padding-left:50px;
}
.drag-wrap{
width:300px; height:220px; background:#8888FF; position:relative;
}
.drag-title{
background:#666666; height:20px; line-height:20px; color:white; cursor:move;
}
</style>
</head>
<body>
<div class="container">
<div id="widget" class="drag-wrap">
<div id="title" class="drag-title">drag me</div>
<div>在页面中有iframe存在的情况下,拖拽draggable块以较快速度移入iframe范围内,并立即松开鼠标,此时会出现draggable块一直跟随鼠标,怎么也停不下来</div>
</div>
</div>
<iframe src="http://www.google.com.hk" width="500" height="500" frameborder="1"></iframe>
<script type="text/javascript">
baidu.dom.draggable('widget', {
handler : 'title'
});
</script>
</body>
</html>
在Base文档中,baidu.array.empty的使用方法是这么写的:
var input = [1,"中文",4,5];
var output;
output = baidu.array.empty(input);
document.write("output: " + output+"<br>");
从源码中看empty没有返回值,只是把input给清空了。
http://tangram.baidu.com/tangram/baidu_array_empty.html
仅在className参数传入在trim为空时返回null,其他情况下返回result(初始为[]),
建议:统一返回逻辑
问题:请修改文档关于返回结果的描述
建议改成:
left : position.left - (parseFloat(baidu.dom.getStyle(element, "margin-left")) || 0),
top : position.top - (parseFloat(baidu.dom.getStyle(element, "margin-top")) || 0)
http://tangram.baidu.com/api.html#baidu.ajax.request
缺少对ontimeout事件的文档。
baidu.dom.resizable引用setOuter,而不是新的setBorderBoxSize
文档描述需要说明options字段仅用于element的attribute属性的追加
由于原代码中使用了split后sort,sort可能导致用户的多个class顺序发生改变
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.