Skip to content

Instantly share code, notes, and snippets.

@yuxel
Created July 15, 2010 21:21
Show Gist options
  • Save yuxel/477552 to your computer and use it in GitHub Desktop.
Save yuxel/477552 to your computer and use it in GitHub Desktop.
@@ -8,7 +8,9 @@ var pageTitle = "";
var isOnList = false;
var itemStatus = 0;
-var baseUrl="http://sozluk.sourtimes.org/";
+//var baseUrl="http://sozluk.sourtimes.org/"; //good old days
+
+var baseUrl="http://www.eksisozluk.com/";
var sourPHPUrl=apiURL+ userName + "/" + userApiKey +"/";
//language constants
@@ -199,6 +201,7 @@ function getSubscriptionListData(){
* @param string pageTitle
*/
function addToList(pageTitle){
+ pageTitle = fixUriChars(pageTitle);
url = sourPHPUrl + "addToList/"+pageTitle+"/";
url += "?&jsoncallback=?";
@@ -238,6 +241,7 @@ function clickRemove(parentLi) {
* @param string pageTitle
*/
function removeFromList(pageTitle){
+ pageTitle = fixUriChars(pageTitle);
url = sourPHPUrl + "removeFromList/"+pageTitle+"/";
url += "?&jsoncallback=?";
@@ -262,6 +266,7 @@ function removeFromList(pageTitle){
* @param string pageTitle
*/
function setItemAsRead(pageTitle){
+ pageTitle = fixUriChars(pageTitle);
url = sourPHPUrl + "setItemAsRead/"+pageTitle+"/";
url += "?&jsoncallback=?";
@@ -300,7 +305,7 @@ function getItemsAsHtml (readStatus ) {
if( itemStatus == itemsWanted ) {
count ++;
itemTitle = item.attr("title");
- itemUrl = baseUrl + "show.asp?t="+itemTitle+"&i="+item.attr("lastId");
+ itemUrl = baseUrl + "show.asp?t="+fixUriChars(itemTitle)+"&i="+item.attr("lastId");
itemTitleTruncated = itemTitle;
if(itemTitleTruncated.length > 17) {
@@ -442,3 +447,11 @@ function includeCSS(){
document.getElementsByTagName("head")[0].appendChild(fileref);
}
+
+/**
+ * Fixes uri chars for eksi++ issue
+ */
+function fixUriChars(text) {
+ text = text.replace(/\+/g,"%2B");
+ return text;
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment