Browse Source

Merge branch 'master' into mcm_fix

tags/gwtquery-project-1.5-beta1
Manolo Carrasco 9 years ago
parent
commit
7e2b73dd80

+ 8
- 0
README.md View File

@@ -11,3 +11,11 @@ Currently, almost the jQuery API is written and all CSS3 selectors should be sup
We are working in a brand new web site, in the meanwhile for more information/documentation
visit gQuery wiki pages at : https://code.google.com/p/gwtquery/

##Thanks to
[![Arcbees.com](http://i.imgur.com/HDf1qfq.png)](http://arcbees.com)

[![Vaadin.com](https://rawgit.com/manolo/vaadin-stuff/master/vaadin-ui.png)](http://vaadin.com)

[![Atlassian](http://i.imgur.com/BKkj8Rg.png)](https://www.atlassian.com/)

[![IntelliJ](https://lh6.googleusercontent.com/--QIIJfKrjSk/UJJ6X-UohII/AAAAAAAAAVM/cOW7EjnH778/s800/banner_IDEA.png)](http://www.jetbrains.com/idea/index.html)

+ 79
- 0
gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java View File

@@ -59,6 +59,7 @@ import com.google.gwt.query.client.plugins.events.EventsListener;
import com.google.gwt.query.client.plugins.widgets.WidgetsUtils;
import com.google.gwt.regexp.shared.MatchResult;
import com.google.gwt.regexp.shared.RegExp;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.EventListener;
@@ -298,6 +299,13 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
public static GQuery $(String selectorOrHtml) {
return $(selectorOrHtml, document);
}
/**
* This function accepts a SafeHtml creating a GQuery element containing those elements.
*/
public static GQuery $(SafeHtml safeHtml) {
return $(safeHtml.asString());
}

/**
* This function accepts a string containing a CSS selector which is then used to match a set of
@@ -853,6 +861,14 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
public GQuery after(String html) {
return domManip(html, DomMan.AFTER);
}
/**
* Insert content after each of the matched elements. The elements must already be inserted into
* the document (you can't insert an element after another if it's not in the page).
*/
public GQuery after(SafeHtml safeHtml) {
return after(safeHtml.asString());
}

private void allNextSiblingElements(Element firstChildElement, JsNodeArray result, Element elem,
GQuery until, String filterSelector) {
@@ -1093,6 +1109,14 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
public GQuery append(String html) {
return domManip(html, DomMan.APPEND);
}
/**
* Append content to the inside of every matched element. This operation is similar to doing an
* appendChild to all the specified elements, adding them into the document.
*/
public GQuery append(SafeHtml safeHtml) {
return append(safeHtml.asString());
}

/**
* All of the matched set of elements will be inserted at the end of the element(s) specified by
@@ -1131,6 +1155,17 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
$(html).append(this);
return this;
}
/**
* All of the matched set of elements will be inserted at the end of the element(s) specified by
* the parameter other.
*
* The operation $(A).appendTo(B) is, essentially, the reverse of doing a regular $(A).append(B),
* instead of appending B to A, you're appending A to B.
*/
public GQuery appendTo(SafeHtml safeHtml) {
return appendTo(safeHtml.asString());
}

/**
* Convert to Plugin interface provided by Class literal.
@@ -2476,6 +2511,13 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
}
return this;
}
/**
* Set the innerHTML of every matched element.
*/
public GQuery html(SafeHtml safeHtml) {
return html(safeHtml.asString());
}

/**
* Get the id of the first matched element.
@@ -4890,6 +4932,17 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
public GQuery wrap(String html) {
return wrap($(html));
}
/**
* Wrap each matched element with the specified SafeHtml content. This wrapping process is most useful
* for injecting additional structure into a document, without ruining the original semantic
* qualities of a document. This works by going through the first element provided (which is
* generated, on the fly, from the provided SafeHtml) and finds the deepest descendant element within
* its structure -- it is that element that will enwrap everything else.
*/
public GQuery wrap(SafeHtml safeHtml) {
return wrap(safeHtml.asString());
}

/**
* Wrap all the elements in the matched set into a single wrapper element. This is different from
@@ -4945,6 +4998,20 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
public GQuery wrapAll(String html) {
return wrapAll($(html));
}
/**
* Wrap all the elements in the matched set into a single wrapper element. This is different from
* .wrap() where each element in the matched set would get wrapped with an element. This wrapping
* process is most useful for injecting additional structure into a document, without ruining the
* original semantic qualities of a document.
*
* This works by going through the first element provided (which is generated, on the fly, from
* the provided SafeHtml) and finds the deepest descendant element within its structure -- it is that
* element that will enwrap everything else.
*/
public GQuery wrapAll(SafeHtml safeHtml) {
return wrapAll(safeHtml.asString());
}

/**
* Wrap the inner child contents of each matched element (including text nodes) with an HTML
@@ -4984,6 +5051,18 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
public GQuery wrapInner(String html) {
return wrapInner($(html));
}
/**
* Wrap the inner child contents of each matched element (including text nodes) with an SafeHtml
* structure. This wrapping process is most useful for injecting additional structure into a
* document, without ruining the original semantic qualities of a document. This works by going
* through the first element provided (which is generated, on the fly, from the provided SafeHtml) and
* finds the deepest ancestor element within its structure -- it is that element that will enwrap
* everything else.
*/
public GQuery wrapInner(SafeHtml safeHtml) {
return wrapInner(safeHtml.asString());
}

private String join(String chr, String... values) {
String value = "";

+ 1
- 1
samples/pom.xml View File

@@ -3,7 +3,7 @@
<parent>
<groupId>com.googlecode.gwtquery</groupId>
<artifactId>gwtquery-project</artifactId>
<version>1.4.3-SNAPSHOT</version>
<version>1.4.4-SNAPSHOT</version>
</parent>

<name>GwtQuery Samples</name>

+ 1
- 1
samples/src/main/java/gwtquery/samples/public/html/jquerybench.html View File

@@ -1,7 +1,7 @@
<html>
<head>
<title>JQuery</title>
<script language="javascript" src="../js/jquery-1.6.2.js"></script>
<script language="javascript" src="../js/jquery-2.1.3.min.js"></script>
<script type="text/javascript">
window.parent.jquerybenchmark = function(sel) {
return $(sel).length;

+ 1
- 1
samples/src/main/java/gwtquery/samples/public/html/sizzlebench.html View File

@@ -1,7 +1,7 @@
<html>
<head>
<title>Sizzle</title>
<script type="text/javascript" src="../js/sizzle.js"></script>
<script type="text/javascript" src="../js/sizzle.min.js"></script>
<script type="text/javascript">
window.parent.sizzlebenchmark = function(sel) {
return Sizzle(sel).length;

+ 4
- 0
samples/src/main/java/gwtquery/samples/public/js/jquery-2.1.3.min.js
File diff suppressed because it is too large
View File


+ 3
- 0
samples/src/main/java/gwtquery/samples/public/js/sizzle.min.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save