Skip to content

Commit

Permalink
removed JSON source - added JSON jar.
Browse files Browse the repository at this point in the history
  • Loading branch information
swestfall committed Aug 8, 2011
1 parent 39b2f8a commit f650490
Show file tree
Hide file tree
Showing 13 changed files with 12 additions and 3,502 deletions.
1 change: 0 additions & 1 deletion jqueryui-widget-testApp/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions jqueryui-widget-testApp/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
app.grails.version=1.3.7
app.name=jqueryui-widget-testApp
app.servlet.version=2.4
app.version=0.1.1
app.version=0.1
plugins.hibernate=1.3.7
plugins.jqueryui-widget=0.1
plugins.jqueryui-widget=0.1.1
plugins.tomcat=1.3.7
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<webroots>
<root url="file://$USER_HOME$/.grails/1.3.7/projects/jqueryui-widget-testApp/plugins/jquery-1.6.1.1/web-app" relative="/" />
<root url="file://$USER_HOME$/.grails/1.3.7/projects/jqueryui-widget-testApp/plugins/jquery-ui-1.8.11/web-app" relative="/" />
<root url="file://$USER_HOME$/.grails/1.3.7/projects/jqueryui-widget-testApp/plugins/jqueryui-widget-0.1.1/web-app" relative="/" />
</webroots>
<sourceRoots />
</configuration>
Expand All @@ -32,6 +33,14 @@
<excludeFolder url="file://$USER_HOME$/.grails/1.3.7/projects/jqueryui-widget-testApp/plugins/jquery-ui-1.8.11/target/test-classes" />
<excludeFolder url="file://$USER_HOME$/.grails/1.3.7/projects/jqueryui-widget-testApp/plugins/jquery-ui-1.8.11/web-app/plugins" />
</content>
<content url="file://$USER_HOME$/.grails/1.3.7/projects/jqueryui-widget-testApp/plugins/jqueryui-widget-0.1.1">
<sourceFolder url="file://$USER_HOME$/.grails/1.3.7/projects/jqueryui-widget-testApp/plugins/jqueryui-widget-0.1.1/src/java" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/1.3.7/projects/jqueryui-widget-testApp/plugins/jqueryui-widget-0.1.1/src/groovy" isTestSource="false" />
<sourceFolder url="file://$USER_HOME$/.grails/1.3.7/projects/jqueryui-widget-testApp/plugins/jqueryui-widget-0.1.1/grails-app/taglib" isTestSource="false" />
<excludeFolder url="file://$USER_HOME$/.grails/1.3.7/projects/jqueryui-widget-testApp/plugins/jqueryui-widget-0.1.1/target/classes" />
<excludeFolder url="file://$USER_HOME$/.grails/1.3.7/projects/jqueryui-widget-testApp/plugins/jqueryui-widget-0.1.1/target/test-classes" />
<excludeFolder url="file://$USER_HOME$/.grails/1.3.7/projects/jqueryui-widget-testApp/plugins/jqueryui-widget-0.1.1/web-app/plugins" />
</content>
<content url="file://$USER_HOME$/.grails/1.3.7/projects/jqueryui-widget-testApp/plugins/tomcat-1.3.7">
<sourceFolder url="file://$USER_HOME$/.grails/1.3.7/projects/jqueryui-widget-testApp/plugins/tomcat-1.3.7/src/groovy" isTestSource="false" />
<excludeFolder url="file://$USER_HOME$/.grails/1.3.7/projects/jqueryui-widget-testApp/plugins/tomcat-1.3.7/target/classes" />
Expand Down
1 change: 1 addition & 0 deletions jqueryui-widget-testApp/jqueryui-widget-testApp.iml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<jarDirectory url="file://$MODULE_DIR$/lib" recursive="false" />
</library>
</orderEntry>
<orderEntry type="module" module-name="jqueryuiWidget-inplacePlugin" exported="" />
</component>
</module>

Binary file added jqueryui-widget/lib/JSON_java_2.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -15,65 +15,12 @@ public class GrailsJQueryUIWidgetUtil {
return instance;
}

//TODO: determine if this is needed
public List<String> buildEventStrings(String name, List events) {
List<String> eventStrings = []
events.each() { it ->
String obj = it.obj ? it.obj : 'null'
String scope = it.scope ? it.scope : 'null'
eventStrings << "${name}.subscribe('${it.type}', ${it.fn}, ${obj}, ${scope}); "
}
return eventStrings;
}

//TODO: determine if this is needed
public List<String> buildMethodStrings(String name, List methods) {
List<String> methodStrings = []
methods.each() { it ->
methodStrings << "${name}.${it}; "
}
return methodStrings;
}

//TODO: determine if this is needed
public List<String> buildPropStrings(String name, List props) {
List<String> propStrings = []
props.each() { prop ->
propStrings << "${name}.${prop.name} = ${prop.val}"
}
return propStrings
}

public String toJSON(Object obj) {
if (obj instanceof Map) {
return new org.json.JSONObject(((Map) obj)).toString();
} else if (obj instanceof ArrayList) {
return new org.json.JSONArray(((Collection) obj)).toString();
}
}

public Map extractPaginationParams(GrailsParameterMap params) {
Map returnMap = [:]

def sort = params.remove('sort')
def order = params.remove('order')
def max = params.remove('max')
def offset = params.remove('offset')

if (sort) {
returnMap.sort = sort
}
if (order) {
returnMap.order = order
}
if (max) {
returnMap.max = max
}
if (offset) {
returnMap.offset = offset
}

return returnMap
}
}

Loading

0 comments on commit f650490

Please sign in to comment.