Skip to content

Commit

Permalink
hacking to support AMDJS module loaders (define.amd exists if it is a…
Browse files Browse the repository at this point in the history
…n amd loader)
  • Loading branch information
Daniel Lewis committed Aug 10, 2012
1 parent f7f4476 commit 81075b1
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/hyve.bitly.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function(root) {

var hyve = (typeof require == 'function') ? require('../src/hyve.core.js') : root.hyve
var hyve = (typeof require == 'function' && !(typeof define == 'function' && define.amd)) ? require('../src/hyve.core.js') : root.hyve

hyve.feeds['bitly'] = {
methods : ['unshorten','claim'],
Expand Down
4 changes: 2 additions & 2 deletions src/hyve.core.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function(root) {

var hyve = typeof exports != 'undefined'? exports : root.hyve = { }
var get = typeof require == 'function' && require('request')
var hyve = (typeof require == 'function' && !(typeof define == 'function' && define.amd)) ? require('../src/hyve.core.js') : root.hyve = {}
var get = typeof require == 'function' && !(typeof define == 'function' && define.amd) && require('request')

// ECMA-262 compatible Array#forEach polyfills
Array.prototype.forEach = Array.prototype.forEach || function(fn, ctx) {
Expand Down
2 changes: 1 addition & 1 deletion src/hyve.delicious.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function(root) {

var hyve = (typeof require == 'function') ? require('../src/hyve.core.js') : root.hyve
var hyve = (typeof require == 'function' && !(typeof define == 'function' && define.amd)) ? require('../src/hyve.core.js') : root.hyve

hyve.feeds['delicious'] = {
methods : ['search'],
Expand Down
2 changes: 1 addition & 1 deletion src/hyve.digg.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function(root) {

var hyve = (typeof require == 'function') ? require('../src/hyve.core.js') : root.hyve
var hyve = (typeof require == 'function' && !(typeof define == 'function' && define.amd)) ? require('../src/hyve.core.js') : root.hyve

hyve.feeds['digg'] = {
methods : ['search'],
Expand Down
2 changes: 1 addition & 1 deletion src/hyve.facebook.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function(root) {

var hyve = (typeof require == 'function') ? require('../src/hyve.core.js') : root.hyve
var hyve = (typeof require == 'function' && !(typeof define == 'function' && define.amd)) ? require('../src/hyve.core.js') : root.hyve

hyve.feeds['facebook'] = {
methods : ['search', 'friends', 'popular'],
Expand Down
2 changes: 1 addition & 1 deletion src/hyve.flickr.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function(root) {

var hyve = (typeof require == 'function') ? require('../src/hyve.core.js') : root.hyve
var hyve = (typeof require == 'function' && !(typeof define == 'function' && define.amd)) ? require('../src/hyve.core.js') : root.hyve

hyve.feeds['flickr'] = {
methods : ['search', 'friends'],
Expand Down
2 changes: 1 addition & 1 deletion src/hyve.foursquare.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function(root) {

var hyve = (typeof require == 'function') ? require('../src/hyve.core.js') : root.hyve
var hyve = (typeof require == 'function' && !(typeof define == 'function' && define.amd)) ? require('../src/hyve.core.js') : root.hyve

hyve.feeds['foursquare'] = {
methods : ['search'],
Expand Down
2 changes: 1 addition & 1 deletion src/hyve.identica.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function(root) {

var hyve = (typeof require == 'function') ? require('../src/hyve.core.js') : root.hyve
var hyve = (typeof require == 'function' && !(typeof define == 'function' && define.amd)) ? require('../src/hyve.core.js') : root.hyve

hyve.feeds['identica'] = {
methods : ['search'],
Expand Down
2 changes: 1 addition & 1 deletion src/hyve.imgur.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function(root) {

var hyve = (typeof require == 'function') ? require('../src/hyve.core.js') : root.hyve
var hyve = (typeof require == 'function' && !(typeof define == 'function' && define.amd)) ? require('../src/hyve.core.js') : root.hyve

hyve.feeds['imgur'] = {
methods : ['claim'],
Expand Down
2 changes: 1 addition & 1 deletion src/hyve.picasa.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function(root) {

var hyve = (typeof require == 'function') ? require('../src/hyve.core.js') : root.hyve
var hyve = (typeof require == 'function' && !(typeof define == 'function' && define.amd)) ? require('../src/hyve.core.js') : root.hyve

hyve.feeds['picasa'] = {
methods : ['search'],
Expand Down
2 changes: 1 addition & 1 deletion src/hyve.plus.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function(root) {

var hyve = (typeof require == 'function') ? require('../src/hyve.core.js') : root.hyve
var hyve = (typeof require == 'function' && !(typeof define == 'function' && define.amd)) ? require('../src/hyve.core.js') : root.hyve

hyve.feeds['plus'] = {
interval : 5000,
Expand Down
2 changes: 1 addition & 1 deletion src/hyve.reddit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function(root) {

var hyve = (typeof require == 'function') ? require('../src/hyve.core.js') : root.hyve
var hyve = (typeof require == 'function' && !(typeof define == 'function' && define.amd)) ? require('../src/hyve.core.js') : root.hyve

hyve.feeds['reddit'] = {
methods : ['search', 'popular'],
Expand Down
2 changes: 1 addition & 1 deletion src/hyve.twitter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function(root) {

var hyve = (typeof require == 'function') ? require('../src/hyve.core.js') : root.hyve
var hyve = (typeof require == 'function' && !(typeof define == 'function' && define.amd)) ? require('../src/hyve.core.js') : root.hyve

hyve.feeds.twitter = {
methods : ['search', 'friends', 'popular'],
Expand Down
2 changes: 1 addition & 1 deletion src/hyve.vimeo.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function(root) {

var hyve = (typeof require == 'function') ? require('../src/hyve.core.js') : root.hyve
var hyve = (typeof require == 'function' && !(typeof define == 'function' && define.amd)) ? require('../src/hyve.core.js') : root.hyve

hyve.feeds['vimeo'] = {
methods : ['claim'],
Expand Down
2 changes: 1 addition & 1 deletion src/hyve.wordpress.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function(root) {

var hyve = (typeof require == 'function') ? require('../src/hyve.core.js') : root.hyve
var hyve = (typeof require == 'function' && !(typeof define == 'function' && define.amd)) ? require('../src/hyve.core.js') : root.hyve

hyve.feeds['wordpress'] = {
methods : ['search'],
Expand Down
2 changes: 1 addition & 1 deletion src/hyve.youtube.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function(root) {

var hyve = (typeof require == 'function') ? require('../src/hyve.core.js') : root.hyve
var hyve = (typeof require == 'function' && !(typeof define == 'function' && define.amd)) ? require('../src/hyve.core.js') : root.hyve

hyve.feeds['youtube'] = {
methods : ['search','claim', 'friends', 'popular'],
Expand Down

0 comments on commit 81075b1

Please sign in to comment.