forked from easemob/web-im
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
14,206 additions
and
894 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"> | ||
<cross-domain-policy> | ||
<allow-access-from domain="*"/> | ||
</cross-domain-policy> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
Cookie Plug-in | ||
This plug in automatically gets all the cookies for this site and adds them to the post_params. | ||
Cookies are loaded only on initialization. The refreshCookies function can be called to update the post_params. | ||
The cookies will override any other post params with the same name. | ||
*/ | ||
|
||
var SWFUpload; | ||
if (typeof(SWFUpload) === "function") { | ||
SWFUpload.prototype.initSettings = function (old_initSettings) { | ||
return function (init_settings) { | ||
if (typeof(old_initSettings) === "function") { | ||
old_initSettings.call(this, init_settings); | ||
} | ||
this.refreshCookies(false); // The false parameter must be sent since SWFUpload has not initialzed at this point | ||
}; | ||
}(SWFUpload.prototype.initSettings); | ||
// refreshes the post_params and updates SWFUpload. The send_to_flash parameters is optional and defaults to True | ||
SWFUpload.prototype.refreshCookies = function (send_to_flash) { | ||
if (send_to_flash !== false) send_to_flash = true; | ||
// Get the post_params object | ||
var post_params = this.getSetting("post_params"); | ||
// Get the cookies | ||
var i, cookie_array = document.cookie.split(';'), ca_length = cookie_array.length, c, eq_index, name, value; | ||
for(i = 0; i < ca_length; i++) { | ||
c = cookie_array[i]; | ||
// Left Trim spaces | ||
while (c.charAt(0) == " ") { | ||
c = c.substring(1, c.length); | ||
} | ||
eq_index = c.indexOf("="); | ||
if (eq_index > 0) { | ||
name = c.substring(0, eq_index); | ||
value = c.substring(eq_index+1); | ||
post_params[name] = value; | ||
} | ||
} | ||
if (send_to_flash) { | ||
this.setPostParams(post_params); | ||
} | ||
}; | ||
} |
Oops, something went wrong.