Permalink
Browse files

add optional requirejs support

  • Loading branch information...
1 parent a625966 commit d5e4e761cd1f1e19eb2efaaba9a3b883f7f4c0a4 @jpmckinney jpmckinney committed Apr 16, 2013
@@ -1,3 +1,12 @@
+(function (callback) {
+ if (typeof define === 'function' && define.amd) {
+ define(['core/AbstractWidget', 'core/Parameter'], callback);
+ }
+ else {
+ callback();
+ }
+}(function () {
+
/**
* Baseclass for all facet widgets.
*
@@ -287,3 +296,5 @@ AjaxSolr.AbstractFacetWidget = AjaxSolr.AbstractWidget.extend(
return (exclude ? '-' : '') + this.field + ':' + AjaxSolr.Parameter.escapeValue(value);
}
});
+
+}));
@@ -1,3 +1,12 @@
+(function (callback) {
+ if (typeof define === 'function' && define.amd) {
+ define(['core/Core'], callback);
+ }
+ else {
+ callback();
+ }
+}(function () {
+
/**
* The Manager acts as the controller in a Model-View-Controller framework. All
* public calls should be performed on the manager object.
@@ -189,3 +198,5 @@ AjaxSolr.AbstractManager = AjaxSolr.Class.extend(
window.console && console.log && console.log(message);
}
});
+
+}));
@@ -1,3 +1,12 @@
+(function (callback) {
+ if (typeof define === 'function' && define.amd) {
+ define(['core/AbstractWidget'], callback);
+ }
+ else {
+ callback();
+ }
+}(function () {
+
/**
* Offers an interface to the local parameters used by the Spatial Solr plugin.
*
@@ -54,3 +63,11 @@ AjaxSolr.AbstractSpatialWidget = AjaxSolr.AbstractWidget.extend(
this.manager.store.get('q').remove('threadCount');
}
});
+
+if (typeof define === 'function' && define.amd) {
+ define(['core/AbstractWidget'], function () {
+ return AjaxSolr.AbstractSpatialWidget;
+ });
+}
+
+}));
@@ -1,3 +1,12 @@
+(function (callback) {
+ if (typeof define === 'function' && define.amd) {
+ define(['core/AbstractWidget'], callback);
+ }
+ else {
+ callback();
+ }
+}(function () {
+
/**
* Interacts with Solr's SpellCheckComponent.
*
@@ -76,3 +85,5 @@ AjaxSolr.AbstractSpellcheckWidget = AjaxSolr.AbstractWidget.extend(
*/
handleSuggestions: function () {}
});
+
+}));
@@ -1,3 +1,12 @@
+(function (callback) {
+ if (typeof define === 'function' && define.amd) {
+ define(['core/AbstractWidget'], callback);
+ }
+ else {
+ callback();
+ }
+}(function () {
+
/**
* Baseclass for all free-text widgets.
*
@@ -91,3 +100,5 @@ AjaxSolr.AbstractTextWidget = AjaxSolr.AbstractWidget.extend(
}
}
});
+
+}));
@@ -1,3 +1,12 @@
+(function (callback) {
+ if (typeof define === 'function' && define.amd) {
+ define(['core/Core'], callback);
+ }
+ else {
+ callback();
+ }
+}(function () {
+
/**
* Baseclass for all widgets.
*
@@ -90,3 +99,5 @@ AjaxSolr.AbstractWidget = AjaxSolr.Class.extend(
this.manager.doRequest(start || this.start, servlet || this.servlet);
}
});
+
+}));
View
@@ -1,5 +1,3 @@
-// $Id$
-
/**
* @namespace A unique namespace for the AJAX Solr library.
*/
View
@@ -1,3 +1,12 @@
+(function (callback) {
+ if (typeof define === 'function' && define.amd) {
+ define(['core/Core'], callback);
+ }
+ else {
+ callback();
+ }
+}(function () {
+
/**
* Represents a Solr parameter.
*
@@ -176,3 +185,5 @@ AjaxSolr.Parameter.escapeValue = function (value) {
}
return value;
}
+
+}));
@@ -1,3 +1,12 @@
+(function (callback) {
+ if (typeof define === 'function' && define.amd) {
+ define(['core/ParameterStore'], callback);
+ }
+ else {
+ callback();
+ }
+}(function () {
+
/**
* A parameter store that stores the values of exposed parameters in the URL
* hash to maintain the application's state.
@@ -122,3 +131,5 @@ AjaxSolr.ParameterHashStore = AjaxSolr.ParameterStore.extend(
}
}
});
+
+}));
@@ -1,3 +1,12 @@
+(function (callback) {
+ if (typeof define === 'function' && define.amd) {
+ define(['core/Core', 'core/Parameter'], callback);
+ }
+ else {
+ callback();
+ }
+}(function () {
+
/**
* The ParameterStore, as its name suggests, stores Solr parameters. Widgets
* expose some of these parameters to the user. Whenever the user changes the
@@ -367,3 +376,5 @@ AjaxSolr.ParameterStore = AjaxSolr.Class.extend(
return '';
}
});
+
+}));
@@ -1,3 +1,12 @@
+(function (callback) {
+ if (typeof define === 'function' && define.amd) {
+ define(['core/AbstractManager'], callback);
+ }
+ else {
+ callback();
+ }
+}(function () {
+
/**
* @see http://wiki.apache.org/solr/SolJSON#JSON_specific_parameters
* @class Manager
@@ -27,3 +36,5 @@ AjaxSolr.Manager = AjaxSolr.AbstractManager.extend(
jQuery.ajax(options).done(handler).fail(errorHandler);
}
});
+
+}));
@@ -1,3 +1,12 @@
+(function (callback) {
+ if (typeof define === 'function' && define.amd) {
+ define(['core/AbstractWidget'], callback);
+ }
+ else {
+ callback();
+ }
+}(function () {
+
(function ($) {
/**
@@ -283,3 +292,5 @@ AjaxSolr.PagerWidget = AjaxSolr.AbstractWidget.extend(
});
})(jQuery);
+
+}));

0 comments on commit d5e4e76

Please sign in to comment.