X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-core-debug.js;h=697592cc33ae6a3a9dd8a0feda6f2a738e66993c;hb=e48ce1c5e71b3d18391128ea45810effc0d036b0;hp=fbab78470411dc3dc447dbb2f5ebb9027ef4c07f;hpb=9ffb95fe6343d9f1c28eca6964f2e25cafacf588;p=roojs1
diff --git a/roojs-core-debug.js b/roojs-core-debug.js
index fbab784704..697592cc33 100644
--- a/roojs-core-debug.js
+++ b/roojs-core-debug.js
@@ -343,10 +343,6 @@ Roo.factory(conf, Roo.data);
return; // alerT?
}
- if(window.location.href.indexOf("localhost") == -1) {
- return;
- }
-
console.log(s);
},
/**
@@ -1019,8 +1015,34 @@ Roo.applyIf(Array.prototype, {
}
return res;
+ },
+ /**
+ * equals
+ * @param {Array} o The array to compare to
+ * @returns {Boolean} true if the same
+ */
+ equals : function(b)
+ {
+ // https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript
+ if (this === b) {
+ return true;
+ }
+ if (b == null) {
+ return false;
+ }
+ if (this.length !== b.length) {
+ return false;
+ }
+
+ // sort?? a.sort().equals(b.sort());
+
+ for (var i = 0; i < this.length; ++i) {
+ if (this[i] !== b[i]) {
+ return false;
+ }
+ }
+ return true;
}
-
});
@@ -4656,6 +4678,12 @@ Roo.Template = function(cfg){
};
Roo.Template.prototype = {
+ /**
+ * @cfg {Function} onLoad Called after the template has been loaded and complied (usually from a remove source)
+ */
+ onLoad : false,
+
+
/**
* @cfg {String} url The Url to load the template from. beware if you are loading from a url, the data may not be ready if you use it instantly..
* it should be fixed so that template is observable...
@@ -4665,12 +4693,20 @@ Roo.Template.prototype = {
* @cfg {String} html The HTML fragment or an array of fragments to join("") or multiple arguments to join("")
*/
html : '',
+
+
+ compiled : false,
+ loaded : false,
/**
* Returns an HTML fragment of this template with the specified values applied.
* @param {Object} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
* @return {String} The HTML fragment
*/
+
+
+
applyTemplate : function(values){
+ //Roo.log(["applyTemplate", values]);
try {
if(this.compiled){
@@ -4729,9 +4765,13 @@ Roo.Template.prototype = {
method : 'GET',
success : function (response) {
_t.loading = false;
- _t.html = response.responseText;
_t.url = false;
- _t.compile();
+
+ _t.set(response.responseText,true);
+ _t.loaded = true;
+ if (_t.onLoad) {
+ _t.onLoad();
+ }
},
failure : function(response) {
Roo.log("Template failed to load from " + _t.url);
@@ -4748,7 +4788,7 @@ Roo.Template.prototype = {
*/
set : function(html, compile){
this.html = html;
- this.compiled = null;
+ this.compiled = false;
if(compile){
this.compile();
}
@@ -6077,10 +6117,10 @@ Roo.util.Observable.releaseCapture = function(o){
var ls = this.listeners, scope, len = ls.length;
if(len > 0){
this.firing = true;
- var args = Array.prototype.slice.call(arguments, 0);
+ var args = Array.prototype.slice.call(arguments, 0);
for(var i = 0; i < len; i++){
- var l = ls[i];
- if(l.fireFn.apply(l.scope||this.obj||window, arguments) === false){
+ var l = ls[i];
+ if(l.fireFn.apply(l.scope||this.obj||window, args) === false){
this.firing = false;
return false;
}
@@ -7130,12 +7170,14 @@ if(opt.anim.isAnimated()){
El.prototype = {
/**
- * The element's default display mode (defaults to "")
+ * The element's default display mode (defaults to "")
* @type String
*/
originalDisplay : "",
- visibilityMode : 1,
+
+ // note this is overridden in BS version..
+ visibilityMode : 1,
/**
* The default unit to append to CSS values where a unit isn't provided (defaults to px).
* @type String
@@ -8563,7 +8605,8 @@ if(opt.anim.isAnimated()){
* @param {Array} offsets (optional) Offset the positioning by [x, y]
* @return {Array} [x, y]
*/
- getAlignToXY : function(el, p, o){
+ getAlignToXY : function(el, p, o)
+ {
el = Roo.get(el);
var d = this.dom;
if(!el.dom){
@@ -8604,7 +8647,7 @@ if(opt.anim.isAnimated()){
//otherwise swap the aligned el to the opposite border of the target.
var p1y = p1.charAt(0), p1x = p1.charAt(p1.length-1);
var p2y = p2.charAt(0), p2x = p2.charAt(p2.length-1);
- var swapY = ((p1y=="t" && p2y=="b") || (p1y=="b" && p2y=="t"));
+ var swapY = ((p1y=="t" && p2y=="b") || (p1y=="b" && p2y=="t") );
var swapX = ((p1x=="r" && p2x=="l") || (p1x=="l" && p2x=="r"));
var doc = document;
@@ -9130,8 +9173,6 @@ if(opt.anim.isAnimated()){
this._mask = Roo.DomHelper.append(this.dom, {cls:"roo-el-mask"}, true);
}
- this._mask.dom.className = msgCls ? "roo-el-mask " + msgCls : "roo-el-mask";
-
this.addClass("x-masked");
this._mask.setDisplayed(true);
@@ -11477,16 +11518,17 @@ Roo.CompositeElementLite.prototype.on = Roo.CompositeElementLite.prototype.addLi
* @class Roo.data.Connection
* @extends Roo.util.Observable
* The class encapsulates a connection to the page's originating domain, allowing requests to be made
- * either to a configured URL, or to a URL specified at request time.
- *
+ * either to a configured URL, or to a URL specified at request time. + * * Requests made by this class are asynchronous, and will return immediately. No data from * the server will be available to the statement immediately following the {@link #request} call. - * To process returned data, use a callback in the request options object, or an event listener.
+ * To process returned data, use a callback in the request options object, or an event listener. + * * Note: If you are doing a file upload, you will not get a normal response object sent back to * your callback or event handler. Since the upload is handled via in IFRAME, there is no XMLHttpRequest. * The response object is created using the innerHTML of the IFRAME's document as the responseText - * property and, if present, the IFRAME's XML document as the responseXML property.