Changeset 534391
- Timestamp:
- 04/21/2012 08:57:23 AM (14 years ago)
- Location:
- spotify-embed-creator/trunk
- Files:
-
- 4 edited
-
Admin-pages/Spotify-Search-Page.php (modified) (3 diffs)
-
Admin-pages/edit-post-box.php (modified) (2 diffs)
-
Readme.txt (modified) (2 diffs)
-
Spotify-Embed-Creator.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
spotify-embed-creator/trunk/Admin-pages/Spotify-Search-Page.php
r533694 r534391 91 91 async: true, 92 92 timeout: 50000, 93 data: { searchtype: type, searchquery: query.replace(/ /g,"+") }, 94 success: function(data) { 95 console.log("lyckades"); 96 var html = '<ul class="result-list">'; 97 if(type == "artist") 98 { 99 for(var i = 0; i < data.artists.length; ++i) 100 { 101 //html += '<li>'+ data.artists[i].name +' - <input type="button" onClick="get_iframe_code(\''+data.artists[i].href+'\');" value="Skapa iframe"/></li>'; 102 } 103 } 104 if(type == "album") 105 { 106 for(var i = 0; i < data.albums.length; ++i) 107 { 108 //html += '<li>'+ data.albums[i].artists[0].name + ' - ' + data.albums[i].name +' - <input type="button" onClick="get_iframe_code(\''+data.albums[i].href+'\');" value="Skapa iframe"/></li>'; 109 html += '<li><a href="#" onClick="get_iframe_code(\''+data.albums[i].href+'\');">'+ data.albums[i].artists[0].name + ' - ' + data.albums[i].name +'</a></li>'; 110 } 111 } 112 if(type == "track") 113 { 114 for(var i = 0; i < data.tracks.length; ++i) 115 { 116 //html += '<li>'+ data.tracks[i].artists[0].name + ' - ' + data.tracks[i].name +' - <input type="button" onclick="get_iframe_code(\''+data.tracks[i].href+'\');" value="Skapa iframe"/></li>'; 117 html += '<li><a href="#" onclick="get_iframe_code(\''+data.tracks[i].href+'\');">' + data.tracks[i].artists[0].name + ' - ' + data.tracks[i].name +'</a></li>'; 118 } 119 } 120 html += '</ul>'; 121 jQuery("#spotify-result-container").html(html); 122 }, 123 error: function(data) { 124 if(data.status == 404) 125 { 126 alert("Something went wrong with the url (seems to happend on Binero)"); 127 } 128 else 129 { 130 console.log("misslyckades"); 131 alert("Something went wrong"); 132 } 133 } 134 }); 135 jQuery.ajax({ 136 type: "POST", 137 url: "<?php echo $pluginRoot ?>" + path + "/Api/Spotify-Request-handler.php", 138 async: true, 139 timeout: 50000, 93 140 data: { searchtype: type, searchquery: query }, 94 141 success: function(data) { … … 119 166 } 120 167 html += '</ul>'; 121 jQuery("#spotify-result-container"). html(html);168 jQuery("#spotify-result-container").append(html); 122 169 }, 123 170 error: function(data) { … … 132 179 } 133 180 } 134 }); 181 }); 135 182 } 136 183 -
spotify-embed-creator/trunk/Admin-pages/edit-post-box.php
r533694 r534391 94 94 jQuery("#spotify-preview-container").hide(); 95 95 jQuery("#codeboxes").hide(); 96 jQuery.ajax({97 type: "POST",98 url: "<?php echo $pluginRoot ?>/Api/Spotify-Request-handler.php",99 async: true,100 timeout: 50000,101 data: { searchtype: type, searchquery: query},102 success: function(data) {103 console.log("lyckades");104 var html = '<ul class="result-list">';105 if(type == "artist")106 {107 for(var i = 0; i < data.artists.length; ++i)108 {109 //html += '<li>'+ data.artists[i].name +' - <input type="button" onClick="get_iframe_code(\''+data.artists[i].href+'\');" value="Skapa iframe"/></li>';110 }111 }112 if(type == "album")113 {114 for(var i = 0; i < data.albums.length; ++i)115 {116 //html += '<li>'+ data.albums[i].artists[0].name + ' - ' + data.albums[i].name +' - <input type="button" onClick="get_iframe_code(\''+data.albums[i].href+'\');" value="Skapa iframe"/></li>';117 html += '<li><a href="#" onClick="get_iframe_code(\''+data.albums[i].href+'\');return false;">'+ data.albums[i].artists[0].name + ' - ' + data.albums[i].name +'</a></li>';118 }119 }120 if(type == "track")121 {122 for(var i = 0; i < data.tracks.length; ++i)123 {124 //html += '<li>'+ data.tracks[i].artists[0].name + ' - ' + data.tracks[i].name +' - <input type="button" onclick="get_iframe_code(\''+data.tracks[i].href+'\');" value="Skapa iframe"/></li>';125 html += '<li><a href="#" onclick="get_iframe_code(\''+data.tracks[i].href+'\'); return false;">' + data.tracks[i].artists[0].name + ' - ' + data.tracks[i].name +'</a></li>';126 }127 }128 html += '</ul>';129 jQuery("#spotify-result-container").html(html);130 },131 error: function(data) {132 if(data.status == 404)96 jQuery.ajax({ 97 type: "POST", 98 url: "<?php echo $pluginRoot ?>/Api/Spotify-Request-handler.php", 99 async: true, 100 timeout: 50000, 101 data: { searchtype: type, searchquery: query.replace(/ /g,"+") }, 102 success: function(data) { 103 console.log("lyckades"); 104 var html = '<ul class="result-list">'; 105 if(type == "artist") 106 { 107 for(var i = 0; i < data.artists.length; ++i) 108 { 109 //html += '<li>'+ data.artists[i].name +' - <input type="button" onClick="get_iframe_code(\''+data.artists[i].href+'\');" value="Skapa iframe"/></li>'; 110 } 111 } 112 if(type == "album") 113 { 114 for(var i = 0; i < data.albums.length; ++i) 115 { 116 //html += '<li>'+ data.albums[i].artists[0].name + ' - ' + data.albums[i].name +' - <input type="button" onClick="get_iframe_code(\''+data.albums[i].href+'\');" value="Skapa iframe"/></li>'; 117 html += '<li><a href="#" onClick="get_iframe_code(\''+data.albums[i].href+'\');">'+ data.albums[i].artists[0].name + ' - ' + data.albums[i].name +'</a></li>'; 118 } 119 } 120 if(type == "track") 121 { 122 for(var i = 0; i < data.tracks.length; ++i) 123 { 124 //html += '<li>'+ data.tracks[i].artists[0].name + ' - ' + data.tracks[i].name +' - <input type="button" onclick="get_iframe_code(\''+data.tracks[i].href+'\');" value="Skapa iframe"/></li>'; 125 html += '<li><a href="#" onclick="get_iframe_code(\''+data.tracks[i].href+'\');">' + data.tracks[i].artists[0].name + ' - ' + data.tracks[i].name +'</a></li>'; 126 } 127 } 128 html += '</ul>'; 129 jQuery("#spotify-result-container").html(html); 130 }, 131 error: function(data) { 132 if(data.status == 404) 133 133 { 134 134 alert("Something went wrong with the url (seems to happend on Binero)"); … … 139 139 alert("Something went wrong"); 140 140 } 141 } 142 }); 141 } 142 }); 143 jQuery.ajax({ 144 type: "POST", 145 url: "<?php echo $pluginRoot ?>/Api/Spotify-Request-handler.php", 146 async: true, 147 timeout: 50000, 148 data: { searchtype: type, searchquery: query }, 149 success: function(data) { 150 console.log("lyckades"); 151 var html = '<ul class="result-list">'; 152 if(type == "artist") 153 { 154 for(var i = 0; i < data.artists.length; ++i) 155 { 156 //html += '<li>'+ data.artists[i].name +' - <input type="button" onClick="get_iframe_code(\''+data.artists[i].href+'\');" value="Skapa iframe"/></li>'; 157 } 158 } 159 if(type == "album") 160 { 161 for(var i = 0; i < data.albums.length; ++i) 162 { 163 //html += '<li>'+ data.albums[i].artists[0].name + ' - ' + data.albums[i].name +' - <input type="button" onClick="get_iframe_code(\''+data.albums[i].href+'\');" value="Skapa iframe"/></li>'; 164 html += '<li><a href="#" onClick="get_iframe_code(\''+data.albums[i].href+'\');">'+ data.albums[i].artists[0].name + ' - ' + data.albums[i].name +'</a></li>'; 165 } 166 } 167 if(type == "track") 168 { 169 for(var i = 0; i < data.tracks.length; ++i) 170 { 171 //html += '<li>'+ data.tracks[i].artists[0].name + ' - ' + data.tracks[i].name +' - <input type="button" onclick="get_iframe_code(\''+data.tracks[i].href+'\');" value="Skapa iframe"/></li>'; 172 html += '<li><a href="#" onclick="get_iframe_code(\''+data.tracks[i].href+'\');">' + data.tracks[i].artists[0].name + ' - ' + data.tracks[i].name +'</a></li>'; 173 } 174 } 175 html += '</ul>'; 176 jQuery("#spotify-result-container").append(html); 177 }, 178 error: function(data) { 179 if(data.status == 404) 180 { 181 alert("Something went wrong with the url (seems to happend on Binero)"); 182 } 183 else 184 { 185 console.log("misslyckades"); 186 alert("Something went wrong"); 187 } 188 } 189 }); 143 190 } 144 191 -
spotify-embed-creator/trunk/Readme.txt
r533694 r534391 4 4 Requires at least: 3.0 5 5 Tested up to: 3.3 6 Stable tag: 1.0. 46 Stable tag: 1.0.5 7 7 8 8 Search for Album or Track on Spotify and create a Spotify Play Button. … … 35 35 == Changelog == 36 36 37 = 1.0.5 = 38 * Now doing a more strict search followed by a fuzzy, for more exact result 39 37 40 = 1.0.4 = 38 41 * dirname(__FILE__) instead of __DIR__ since it didn't work everywhere -
spotify-embed-creator/trunk/Spotify-Embed-Creator.php
r533694 r534391 5 5 Plugin URI: http://slowmove.se/wordpress-plugin-spotify-embed-creator/ 6 6 Description: Search for Album or Song on Spotify and create a Spotify Play Button 7 Version: 1.0. 47 Version: 1.0.5 8 8 Author: Erik Johansson 9 9 Author URI: http://slowmove.se
Note: See TracChangeset
for help on using the changeset viewer.