فهرست منبع

New version of QuoJS 2.3.0 (output method fixed)

soyjavi 13 سال پیش
والد
کامیت
211ec44798
2فایلهای تغییر یافته به همراه27 افزوده شده و 23 حذف شده
  1. 25 21
      example/components/quojs/quo.debug.js
  2. 2 2
      example/components/quojs/quo.js

+ 25 - 21
example/components/quojs/quo.debug.js

@@ -1,4 +1,4 @@
-/* QuoJS v2.3.0 - 1/24/2013
+/* QuoJS v2.3.0 - 1/29/2013
    http://quojs.tapquo.com
    Copyright (c) 2013 Tapquo S.L. - Licensed MIT */
 
@@ -208,10 +208,9 @@ window.Quo = Quo;
     Android: /(Android)\s+([\d.]+)/,
     ipad: /(iPad).*OS\s([\d_]+)/,
     iphone: /(iPhone\sOS)\s([\d_]+)/,
-    blackberry: /(BlackBerry).*Version\/([\d.]+)/,
-    blackberryPlaybook: /(PlayBook).*Version\/([\d.]+)/,
-    firefoxOS: /(Mozilla).*Mobile[^\/]*\/([\d\.]*)/,
-    webos: /(webOS|hpwOS)[\s\/]([\d.]+)/
+    Blackberry: /(BlackBerry|BB10|Playbook).*Version\/([\d.]+)/,
+    FirefoxOS: /(Mozilla).*Mobile[^\/]*\/([\d\.]*)/,
+    webOS: /(webOS|hpwOS)[\s\/]([\d.]+)/
   };
   $$.isMobile = function() {
     _current = _current || _detectEnvironment();
@@ -518,7 +517,6 @@ window.Quo = Quo;
 
 
 (function($$) {
-  var _prependElement;
   $$.fn.text = function(value) {
     if (value || $$.toType(value) === "number") {
       return this.each(function() {
@@ -564,36 +562,42 @@ window.Quo = Quo;
     var type;
     type = $$.toType(value);
     return this.each(function() {
-      return _prependElement(this, value, type);
+      var _this = this;
+      if (type === "string") {
+        return this.insertAdjacentHTML("afterbegin", value);
+      } else if (type === "array") {
+        return value.each(function(index, value) {
+          return _this.insertBefore(value, _this.firstChild);
+        });
+      } else {
+        return this.insertBefore(value, this.firstChild);
+      }
     });
   };
   $$.fn.replaceWith = function(value) {
     var type;
     type = $$.toType(value);
     this.each(function() {
+      var _this = this;
       if (this.parentNode) {
-        return _prependElement(this.parentNode, value, type);
+        if (type === "string") {
+          return this.insertAdjacentHTML("beforeBegin", value);
+        } else if (type === "array") {
+          return value.each(function(index, value) {
+            return _this.parentNode.insertBefore(value, _this);
+          });
+        } else {
+          return this.parentNode.insertBefore(value, this);
+        }
       }
     });
     return this.remove();
   };
-  $$.fn.empty = function() {
+  return $$.fn.empty = function() {
     return this.each(function() {
       return this.innerHTML = null;
     });
   };
-  return _prependElement = function(parent, value, type) {
-    var _this = this;
-    if (type === "string") {
-      return parent.insertAdjacentHTML("afterbegin", value);
-    } else if (type === "array") {
-      return value.each(function(index, value) {
-        return parent.insertBefore(value, parent.firstChild);
-      });
-    } else {
-      return parent.insertBefore(value, parent.firstChild);
-    }
-  };
 })(Quo);
 
 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2 - 2
example/components/quojs/quo.js