SoundCloud Is Gold - Version 2.0

Version Description

When updating to 2.0, if you're experiencing issues, deactivate and reactivate the plugin from the plugin page. This is due to switching to the Settings API. Sorry for the inconvenient.

=

Download this release

Release Info

Developer realTM
Plugin Icon wp plugin SoundCloud Is Gold
Version 2.0
Comparing to
See all releases

Code changes from version 1.0.6 to 2.0

Files changed (57) hide show
  1. ChunkFive-fontfacekit/demo.html +0 -33
  2. Quicksand-fontfacekit/demo.html +0 -63
  3. images/active.png +0 -0
  4. images/addPointer.png +0 -0
  5. noThumbnail.gif → images/noThumbnail.gif +0 -0
  6. images/pag.png +0 -0
  7. images/remove.png +0 -0
  8. soundcloud-is-gold-icon.png → images/soundcloud-is-gold-icon.png +0 -0
  9. soundcloud-logo-sc.png → images/soundcloud-logo-sc.png +0 -0
  10. {ChunkFive-fontfacekit → includes/ChunkFive-fontfacekit}/Chunkfive-webfont.eot +0 -0
  11. {ChunkFive-fontfacekit → includes/ChunkFive-fontfacekit}/Chunkfive-webfont.svg +0 -0
  12. {ChunkFive-fontfacekit → includes/ChunkFive-fontfacekit}/Chunkfive-webfont.ttf +0 -0
  13. {ChunkFive-fontfacekit → includes/ChunkFive-fontfacekit}/Chunkfive-webfont.woff +0 -0
  14. {ChunkFive-fontfacekit → includes/ChunkFive-fontfacekit}/SIL Open Font License 1.1.txt +0 -0
  15. {ChunkFive-fontfacekit → includes/ChunkFive-fontfacekit}/stylesheet.css +0 -0
  16. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand License.txt +0 -0
  17. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Bold-webfont.eot +0 -0
  18. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Bold-webfont.svg +0 -0
  19. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Bold-webfont.ttf +0 -0
  20. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Bold-webfont.woff +0 -0
  21. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Bold_Oblique-webfont.eot +0 -0
  22. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Bold_Oblique-webfont.svg +0 -0
  23. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Bold_Oblique-webfont.ttf +0 -0
  24. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Bold_Oblique-webfont.woff +0 -0
  25. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Book-webfont.eot +0 -0
  26. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Book-webfont.svg +0 -0
  27. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Book-webfont.ttf +0 -0
  28. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Book-webfont.woff +0 -0
  29. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Book_Oblique-webfont.eot +0 -0
  30. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Book_Oblique-webfont.svg +0 -0
  31. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Book_Oblique-webfont.ttf +0 -0
  32. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Book_Oblique-webfont.woff +0 -0
  33. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Dash-webfont.eot +0 -0
  34. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Dash-webfont.svg +0 -0
  35. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Dash-webfont.ttf +0 -0
  36. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Dash-webfont.woff +0 -0
  37. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Light-webfont.eot +0 -0
  38. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Light-webfont.svg +0 -0
  39. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Light-webfont.ttf +0 -0
  40. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Light-webfont.woff +0 -0
  41. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Light_Oblique-webfont.eot +0 -0
  42. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Light_Oblique-webfont.svg +0 -0
  43. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Light_Oblique-webfont.ttf +0 -0
  44. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Light_Oblique-webfont.woff +0 -0
  45. {Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/stylesheet.css +0 -0
  46. includes/jquery.carouFredSel-5.5.0-packed.js +15 -0
  47. readme.txt +25 -8
  48. screenshot-1.jpg +0 -0
  49. screenshot-2.jpg +0 -0
  50. screenshot-5.jpg +0 -0
  51. soundcloud-is-gold-advanced.php +60 -0
  52. soundcloud-is-gold-css.css +270 -14
  53. soundcloud-is-gold-functions.php +213 -48
  54. soundcloud-is-gold-js.js +194 -27
  55. soundcloud-is-gold.php +118 -67
  56. tinymce-plugin/soundcloud-is-gold-editor_plugin.css +1 -1
  57. uninstall.php +0 -11
ChunkFive-fontfacekit/demo.html DELETED
@@ -1,33 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
-
4
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
- <head>
6
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
-
8
- <title>Font Face Demo</title>
9
- <link rel="stylesheet" href="stylesheet.css" type="text/css" charset="utf-8">
10
- <style type="text/css" media="screen">
11
- h1.fontface {font: 60px/68px 'ChunkFiveRegular', Arial, sans-serif;letter-spacing: 0;}
12
-
13
- p.style1 {font: 18px/27px 'ChunkFiveRegular', Arial, sans-serif;}
14
-
15
- #container {
16
- width: 800px;
17
- margin-left: auto;
18
- margin-right: auto;
19
- }
20
- </style>
21
- </head>
22
-
23
- <body>
24
- <div id="container">
25
- <h1 class="fontface">Font-face Demo for the ChunkFive Font</h1>
26
-
27
-
28
-
29
- <p class="style1">ChunkFive Regular - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
30
-
31
- </div>
32
- </body>
33
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Quicksand-fontfacekit/demo.html DELETED
@@ -1,63 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
-
4
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
- <head>
6
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
-
8
- <title>Font Face Demo</title>
9
- <link rel="stylesheet" href="stylesheet.css" type="text/css" charset="utf-8">
10
- <style type="text/css" media="screen">
11
- h1.fontface {font: 60px/68px 'QuicksandLight', Arial, sans-serif;letter-spacing: 0;}
12
-
13
- p.style1 {font: 18px/27px 'QuicksandLight', Arial, sans-serif;}
14
- p.style2 {font: 18px/27px 'QuicksandLightOblique', Arial, sans-serif;}
15
- p.style3 {font: 18px/27px 'QuicksandBook', Arial, sans-serif;}
16
- p.style4 {font: 18px/27px 'QuicksandBookOblique', Arial, sans-serif;}
17
- p.style5 {font: 18px/27px 'QuicksandBold', Arial, sans-serif;}
18
- p.style6 {font: 18px/27px 'QuicksandBoldOblique', Arial, sans-serif;}
19
- p.style7 {font: 18px/27px 'QuicksandDash', Arial, sans-serif;}
20
-
21
- #container {
22
- width: 800px;
23
- margin-left: auto;
24
- margin-right: auto;
25
- }
26
- </style>
27
- </head>
28
-
29
- <body>
30
- <div id="container">
31
- <h1 class="fontface">Font-face Demo for the Quicksand Font</h1>
32
-
33
-
34
-
35
- <p class="style1">Quicksand Light - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
36
-
37
-
38
-
39
- <p class="style2">Quicksand Light Oblique - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
40
-
41
-
42
-
43
- <p class="style3">Quicksand Book - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
44
-
45
-
46
-
47
- <p class="style4">Quicksand Book Oblique - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
48
-
49
-
50
-
51
- <p class="style5">Quicksand Bold - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
52
-
53
-
54
-
55
- <p class="style6">Quicksand Bold Oblique - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
56
-
57
-
58
-
59
- <p class="style7">Quicksand Dash - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
60
-
61
- </div>
62
- </body>
63
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
images/active.png ADDED
Binary file
images/addPointer.png ADDED
Binary file
noThumbnail.gif → images/noThumbnail.gif RENAMED
File without changes
images/pag.png ADDED
Binary file
images/remove.png ADDED
Binary file
soundcloud-is-gold-icon.png → images/soundcloud-is-gold-icon.png RENAMED
File without changes
soundcloud-logo-sc.png → images/soundcloud-logo-sc.png RENAMED
File without changes
{ChunkFive-fontfacekit → includes/ChunkFive-fontfacekit}/Chunkfive-webfont.eot RENAMED
File without changes
{ChunkFive-fontfacekit → includes/ChunkFive-fontfacekit}/Chunkfive-webfont.svg RENAMED
File without changes
{ChunkFive-fontfacekit → includes/ChunkFive-fontfacekit}/Chunkfive-webfont.ttf RENAMED
File without changes
{ChunkFive-fontfacekit → includes/ChunkFive-fontfacekit}/Chunkfive-webfont.woff RENAMED
File without changes
{ChunkFive-fontfacekit → includes/ChunkFive-fontfacekit}/SIL Open Font License 1.1.txt RENAMED
File without changes
{ChunkFive-fontfacekit → includes/ChunkFive-fontfacekit}/stylesheet.css RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand License.txt RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Bold-webfont.eot RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Bold-webfont.svg RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Bold-webfont.ttf RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Bold-webfont.woff RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Bold_Oblique-webfont.eot RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Bold_Oblique-webfont.svg RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Bold_Oblique-webfont.ttf RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Bold_Oblique-webfont.woff RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Book-webfont.eot RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Book-webfont.svg RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Book-webfont.ttf RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Book-webfont.woff RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Book_Oblique-webfont.eot RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Book_Oblique-webfont.svg RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Book_Oblique-webfont.ttf RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Book_Oblique-webfont.woff RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Dash-webfont.eot RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Dash-webfont.svg RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Dash-webfont.ttf RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Dash-webfont.woff RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Light-webfont.eot RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Light-webfont.svg RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Light-webfont.ttf RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Light-webfont.woff RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Light_Oblique-webfont.eot RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Light_Oblique-webfont.svg RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Light_Oblique-webfont.ttf RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/Quicksand_Light_Oblique-webfont.woff RENAMED
File without changes
{Quicksand-fontfacekit → includes/Quicksand-fontfacekit}/stylesheet.css RENAMED
File without changes
includes/jquery.carouFredSel-5.5.0-packed.js ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery carouFredSel 5.5.0
3
+ * Demo's and documentation:
4
+ * caroufredsel.frebsite.nl
5
+ *
6
+ * Copyright (c) 2012 Fred Heusschen
7
+ * www.frebsite.nl
8
+ *
9
+ * Dual licensed under the MIT and GPL licenses.
10
+ * http://en.wikipedia.org/wiki/MIT_License
11
+ * http://en.wikipedia.org/wiki/GNU_General_Public_License
12
+ */
13
+
14
+
15
+ eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(I($){8($.1R.1K)J;$.1R.1K=I(y,z){8(1i.V==0){1c(M,\'5O 4C 6x 1o "\'+1i.3Y+\'".\');J 1i}8(1i.V>1){J 1i.1P(I(){$(1i).1K(y,z)})}F A=1i,$19=1i[0];8(A.1q(\'4t\')){F B=A.1A(\'6a\');A.X(\'68\',M)}Q{F B=O}A.44=I(o,b,c){o=4p($19,o);8(o.1c){H.1c=o.1c;1c(H,\'6w "1c" 7v 7d 73 6R 3J 5B 6B 4v-1k.\')}F e=[\'G\',\'1m\',\'T\',\'17\',\'1a\',\'1b\'];1o(F a=0,l=e.V;a<l;a++){o[e[a]]=4p($19,o[e[a]])}8(K o.1m==\'14\'){8(o.1m<=50)o.1m={\'G\':o.1m};Q o.1m={\'1j\':o.1m}}Q{8(K o.1m==\'1l\')o.1m={\'1I\':o.1m}}8(K o.G==\'14\')o.G={\'P\':o.G};Q 8(o.G==\'1d\')o.G={\'P\':o.G,\'S\':o.G,\'1u\':o.G};8(K o.G!=\'1k\')o.G={};8(b)2y=$.26(M,{},$.1R.1K.4x,o);7=$.26(M,{},$.1R.1K.4x,o);8(K 7.G.12!=\'1k\')7.G.12={};8(7.G.2K==0&&K c==\'14\'){7.G.2K=c}C.4A=(7.2L);C.2r=(7.2r==\'4E\'||7.2r==\'1s\')?\'1a\':\'17\';F f=[[\'S\',\'3c\',\'27\',\'1u\',\'5D\',\'2Z\',\'1s\',\'32\',\'1E\',0,1,2,3],[\'1u\',\'5D\',\'2Z\',\'S\',\'3c\',\'27\',\'32\',\'1s\',\'3V\',3,2,1,0]];F g=f[0].V,5G=(7.2r==\'2U\'||7.2r==\'1s\')?0:1;7.d={};1o(F d=0;d<g;d++){7.d[f[0][d]]=f[5G][d]}F h=A.11();1x(K 7.G.P){W\'1k\':7.G.12.2M=7.G.P.2M;7.G.12.2i=7.G.P.2i;7.G.P=O;18;W\'1l\':8(7.G.P==\'1d\'){7.G.12.1d=M}Q{7.G.12.2p=7.G.P}7.G.P=O;18;W\'I\':7.G.12.2p=7.G.P;7.G.P=O;18}8(K 7.G.1v==\'1y\'){7.G.1v=(h.1v(\':2P\').V>0)?\':P\':\'*\'}8(7[7.d[\'S\']]==\'T\'){7[7.d[\'S\']]=3C(h,7,\'27\')}8(4n(7[7.d[\'S\']])&&!7.2L){7[7.d[\'S\']]=3Z(3g($1D.3e(),7,\'3c\'),7[7.d[\'S\']]);C.4A=M}8(7[7.d[\'1u\']]==\'T\'){7[7.d[\'1u\']]=3C(h,7,\'2Z\')}8(!7.G[7.d[\'S\']]){8(7.2L){1c(M,\'6k a \'+7.d[\'S\']+\' 1o 5B G!\');7.G[7.d[\'S\']]=3C(h,7,\'27\')}Q{7.G[7.d[\'S\']]=(5p(h,7,\'27\'))?\'1d\':h[7.d[\'27\']](M)}}8(!7.G[7.d[\'1u\']]){7.G[7.d[\'1u\']]=(5p(h,7,\'2Z\'))?\'1d\':h[7.d[\'2Z\']](M)}8(!7[7.d[\'1u\']]){7[7.d[\'1u\']]=7.G[7.d[\'1u\']]}8(!7.G.P&&!7.2L){8(7.G[7.d[\'S\']]==\'1d\'){7.G.12.1d=M}8(!7.G.12.1d){8(K 7[7.d[\'S\']]==\'14\'){7.G.P=1O.35(7[7.d[\'S\']]/7.G[7.d[\'S\']])}Q{F i=3g($1D.3e(),7,\'3c\');7.G.P=1O.35(i/7.G[7.d[\'S\']]);7[7.d[\'S\']]=7.G.P*7.G[7.d[\'S\']];8(!7.G.12.2p)7.1B=O}8(7.G.P==\'6Z\'||7.G.P<1){1c(M,\'2b a 4q 14 3T P G: 6k 3J "1d".\');7.G.12.1d=M}}}8(!7[7.d[\'S\']]){7[7.d[\'S\']]=\'1d\';8(!7.2L&&7.G.1v==\'*\'&&!7.G.12.1d&&7.G[7.d[\'S\']]!=\'1d\'){7[7.d[\'S\']]=7.G.P*7.G[7.d[\'S\']];7.1B=O}}8(7.G.12.1d){7.3S=(7[7.d[\'S\']]==\'1d\')?3g($1D.3e(),7,\'3c\'):7[7.d[\'S\']];8(7.1B===O){7[7.d[\'S\']]=\'1d\'}7.G.P=2J(h,7,0)}Q 8(7.G.1v!=\'*\'){7.G.12.4c=7.G.P;7.G.P=3R(h,7,0)}8(K 7.1B==\'1y\'){7.1B=(7[7.d[\'S\']]==\'1d\')?O:\'5r\'}7.G.P=2N(7.G.P,7,7.G.12.2p,$19);7.G.12.2q=7.G.P;7.1t=O;8(7.2L){8(!7.G.12.2M)7.G.12.2M=7.G.P;8(!7.G.12.2i)7.G.12.2i=7.G.P;7.1B=O;7.1h=[0,0,0,0];F j=$1D.1W(\':P\');8(j)$1D.3f();F k=3Z(3g($1D.3e(),7,\'3c\'),7[7.d[\'S\']]);8(K 7[7.d[\'S\']]==\'14\'&&k<7[7.d[\'S\']]){k=7[7.d[\'S\']]}8(j)$1D.3j();F m=5k(1O.2O(k/7.G[7.d[\'S\']]),7.G.12);8(m>h.V){m=h.V}F n=1O.35(k/m),5g=7[7.d[\'1u\']],69=4n(5g);h.1P(I(){F a=$(1i),5e=n-66(a,7,\'72\');a[7.d[\'S\']](5e);8(69){a[7.d[\'1u\']](3Z(5e,5g))}});7.G.P=m;7.G[7.d[\'S\']]=n;7[7.d[\'S\']]=m*n}Q{7.1h=5T(7.1h);8(7.1B==\'32\')7.1B=\'1s\';8(7.1B==\'5a\')7.1B=\'2U\';1x(7.1B){W\'5r\':W\'1s\':W\'2U\':8(7[7.d[\'S\']]!=\'1d\'){F p=4l(3p(h,7),7);7.1t=M;7.1h[7.d[1]]=p[1];7.1h[7.d[3]]=p[0]}18;2z:7.1B=O;7.1t=(7.1h[0]==0&&7.1h[1]==0&&7.1h[2]==0&&7.1h[3]==0)?O:M;18}}8(K 7.2t==\'1r\'&&7.2t)7.2t=\'7D\'+A.6L(\'6Q\');8(K 7.G.3r!=\'14\')7.G.3r=7.G.P;8(K 7.1m.1j!=\'14\')7.1m.1j=5N;8(K 7.1m.G==\'1y\')7.1m.G=(7.G.12.1d||7.G.1v!=\'*\')?\'P\':7.G.P;7.T=3w($19,7.T,\'T\');7.17=3w($19,7.17);7.1a=3w($19,7.1a);7.1b=3w($19,7.1b,\'1b\');7.T=$.26(M,{},7.1m,7.T);7.17=$.26(M,{},7.1m,7.17);7.1a=$.26(M,{},7.1m,7.1a);7.1b=$.26(M,{},7.1m,7.1b);8(K 7.1b.48!=\'1r\')7.1b.48=O;8(K 7.1b.34!=\'I\'&&7.1b.34!==O)7.1b.34=$.1R.1K.5M;8(K 7.T.1G!=\'1r\')7.T.1G=M;8(K 7.T.56!=\'14\')7.T.56=0;8(K 7.T.3W==\'1y\')7.T.3W=M;8(K 7.T.55!=\'1r\')7.T.55=M;8(K 7.T.3q!=\'14\')7.T.3q=(7.T.1j<10)?7l:7.T.1j*5;8(7.2j){7.2j=4Z(7.2j)}8(H.1c){1c(H,\'3n S: \'+7.S);1c(H,\'3n 1u: \'+7.1u);8(7.3S)1c(H,\'71 \'+7.d[\'S\']+\': \'+7.3S);1c(H,\'5A 76: \'+7.G.S);1c(H,\'5A 7i: \'+7.G.1u);1c(H,\'4i 3T G P: \'+7.G.P);8(7.T.1G)1c(H,\'4i 3T G 4Y 6A: \'+7.T.G);8(7.17.Y)1c(H,\'4i 3T G 4Y 4X: \'+7.17.G);8(7.1a.Y)1c(H,\'4i 3T G 4Y 5x: \'+7.1a.G)}};A.5t=I(){A.1q(\'4t\',M);F a={\'4U\':A.16(\'4U\'),\'4T\':A.16(\'4T\'),\'3K\':A.16(\'3K\'),\'32\':A.16(\'32\'),\'2U\':A.16(\'2U\'),\'5a\':A.16(\'5a\'),\'1s\':A.16(\'1s\'),\'S\':A.16(\'S\'),\'1u\':A.16(\'1u\'),\'4R\':A.16(\'4R\'),\'1E\':A.16(\'1E\'),\'3V\':A.16(\'3V\'),\'4P\':A.16(\'4P\')};1x(a.3K){W\'4N\':F b=\'4N\';18;W\'5X\':F b=\'5X\';18;2z:F b=\'6S\'}$1D.16(a).16({\'6T\':\'2P\',\'3K\':b});A.1q(\'5V\',a).16({\'4U\':\'1s\',\'4T\':\'4g\',\'3K\':\'4N\',\'32\':0,\'1s\':0,\'4R\':0,\'1E\':0,\'3V\':0,\'4P\':0});8(7.1t){A.11().1P(I(){F m=2o($(1i).16(7.d[\'1E\']));8(2s(m))m=0;$(1i).1q(\'1V\',m)})}};A.5S=I(){A.4L();A.13(L(\'4J\',H),I(e,a){e.1e();8(!C.22){8(7.T.Y){7.T.Y.31(2l(\'43\',H))}}C.22=M;8(7.T.1G){7.T.1G=O;A.X(L(\'2X\',H),a)}J M});A.13(L(\'4I\',H),I(e){e.1e();8(C.1U){3P(R)}J M});A.13(L(\'2X\',H),I(e,a,b){e.1e();1F=3d(1F);8(a&&C.1U){R.22=M;F c=2C()-R.2Q;R.1j-=c;8(R.1p)R.1p.1j-=c;8(R.1Q)R.1Q.1j-=c;3P(R,O)}8(!C.1Y&&!C.1U){8(b)1F.3v+=2C()-1F.2Q}8(!C.1Y){8(7.T.Y){7.T.Y.31(2l(\'6s\',H))}}C.1Y=M;8(7.T.6d){F d=7.T.3q-1F.3v,3G=3F-1O.2O(d*3F/7.T.3q);7.T.6d.1z($19,3G,d)}J M});A.13(L(\'1G\',H),I(e,b,c,d){e.1e();1F=3d(1F);F v=[b,c,d],t=[\'1l\',\'14\',\'1r\'],a=2Y(v,t);F b=a[0],c=a[1],d=a[2];8(b!=\'17\'&&b!=\'1a\')b=C.2r;8(K c!=\'14\')c=0;8(K d!=\'1r\')d=O;8(d){C.22=O;7.T.1G=M}8(!7.T.1G){e.23();J 1c(H,\'3n 43: 2b 2R.\')}8(C.1Y){8(7.T.Y){7.T.Y.2v(2l(\'43\',H));7.T.Y.2v(2l(\'6s\',H))}}C.1Y=O;1F.2Q=2C();F f=7.T.3q+c;3x=f-1F.3v;3G=3F-1O.2O(3x*3F/f);1F.T=7a(I(){8(7.T.5Q){7.T.5Q.1z($19,3G,3x)}8(C.1U){A.X(L(\'1G\',H),b)}Q{A.X(L(b,H),7.T)}},3x);8(7.T.5I){7.T.5I.1z($19,3G,3x)}J M});A.13(L(\'2H\',H),I(e){e.1e();8(R.22){R.22=O;C.1Y=O;C.1U=M;R.2Q=2C();2f(R)}Q{A.X(L(\'1G\',H))}J M});A.13(L(\'17\',H)+\' \'+L(\'1a\',H),I(e,b,f,g){e.1e();8(C.22||A.1W(\':2P\')){e.23();J 1c(H,\'3n 43 6I 2P: 2b 2R.\')}8(7.G.3r>=N.U){e.23();J 1c(H,\'2b 5F G (\'+N.U+\', \'+7.G.3r+\' 5E): 2b 2R.\')}F v=[b,f,g],t=[\'1k\',\'14/1l\',\'I\'],a=2Y(v,t);F b=a[0],f=a[1],g=a[2];F h=e.4w.3U(H.3o.3B.V);8(K b!=\'1k\'||b==2c)b=7[h];8(K g==\'I\')b.24=g;8(K f!=\'14\'){8(7.G.1v!=\'*\'){f=\'P\'}Q{F i=[f,b.G,7[h].G];1o(F a=0,l=i.V;a<l;a++){8(K i[a]==\'14\'||i[a]==\'5y\'||i[a]==\'P\'){f=i[a];18}}}1x(f){W\'5y\':e.23();J A.1A(h+\'7j\',[b,g]);18;W\'P\':8(!7.G.12.1d&&7.G.1v==\'*\'){f=7.G.P}18}}8(R.22){A.X(L(\'2H\',H));A.X(L(\'3k\',H),[h,[b,f,g]]);e.23();J 1c(H,\'3n 7o 2R.\')}8(b.1j>0){8(C.1U){8(b.3k)A.X(L(\'3k\',H),[h,[b,f,g]]);e.23();J 1c(H,\'3n 7y 2R.\')}}8(b.4u&&!b.4u.1z($19)){e.23();J 1c(H,\'6y "4u" 6z O.\')}1F.3v=0;A.X(\'6r\'+h,[b,f]);8(7.2j){F s=7.2j,c=[b,f];1o(F j=0,l=s.V;j<l;j++){F d=h;8(!s[j][1])c[0]=s[j][0].1A(\'6c\',h);8(!s[j][2])d=(d==\'17\')?\'1a\':\'17\';c[1]=f+s[j][3];s[j][0].X(\'6r\'+d,c)}}J M});A.13(L(\'6K\',H,O),I(e,f,g){e.1e();F h=A.11();8(!7.1N){8(N.Z==0){8(7.3h){A.X(L(\'1a\',H),N.U-1)}J e.23()}}8(7.1t)1M(h,7);8(K g!=\'14\'){8(7.G.12.1d){g=47(h,7,N.U-1)}Q 8(7.G.1v!=\'*\'){F i=(K f.G==\'14\')?f.G:4V(A,7);g=6t(h,7,N.U-1,i)}Q{g=7.G.P}g=4b(g,7,f.G,$19)}8(!7.1N){8(N.U-g<N.Z){g=N.U-N.Z}}7.G.12.2q=7.G.P;8(7.G.12.1d){F j=2J(h,7,N.U-g);8(7.G.P+g<=j&&g<N.U){g++;j=2J(h,7,N.U-g)}7.G.P=2N(j,7,7.G.12.2p,$19)}Q 8(7.G.1v!=\'*\'){F j=3R(h,7,N.U-g);7.G.P=2N(j,7,7.G.12.2p,$19)}8(7.1t)1M(h,7,M);8(g==0){e.23();J 1c(H,\'0 G 3J 1m: 2b 2R.\')}1c(H,\'6m \'+g+\' G 4X.\');N.Z+=g;1Z(N.Z>=N.U){N.Z-=N.U}8(!7.1N){8(N.Z==0&&f.4d)f.4d.1z($19);8(!7.3h)2T(7,N.Z,H)}A.11().1g(N.U-g,N.U).7g(A);8(N.U<7.G.P+g){A.11().1g(0,(7.G.P+g)-N.U).4f(M).3O(A)}F h=A.11(),2n=6l(h,7,g),1T=6b(h,7),28=h.1L(g-1),2d=2n.2I(),2x=1T.2I();8(7.1t)1M(h,7);8(7.1B){F p=4l(1T,7),k=p[0],2k=p[1]}Q{F k=0,2k=0}F l=(k<0)?7.1h[7.d[3]]:0;8(f.1H==\'5z\'&&7.G.P<g){F m=h.1g(7.G.12.2q,g),4m=7.G[7.d[\'S\']];m.1P(I(){F a=$(1i);a.1q(\'4j\',a.1W(\':2P\')).3f()});7.G[7.d[\'S\']]=\'1d\'}Q{F m=O}F n=36(h.1g(0,g),7,\'S\'),29=4a(2E(1T,7,M),7,!7.1t);8(m)7.G[7.d[\'S\']]=4m;8(7.1t){1M(h,7,M);8(2k>=0){1M(2d,7,7.1h[7.d[1]])}1M(28,7,7.1h[7.d[3]])}8(7.1B){7.1h[7.d[1]]=2k;7.1h[7.d[3]]=k}F o={},1w=f.1j;8(f.1H==\'4g\')1w=0;Q 8(1w==\'T\')1w=7.1m.1j/7.1m.G*g;Q 8(1w<=0)1w=0;Q 8(1w<10)1w=n/1w;R=20(1w,f.1I);8(7[7.d[\'S\']]==\'1d\'||7[7.d[\'1u\']]==\'1d\'){R.1f.1n([$1D,29])}8(7.1t){F q=7.1h[7.d[3]];8(2x.4s(28).V){F r={};r[7.d[\'1E\']]=28.1q(\'1V\');8(k<0)28.16(r);Q R.1f.1n([28,r])}8(2x.4s(2d).V){F s={};s[7.d[\'1E\']]=2d.1q(\'1V\');R.1f.1n([2d,s])}8(2k>=0){F t={};t[7.d[\'1E\']]=2x.1q(\'1V\')+7.1h[7.d[1]];R.1f.1n([2x,t])}}Q{F q=0}o[7.d[\'1s\']]=q;F u=[2n,1T,29,1w];8(f.2a)f.2a.3E($19,u);1X.2a=3z(1X.2a,$19,u);1x(f.1H){W\'2u\':W\'2e\':W\'2G\':W\'2h\':R.1p=20(R.1j,R.1I);R.1Q=20(R.1j,R.1I);R.1j=0;18}1x(f.1H){W\'2e\':W\'2G\':W\'2h\':F v=A.4f().3O($1D);18}1x(f.1H){W\'2h\':v.11().1g(0,g).1J();W\'2e\':W\'2G\':v.11().1g(7.G.P).1J();18}1x(f.1H){W\'2u\':R.1p.1f.1n([A,{\'2g\':0}]);18;W\'2e\':v.16({\'2g\':0});R.1p.1f.1n([A,{\'S\':\'+=0\'},I(){v.1J()}]);R.1Q.1f.1n([v,{\'2g\':1}]);18;W\'2G\':R=4y(R,A,v,7,M);18;W\'2h\':R=4z(R,A,v,7,M,g);18}F w=I(){F b=7.G.P+g-N.U;8(b>0){A.11().1g(N.U).1J();2n=A.11().1g(N.U-(g-b)).3X().6e(A.11().1g(0,b).3X())}8(m){m.1P(I(){F a=$(1i);8(!a.1q(\'4j\'))a.3j()})}8(7.1t){F c=A.11().1L(7.G.P+g-1);c.16(7.d[\'1E\'],c.1q(\'1V\'))}R.1f=[];8(R.1p)R.1p=20(R.4B,R.1I);F d=I(){1x(f.1H){W\'2u\':W\'2e\':A.16(\'1v\',\'\');18}R.1Q=20(0,2c);C.1U=O;F a=[2n,1T,29];8(f.24)f.24.3E($19,a);1X.24=3z(1X.24,$19,a);8(1S.V){A.X(L(1S[0][0],H),1S[0][1]);1S.6p()}8(!C.1Y)A.X(L(\'1G\',H))};1x(f.1H){W\'2u\':R.1p.1f.1n([A,{\'2g\':1},d]);2f(R.1p);18;W\'2h\':R.1p.1f.1n([A,{\'S\':\'+=0\'},d]);2f(R.1p);18;2z:d();18}};R.1f.1n([A,o,w]);C.1U=M;A.16(7.d[\'1s\'],-(n-l));1F=3d(1F);2f(R);4D(7.2t,A.1A(L(\'3H\',H)));A.X(L(\'2B\',H),[O,29]);J M});A.13(L(\'6V\',H,O),I(e,f,g){e.1e();F h=A.11();8(!7.1N){8(N.Z==7.G.P){8(7.3h){A.X(L(\'17\',H),N.U-1)}J e.23()}}8(7.1t)1M(h,7);8(K g!=\'14\'){8(7.G.1v!=\'*\'){F i=(K f.G==\'14\')?f.G:4V(A,7);g=5w(h,7,0,i)}Q{g=7.G.P}g=4b(g,7,f.G,$19)}F j=(N.Z==0)?N.U:N.Z;8(!7.1N){8(7.G.12.1d){F k=2J(h,7,g),i=47(h,7,j-1)}Q{F k=7.G.P,i=7.G.P}8(g+k>j){g=j-i}}7.G.12.2q=7.G.P;8(7.G.12.1d){F k=4F(h,7,g,j);1Z(7.G.P-g>=k&&g<N.U){g++;k=4F(h,7,g,j)}7.G.P=2N(k,7,7.G.12.2p,$19)}Q 8(7.G.1v!=\'*\'){F k=3R(h,7,g);7.G.P=2N(k,7,7.G.12.2p,$19)}8(7.1t)1M(h,7,M);8(g==0){e.23();J 1c(H,\'0 G 3J 1m: 2b 2R.\')}1c(H,\'6m \'+g+\' G 5x.\');N.Z-=g;1Z(N.Z<0){N.Z+=N.U}8(!7.1N){8(N.Z==7.G.P&&f.4d)f.4d.1z($19);8(!7.3h)2T(7,N.Z,H)}8(N.U<7.G.P+g){A.11().1g(0,(7.G.P+g)-N.U).4f(M).3O(A)}F h=A.11(),2n=4G(h,7),1T=4H(h,7,g),28=h.1L(g-1),2d=2n.2I(),2x=1T.2I();8(7.1t)1M(h,7);8(7.1B){F p=4l(1T,7),l=p[0],2k=p[1]}Q{F l=0,2k=0}8(f.1H==\'5z\'&&7.G.12.2q<g){F m=h.1g(7.G.12.2q,g),4m=7.G[7.d[\'S\']];m.1P(I(){F a=$(1i);a.1q(\'4j\',a.1W(\':2P\')).3f()});7.G[7.d[\'S\']]=\'1d\'}Q{F m=O}F n=36(h.1g(0,g),7,\'S\'),29=4a(2E(1T,7,M),7,!7.1t);8(m)7.G[7.d[\'S\']]=4m;8(7.1B){8(7.1h[7.d[1]]<0){7.1h[7.d[1]]=0}}8(7.1t){1M(h,7,M);1M(2d,7,7.1h[7.d[1]])}8(7.1B){7.1h[7.d[1]]=2k;7.1h[7.d[3]]=l}F o={},1w=f.1j;8(f.1H==\'4g\')1w=0;Q 8(1w==\'T\')1w=7.1m.1j/7.1m.G*g;Q 8(1w<=0)1w=0;Q 8(1w<10)1w=n/1w;R=20(1w,f.1I);8(7[7.d[\'S\']]==\'1d\'||7[7.d[\'1u\']]==\'1d\'){R.1f.1n([$1D,29])}8(7.1t){F q=2x.1q(\'1V\');8(2k>=0){q+=7.1h[7.d[1]]}2x.16(7.d[\'1E\'],q);8(28.4s(2d).V){F r={};r[7.d[\'1E\']]=2d.1q(\'1V\');R.1f.1n([2d,r])}F s=28.1q(\'1V\');8(l>=0){s+=7.1h[7.d[3]]}F t={};t[7.d[\'1E\']]=s;R.1f.1n([28,t])}o[7.d[\'1s\']]=-n;8(l<0){o[7.d[\'1s\']]+=l}F u=[2n,1T,29,1w];8(f.2a)f.2a.3E($19,u);1X.2a=3z(1X.2a,$19,u);1x(f.1H){W\'2u\':W\'2e\':W\'2G\':W\'2h\':R.1p=20(R.1j,R.1I);R.1Q=20(R.1j,R.1I);R.1j=0;18}1x(f.1H){W\'2e\':W\'2G\':W\'2h\':F v=A.4f().3O($1D);18}1x(f.1H){W\'2h\':v.11().1g(7.G.12.2q).1J();18;W\'2e\':W\'2G\':v.11().1g(0,g).1J();v.11().1g(7.G.P).1J();18}1x(f.1H){W\'2u\':R.1p.1f.1n([A,{\'2g\':0}]);18;W\'2e\':v.16({\'2g\':0});R.1p.1f.1n([A,{\'S\':\'+=0\'},I(){v.1J()}]);R.1Q.1f.1n([v,{\'2g\':1}]);18;W\'2G\':R=4y(R,A,v,7,O);18;W\'2h\':R=4z(R,A,v,7,O,g);18}F w=I(){F b=7.G.P+g-N.U,5C=(7.1t)?7.1h[7.d[3]]:0;A.16(7.d[\'1s\'],5C);8(b>0){A.11().1g(N.U).1J()}F c=A.11().1g(0,g).3O(A).2I();8(b>0){1T=3p(h,7)}8(m){m.1P(I(){F a=$(1i);8(!a.1q(\'4j\'))a.3j()})}8(7.1t){8(N.U<7.G.P+g){F d=A.11().1L(7.G.P-1);d.16(7.d[\'1E\'],d.1q(\'1V\')+7.1h[7.d[3]])}c.16(7.d[\'1E\'],c.1q(\'1V\'))}R.1f=[];8(R.1p)R.1p=20(R.4B,R.1I);F e=I(){1x(f.1H){W\'2u\':W\'2e\':A.16(\'1v\',\'\');18}R.1Q=20(0,2c);C.1U=O;F a=[2n,1T,29];8(f.24)f.24.3E($19,a);1X.24=3z(1X.24,$19,a);8(1S.V){A.X(L(1S[0][0],H),1S[0][1]);1S.6p()}8(!C.1Y)A.X(L(\'1G\',H))};1x(f.1H){W\'2u\':R.1p.1f.1n([A,{\'2g\':1},e]);2f(R.1p);18;W\'2h\':R.1p.1f.1n([A,{\'S\':\'+=0\'},e]);2f(R.1p);18;2z:e();18}};R.1f.1n([A,o,w]);C.1U=M;1F=3d(1F);2f(R);4D(7.2t,A.1A(L(\'3H\',H)));A.X(L(\'2B\',H),[O,29]);J M});A.13(L(\'2W\',H),I(e,b,c,d,f,g,h){e.1e();F v=[b,c,d,f,g,h],t=[\'1l/14/1k\',\'14\',\'1r\',\'1k\',\'1l\',\'I\'],a=2Y(v,t);F f=a[3],g=a[4],h=a[5];b=3u(a[0],a[1],a[2],N,A);8(b==0)J;8(K f!=\'1k\')f=O;8(C.1U){8(K f!=\'1k\'||f.1j>0)J O}8(g!=\'17\'&&g!=\'1a\'){8(7.1N){8(b<=N.U/2)g=\'1a\';Q g=\'17\'}Q{8(N.Z==0||N.Z>b)g=\'1a\';Q g=\'17\'}}8(g==\'17\')b=N.U-b;A.X(L(g,H),[f,b,h]);J M});A.13(L(\'7h\',H),I(e,a,b){e.1e();F c=A.1A(L(\'3Q\',H));J A.1A(L(\'4K\',H),[c-1,a,\'17\',b])});A.13(L(\'7k\',H),I(e,a,b){e.1e();F c=A.1A(L(\'3Q\',H));J A.1A(L(\'4K\',H),[c+1,a,\'1a\',b])});A.13(L(\'4K\',H),I(e,a,b,c,d){e.1e();8(K a!=\'14\')a=A.1A(L(\'3Q\',H));F f=7.1b.G||7.G.P,2i=1O.35(N.U/f)-1;8(a<0)a=2i;8(a>2i)a=0;J A.1A(L(\'2W\',H),[a*f,0,M,b,c,d])});A.13(L(\'5J\',H),I(e,s){e.1e();8(s)s=3u(s,0,M,N,A);Q s=0;s+=N.Z;8(s!=0){1Z(s>N.U)s-=N.U;A.7m(A.11().1g(s,N.U))}J M});A.13(L(\'2j\',H),I(e,s){e.1e();8(s)s=4Z(s);Q 8(7.2j)s=7.2j;Q J 1c(H,\'5O 7n 3J 2j.\');F n=A.1A(L(\'3H\',H)),x=M;1o(F j=0,l=s.V;j<l;j++){8(!s[j][0].1A(L(\'2W\',H),[n,s[j][3],M])){x=O}}J x});A.13(L(\'3k\',H),I(e,a,b){e.1e();8(K a==\'I\'){a.1z($19,1S)}Q 8(2V(a)){1S=a}Q 8(K a!=\'1y\'){1S.1n([a,b])}J 1S});A.13(L(\'7w\',H),I(e,b,c,d,f){e.1e();F v=[b,c,d,f],t=[\'1l/1k\',\'1l/14/1k\',\'1r\',\'14\'],a=2Y(v,t);F b=a[0],c=a[1],d=a[2],f=a[3];8(K b==\'1k\'&&K b.3b==\'1y\')b=$(b);8(K b==\'1l\')b=$(b);8(K b!=\'1k\'||K b.3b==\'1y\'||b.V==0)J 1c(H,\'2b a 4q 1k.\');8(K c==\'1y\')c=\'4e\';8(7.1t){b.1P(I(){F m=2o($(1i).16(7.d[\'1E\']));8(2s(m))m=0;$(1i).1q(\'1V\',m)})}F g=c,3N=\'3N\';8(c==\'4e\'){8(d){8(N.Z==0){c=N.U-1;3N=\'61\'}Q{c=N.Z;N.Z+=b.V}8(c<0)c=0}Q{c=N.U-1;3N=\'61\'}}Q{c=3u(c,f,d,N,A)}8(g!=\'4e\'&&!d){8(c<N.Z)N.Z+=b.V}8(N.Z>=N.U)N.Z-=N.U;F h=A.11().1L(c);8(h.V){h[3N](b)}Q{A.65(b)}N.U=A.11().V;F i=A.1A(\'4M\');3M(7,N.U,H);2T(7,N.Z,H);A.X(L(\'4O\',H));A.X(L(\'2B\',H),[M,i]);J M});A.13(L(\'6D\',H),I(e,b,c,d){e.1e();F v=[b,c,d],t=[\'1l/14/1k\',\'1r\',\'14\'],a=2Y(v,t);F b=a[0],c=a[1],d=a[2];8(K b==\'1y\'||b==\'4e\'){A.11().2I().1J()}Q{b=3u(b,d,c,N,A);F f=A.11().1L(b);8(f.V){8(b<N.Z)N.Z-=f.V;f.1J()}}N.U=A.11().V;F g=A.1A(\'4M\');3M(7,N.U,H);2T(7,N.Z,H);A.X(L(\'2B\',H),[M,g]);J M});A.13(L(\'2a\',H)+\' \'+L(\'24\',H),I(e,a){e.1e();F b=e.4w.3U(H.3o.3B.V);8(2V(a))1X[b]=a;8(K a==\'I\')1X[b].1n(a);J 1X[b]});A.13(L(\'6a\',H,O),I(e,a){e.1e();J A.1A(L(\'3H\',H),a)});A.13(L(\'3H\',H),I(e,a){e.1e();8(N.Z==0)F b=0;Q F b=N.U-N.Z;8(K a==\'I\')a.1z($19,b);J b});A.13(L(\'3Q\',H),I(e,a){e.1e();F b=7.1b.G||7.G.P;F c=1O.2O(N.U/b-1);8(N.Z==0)F d=0;Q 8(N.Z<N.U%b)F d=0;Q 8(N.Z==b&&!7.1N)F d=c;Q F d=1O.6E((N.U-N.Z)/b);8(d<0)d=0;8(d>c)d=c;8(K a==\'I\')a.1z($19,d);J d});A.13(L(\'6G\',H),I(e,a){e.1e();$i=3p(A.11(),7);8(K a==\'I\')a.1z($19,$i);J $i});A.13(L(\'1g\',H),I(e,f,l,b){e.1e();F v=[f,l,b],t=[\'14\',\'14\',\'I\'],a=2Y(v,t);f=(K a[0]==\'14\')?a[0]:0,l=(K a[1]==\'14\')?a[1]:N.U,b=a[2];f+=N.Z;l+=N.Z;1Z(f>N.U){f-=N.U}1Z(l>N.U){l-=N.U}1Z(f<0){f+=N.U}1Z(l<0){l+=N.U}F c=A.11();8(l>f){F d=c.1g(f,l)}Q{F d=c.1g(f,N.U).3X().6e(c.1g(0,l).3X())}8(K b==\'I\')b.1z($19,d);J d});A.13(L(\'1Y\',H)+\' \'+L(\'22\',H)+\' \'+L(\'1U\',H),I(e,a){e.1e();F b=e.4w.3U(H.3o.3B.V);8(K a==\'I\')a.1z($19,C[b]);J C[b]});A.13(L(\'6c\',H,O),I(e,a,b,c){e.1e();J A.1A(L(\'4v\',H),[a,b,c])});A.13(L(\'4v\',H),I(e,a,b,c){e.1e();F d=O;8(K a==\'I\'){a.1z($19,7)}Q 8(K a==\'1k\'){2y=$.26(M,{},2y,a);8(b!==O)d=M;Q 7=$.26(M,{},7,a)}Q 8(K a!=\'1y\'){8(K b==\'I\'){F f=46(\'7.\'+a);8(K f==\'1y\')f=\'\';b.1z($19,f)}Q 8(K b!=\'1y\'){8(K c!==\'1r\')c=M;46(\'2y.\'+a+\' = b\');8(c!==O)d=M;Q 46(\'7.\'+a+\' = b\')}Q{J 46(\'7.\'+a)}}8(d){1M(A.11(),7);A.44(2y);A.4Q();F g=3L(A,7,O);A.X(L(\'2B\',H),[M,g])}J 7});A.13(L(\'4O\',H),I(e,a,b){e.1e();8(K a==\'1y\'||a.V==0)a=$(\'6M\');Q 8(K a==\'1l\')a=$(a);8(K a!=\'1k\')J 1c(H,\'2b a 4q 1k.\');8(K b!=\'1l\'||b.V==0)b=\'a.6g\';a.6O(b).1P(I(){F h=1i.6h||\'\';8(h.V>0&&A.11().6j($(h))!=-1){$(1i).21(\'4S\').4S(I(e){e.25();A.X(L(\'2W\',H),h)})}});J M});A.13(L(\'2B\',H),I(e,b,c){e.1e();8(!7.1b.1C)J;8(b){F d=7.1b.G||7.G.P,l=1O.2O(N.U/d);8(7.1b.34){7.1b.1C.11().1J();7.1b.1C.1P(I(){1o(F a=0;a<l;a++){F i=A.11().1L(3u(a*d,0,M,N,A));$(1i).65(7.1b.34(a+1,i))}})}7.1b.1C.1P(I(){$(1i).11().21(7.1b.3i).1P(I(a){$(1i).13(7.1b.3i,I(e){e.25();A.X(L(\'2W\',H),[a*d,0,M,7.1b])})})})}7.1b.1C.1P(I(){$(1i).11().2v(2l(\'5s\',H)).1L(A.1A(L(\'3Q\',H))).31(2l(\'5s\',H))});J M});A.13(L(\'4M\',H),I(e){F a=A.11(),3D=7.G.P;8(7.G.12.1d)3D=2J(a,7,0);Q 8(7.G.1v!=\'*\')3D=3R(a,7,0);8(!7.1N&&N.Z!=0&&3D>N.Z){8(7.G.12.1d){F b=47(a,7,N.Z)-N.Z}Q 8(7.G.1v!=\'*\'){F b=5u(a,7,N.Z)-N.Z}Q{b=7.G.P-N.Z}1c(H,\'77 78-1N: 79 \'+b+\' G 4X.\');A.X(\'17\',b)}7.G.P=2N(3D,7,7.G.12.2p,$19);J 3L(A,7)});A.13(L(\'68\',H,O),I(e,a){e.1e();A.X(L(\'5v\',H),a);J M});A.13(L(\'5v\',H),I(e,a){e.1e();1F=3d(1F);A.1q(\'4t\',O);A.X(L(\'4I\',H));8(a){A.X(L(\'5J\',H))}8(7.1t){1M(A.11(),7)}A.16(A.1q(\'5V\'));A.4L();A.4W();$1D.7f(A);J M})};A.4L=I(){A.21(L(\'\',H));A.21(L(\'\',H,O))};A.4Q=I(){A.4W();3M(7,N.U,H);2T(7,N.Z,H);8(7.T.2m){F c=3m(7.T.2m);$1D.13(L(\'4k\',H,O),I(){A.X(L(\'2X\',H),c)}).13(L(\'4h\',H,O),I(){A.X(L(\'2H\',H))})}8(7.T.Y){7.T.Y.13(L(7.T.3i,H,O),I(e){e.25();F a=O,c=2c;8(C.1Y){a=\'1G\'}Q 8(7.T.3W){a=\'2X\';c=3m(7.T.3W)}8(a){A.X(L(a,H),c)}})}8(7.17.Y){7.17.Y.13(L(7.17.3i,H,O),I(e){e.25();A.X(L(\'17\',H))});8(7.17.2m){F c=3m(7.17.2m);7.17.Y.13(L(\'4k\',H,O),I(){A.X(L(\'2X\',H),c)}).13(L(\'4h\',H,O),I(){A.X(L(\'2H\',H))})}}8(7.1a.Y){7.1a.Y.13(L(7.1a.3i,H,O),I(e){e.25();A.X(L(\'1a\',H))});8(7.1a.2m){F c=3m(7.1a.2m);7.1a.Y.13(L(\'4k\',H,O),I(){A.X(L(\'2X\',H),c)}).13(L(\'4h\',H,O),I(){A.X(L(\'2H\',H))})}}8($.1R.2A){8(7.17.2A){8(!C.51){C.51=M;$1D.2A(I(e,a){8(a>0){e.25();F b=52(7.17.2A);A.X(L(\'17\',H),b)}})}}8(7.1a.2A){8(!C.53){C.53=M;$1D.2A(I(e,a){8(a<0){e.25();F b=52(7.1a.2A);A.X(L(\'1a\',H),b)}})}}}8($.1R.3A){F d=(7.17.54)?I(){A.X(L(\'17\',H))}:2c,3y=(7.1a.54)?I(){A.X(L(\'1a\',H))}:2c;8(3y||3y){8(!C.3A){C.3A=M;F f={\'7x\':30,\'7A\':30,\'7C\':M};1x(7.2r){W\'4E\':W\'5H\':f.7N=3y;f.7O=d;18;2z:f.7Q=3y;f.6v=d}$1D.3A(f)}}}8(7.1b.1C){8(7.1b.2m){F c=3m(7.1b.2m);7.1b.1C.13(L(\'4k\',H,O),I(){A.X(L(\'2X\',H),c)}).13(L(\'4h\',H,O),I(){A.X(L(\'2H\',H))})}}8(7.17.2w||7.1a.2w){$(3I).13(L(\'5K\',H,O,M,M),I(e){F k=e.5L;8(k==7.1a.2w){e.25();A.X(L(\'1a\',H))}8(k==7.17.2w){e.25();A.X(L(\'17\',H))}})}8(7.1b.48){$(3I).13(L(\'5K\',H,O,M,M),I(e){F k=e.5L;8(k>=49&&k<58){k=(k-49)*7.G.P;8(k<=N.U){e.25();A.X(L(\'2W\',H),[k,0,M,7.1b])}}})}8(7.T.1G){A.X(L(\'1G\',H),7.T.56)}8(C.4A){$(3t).13(L(\'6C\',H,O,M,M),I(e){A.X(L(\'4I\',H));8(7.T.55&&!C.1Y){A.X(L(\'1G\',H))}1M(A.11(),7);A.44(2y);F a=3L(A,7,O);A.X(L(\'2B\',H),[M,a])})}};A.4W=I(){F a=L(\'\',H),3s=L(\'\',H,O);57=L(\'\',H,O,M,M);$(3I).21(57);$(3t).21(57);$1D.21(3s);8(7.T.Y)7.T.Y.21(3s);8(7.17.Y)7.17.Y.21(3s);8(7.1a.Y)7.1a.Y.21(3s);8(7.1b.1C){7.1b.1C.21(3s);8(7.1b.34){7.1b.1C.11().1J()}}3M(7,\'3f\',H);2T(7,\'2v\',H)};F C={\'2r\':\'1a\',\'1Y\':M,\'1U\':O,\'22\':O,\'53\':O,\'51\':O,\'3A\':O},N={\'U\':A.11().V,\'Z\':0},1F={\'6F\':2c,\'T\':2c,\'3k\':2c,\'2Q\':2C(),\'3v\':0},R={\'22\':O,\'1j\':0,\'2Q\':0,\'1I\':\'\',\'1f\':[]},1X={\'2a\':[],\'24\':[]},1S=[],H=$.26(M,{},$.1R.1K.5P,z),7={},2y=y,$1D=A.6H(\'<\'+H.59.4C+\' 6J="\'+H.59.5R+\'" />\').3e();H.3Y=A.3Y;H.45=$.1R.1K.45++;A.44(2y,M,B);A.5t();A.5S();A.4Q();8(2V(7.G.2K)){F D=7.G.2K}Q{F D=[];8(7.G.2K!=0){D.1n(7.G.2K)}}8(7.2t){D.6N(5U(7.2t))}8(D.V>0){1o(F a=0,l=D.V;a<l;a++){F s=D[a];8(s==0){5b}8(s===M){s=3t.6P.6h;8(s.V<1){5b}}Q 8(s===\'5W\'){s=1O.35(1O.5W()*N.U)}8(A.1A(L(\'2W\',H),[s,0,M,{1H:\'4g\'}])){18}}}F E=3L(A,7,O),5Y=3p(A.11(),7);8(7.5Z){7.5Z.1z($19,5Y,E)}A.X(L(\'2B\',H),[M,E]);A.X(L(\'4O\',H));J A};$.1R.1K.45=1;$.1R.1K.4x={\'2j\':O,\'3h\':M,\'1N\':M,\'2L\':O,\'2r\':\'1s\',\'G\':{\'2K\':0},\'1m\':{\'1I\':\'6U\',\'1j\':5N,\'2m\':O,\'2A\':O,\'54\':O,\'3i\':\'4S\',\'3k\':O}};$.1R.1K.5P={\'1c\':O,\'3o\':{\'3B\':\'\',\'60\':\'6W\'},\'59\':{\'4C\':\'6X\',\'5R\':\'6Y\'},\'5c\':{}};$.1R.1K.5M=I(a,b){J\'<a 70="#"><62>\'+a+\'</62></a>\'};I 20(d,e){J{1f:[],1j:d,4B:d,1I:e,2Q:2C()}}I 2f(s){8(K s.1p==\'1k\'){2f(s.1p)}1o(F a=0,l=s.1f.V;a<l;a++){F b=s.1f[a];8(!b)5b;8(b[3])b[0].4J();b[0].63(b[1],{64:b[2],1j:s.1j,1I:s.1I})}8(K s.1Q==\'1k\'){2f(s.1Q)}}I 3P(s,c){8(K c!=\'1r\')c=M;8(K s.1p==\'1k\'){3P(s.1p,c)}1o(F a=0,l=s.1f.V;a<l;a++){F b=s.1f[a];b[0].4J(M);8(c){b[0].16(b[1]);8(K b[2]==\'I\')b[2]()}}8(K s.1Q==\'1k\'){3P(s.1Q,c)}}I 3d(t){8(t.T)74(t.T);J t}I 3z(b,t,c){8(b.V){1o(F a=0,l=b.V;a<l;a++){b[a].3E(t,c)}}J[]}I 75(a,c,x,d,f){F o={\'1j\':d,\'1I\':a.1I};8(K f==\'I\')o.64=f;c.63({2g:x},o)}I 4y(a,b,c,o,d){F e=2E(4G(b.11(),o),o,M)[0],5d=2E(c.11(),o,M)[0],41=(d)?-5d:e,2D={},3l={};2D[o.d[\'S\']]=5d;2D[o.d[\'1s\']]=41;3l[o.d[\'1s\']]=0;a.1p.1f.1n([b,{\'2g\':1}]);a.1Q.1f.1n([c,3l,I(){$(1i).1J()}]);c.16(2D);J a}I 4z(a,b,c,o,d,n){F e=2E(4H(b.11(),o,n),o,M)[0],5f=2E(c.11(),o,M)[0],41=(d)?-5f:e,2D={},3l={};2D[o.d[\'S\']]=5f;2D[o.d[\'1s\']]=0;3l[o.d[\'1s\']]=41;a.1Q.1f.1n([c,3l,I(){$(1i).1J()}]);c.16(2D);J a}I 3M(o,t,c){8(t==\'3j\'||t==\'3f\'){F f=t}Q 8(o.G.3r>=t){1c(c,\'2b 5F G: 7b 7c (\'+t+\' G, \'+o.G.3r+\' 5E).\');F f=\'3f\'}Q{F f=\'3j\'}F s=(f==\'3j\')?\'2v\':\'31\',h=2l(\'2P\',c);8(o.T.Y)o.T.Y[f]()[s](h);8(o.17.Y)o.17.Y[f]()[s](h);8(o.1a.Y)o.1a.Y[f]()[s](h);8(o.1b.1C)o.1b.1C[f]()[s](h)}I 2T(o,f,c){8(o.1N||o.3h)J;F a=(f==\'2v\'||f==\'31\')?f:O,4o=2l(\'7e\',c);8(o.T.Y&&a){o.T.Y[a](4o)}8(o.17.Y){F b=a||(f==0)?\'31\':\'2v\';o.17.Y[b](4o)}8(o.1a.Y){F b=a||(f==o.G.P)?\'31\':\'2v\';o.1a.Y[b](4o)}}I 4p(a,b){8(K b==\'I\')b=b.1z(a);8(K b==\'1y\')b={};J b}I 3w(a,b,c){8(K c!=\'1l\')c=\'\';b=4p(a,b);8(K b==\'1l\'){F d=5h(b);8(d==-1)b=$(b);Q b=d}8(c==\'1b\'){8(K b==\'1r\')b={\'48\':b};8(K b.3b!=\'1y\')b={\'1C\':b};8(K b.1C==\'I\')b.1C=b.1C.1z(a);8(K b.1C==\'1l\')b.1C=$(b.1C);8(K b.G!=\'14\')b.G=O}Q 8(c==\'T\'){8(K b.3b!=\'1y\')b={\'Y\':b};8(K b==\'1r\')b={\'1G\':b};8(K b==\'14\')b={\'3q\':b};8(K b.Y==\'I\')b.Y=b.Y.1z(a);8(K b.Y==\'1l\')b.Y=$(b.Y)}Q{8(K b.3b!=\'1y\')b={\'Y\':b};8(K b==\'14\')b={\'2w\':b};8(K b.Y==\'I\')b.Y=b.Y.1z(a);8(K b.Y==\'1l\')b.Y=$(b.Y);8(K b.2w==\'1l\')b.2w=5h(b.2w)}J b}I 3u(a,b,c,d,e){8(K a==\'1l\'){8(2s(a))a=$(a);Q a=2o(a)}8(K a==\'1k\'){8(K a.3b==\'1y\')a=$(a);a=e.11().6j(a);8(a==-1)a=0;8(K c!=\'1r\')c=O}Q{8(K c!=\'1r\')c=M}8(2s(a))a=0;Q a=2o(a);8(2s(b))b=0;Q b=2o(b);8(c){a+=d.Z}a+=b;8(d.U>0){1Z(a>=d.U){a-=d.U}1Z(a<0){a+=d.U}}J a}I 47(i,o,s){F t=0,x=0;1o(F a=s;a>=0;a--){F j=i.1L(a);t+=(j.1W(\':P\'))?j[o.d[\'27\']](M):0;8(t>o.3S)J x;8(a==0)a=i.V;x++}}I 5u(i,o,s){J 5i(i,o.G.1v,o.G.12.4c,s)}I 6t(i,o,s,m){J 5i(i,o.G.1v,m,s)}I 5i(i,f,m,s){F t=0,x=0;1o(F a=s,l=i.V-1;a>=0;a--){x++;8(x==l)J x;F j=i.1L(a);8(j.1W(f)){t++;8(t==m)J x}8(a==0)a=i.V}}I 4V(a,o){J o.G.12.4c||a.11().1g(0,o.G.P).1v(o.G.1v).V}I 2J(i,o,s){F t=0,x=0;1o(F a=s,l=i.V-1;a<=l;a++){F j=i.1L(a);t+=(j.1W(\':P\'))?j[o.d[\'27\']](M):0;8(t>o.3S)J x;x++;8(x==l)J x;8(a==l)a=-1}}I 4F(i,o,s,l){F v=2J(i,o,s);8(!o.1N){8(s+v>l)v=l-s}J v}I 3R(i,o,s){J 5j(i,o.G.1v,o.G.12.4c,s,o.1N)}I 5w(i,o,s,m){J 5j(i,o.G.1v,m+1,s,o.1N)-1}I 5j(i,f,m,s,c){F t=0,x=0;1o(F a=s,l=i.V-1;a<=l;a++){x++;8(x==l)J x;F j=i.1L(a);8(j.1W(f)){t++;8(t==m)J x}8(a==l)a=-1}}I 3p(i,o){J i.1g(0,o.G.P)}I 6l(i,o,n){J i.1g(n,o.G.12.2q+n)}I 6b(i,o){J i.1g(0,o.G.P)}I 4G(i,o){J i.1g(0,o.G.12.2q)}I 4H(i,o,n){J i.1g(n,o.G.P+n)}I 1M(i,o,m){F x=(K m==\'1r\')?m:O;8(K m!=\'14\')m=0;i.1P(I(){F j=$(1i);F t=2o(j.16(o.d[\'1E\']));8(2s(t))t=0;j.1q(\'6f\',t);j.16(o.d[\'1E\'],((x)?j.1q(\'6f\'):m+j.1q(\'1V\')))})}I 3L(a,o,p){F b=a.3e(),$i=a.11(),$v=3p($i,o),42=4a(2E($v,o,M),o,p);b.16(42);8(o.1t){F p=o.1h,r=p[o.d[1]];8(o.1B){8(r<0)r=0}F c=$v.2I();c.16(o.d[\'1E\'],c.1q(\'1V\')+r);a.16(o.d[\'32\'],p[o.d[0]]);a.16(o.d[\'1s\'],p[o.d[3]])}a.16(o.d[\'S\'],42[o.d[\'S\']]+(36($i,o,\'S\')*2));a.16(o.d[\'1u\'],5l($i,o,\'1u\'));J 42}I 2E(i,o,a){F b=36(i,o,\'S\',a),6i=5l(i,o,\'1u\',a);J[b,6i]}I 5l(i,o,a,b){8(K b!=\'1r\')b=O;8(K o[o.d[a]]==\'14\'&&b)J o[o.d[a]];8(K o.G[o.d[a]]==\'14\')J o.G[o.d[a]];F c=(a.5m().2S(\'S\')>-1)?\'27\':\'2Z\';J 3C(i,o,c)}I 3C(i,o,b){F s=0;1o(F a=0,l=i.V;a<l;a++){F j=i.1L(a);F m=(j.1W(\':P\'))?j[o.d[b]](M):0;8(s<m)s=m}J s}I 3g(b,o,c){8(!b.1W(\':P\'))J 0;F d=b[o.d[c]](),5n=(o.d[c].5m().2S(\'S\')>-1)?[\'7p\',\'7q\']:[\'7r\',\'7s\'];1o(F a=0,l=5n.V;a<l;a++){F m=2o(b.16(5n[a]));d-=(2s(m))?0:m}J d}I 36(i,o,b,c){8(K c!=\'1r\')c=O;8(K o[o.d[b]]==\'14\'&&c)J o[o.d[b]];8(K o.G[o.d[b]]==\'14\')J o.G[o.d[b]]*i.V;F d=(b.5m().2S(\'S\')>-1)?\'27\':\'2Z\',s=0;1o(F a=0,l=i.V;a<l;a++){F j=i.1L(a);s+=(j.1W(\':P\'))?j[o.d[d]](M):0}J s}I 5p(i,o,b){F s=O,v=O;1o(F a=0,l=i.V;a<l;a++){F j=i.1L(a);F c=(j.1W(\':P\'))?j[o.d[b]](M):0;8(s===O)s=c;Q 8(s!=c)v=M;8(s==0)v=M}J v}I 66(i,o,d){J i[o.d[\'7t\'+d]](M)-3g(i,o,\'7u\'+d)}I 4n(x){J(K x==\'1l\'&&x.3U(-1)==\'%\')}I 3Z(s,o){8(4n(o)){o=o.5o(0,o.V-1);8(2s(o))J s;s*=o/3F}J s}I L(n,c,a,b,d){8(K a!=\'1r\')a=M;8(K b!=\'1r\')b=M;8(K d!=\'1r\')d=O;8(a)n=c.3o.3B+n;8(b)n=n+\'.\'+c.3o.60;8(b&&d)n+=c.45;J n}I 2l(n,c){J(K c.5c[n]==\'1l\')?c.5c[n]:n}I 4a(a,o,p){8(K p!=\'1r\')p=M;F b=(o.1t&&p)?o.1h:[0,0,0,0];F c={};c[o.d[\'S\']]=a[0]+b[1]+b[3];c[o.d[\'1u\']]=a[1]+b[0]+b[2];J c}I 2Y(c,d){F e=[];1o(F a=0,6n=c.V;a<6n;a++){1o(F b=0,6o=d.V;b<6o;b++){8(d[b].2S(K c[a])>-1&&K e[b]==\'1y\'){e[b]=c[a];18}}}J e}I 5T(p){8(K p==\'1y\')J[0,0,0,0];8(K p==\'14\')J[p,p,p,p];Q 8(K p==\'1l\')p=p.3a(\'7z\').6q(\'\').3a(\'7B\').6q(\'\').3a(\' \');8(!2V(p)){J[0,0,0,0]}1o(F i=0;i<4;i++){p[i]=2o(p[i])}1x(p.V){W 0:J[0,0,0,0];W 1:J[p[0],p[0],p[0],p[0]];W 2:J[p[0],p[1],p[0],p[1]];W 3:J[p[0],p[1],p[2],p[1]];2z:J[p[0],p[1],p[2],p[3]]}}I 4l(a,o){F x=(K o[o.d[\'S\']]==\'14\')?1O.2O(o[o.d[\'S\']]-36(a,o,\'S\')):0;1x(o.1B){W\'1s\':J[0,x];W\'2U\':J[x,0];W\'5r\':2z:J[1O.2O(x/2),1O.35(x/2)]}}I 4b(x,o,a,b){F v=x;8(K a==\'I\'){v=a.1z(b,v)}Q 8(K a==\'1l\'){F p=a.3a(\'+\'),m=a.3a(\'-\');8(m.V>p.V){F c=M,5q=m[0],2F=m[1]}Q{F c=O,5q=p[0],2F=p[1]}1x(5q){W\'7E\':v=(x%2==1)?x-1:x;18;W\'7F\':v=(x%2==0)?x-1:x;18;2z:v=x;18}2F=2o(2F);8(!2s(2F)){8(c)2F=-2F;v+=2F}}8(K v!=\'14\')v=1;8(v<1)v=1;J v}I 2N(x,o,a,b){J 5k(4b(x,o,a,b),o.G.12)}I 5k(v,i){8(K i.2M==\'14\'&&v<i.2M)v=i.2M;8(K i.2i==\'14\'&&v>i.2i)v=i.2i;8(v<1)v=1;J v}I 4Z(s){8(!2V(s))s=[[s]];8(!2V(s[0]))s=[s];1o(F j=0,l=s.V;j<l;j++){8(K s[j][0]==\'1l\')s[j][0]=$(s[j][0]);8(K s[j][1]!=\'1r\')s[j][1]=M;8(K s[j][2]!=\'1r\')s[j][2]=M;8(K s[j][3]!=\'14\')s[j][3]=0}J s}I 5h(k){8(k==\'2U\')J 39;8(k==\'1s\')J 37;8(k==\'4E\')J 38;8(k==\'5H\')J 40;J-1}I 4D(n,v){8(n)3I.2t=n+\'=\'+v+\'; 7G=/\'}I 5U(n){n+=\'=\';F b=3I.2t.3a(\';\');1o(F a=0,l=b.V;a<l;a++){F c=b[a];1Z(c.7H(0)==\' \'){c=c.5o(1,c.V)}8(c.2S(n)==0){J c.5o(n.V,c.V)}}J 0}I 3m(p){8(p&&K p==\'1l\'){F i=(p.2S(\'7I\')>-1)?M:O,r=(p.2S(\'2H\')>-1)?M:O}Q{F i=r=O}J[i,r]}I 52(a){J(K a==\'14\')?a:2c}I 2V(a){J K(a)==\'1k\'&&(a 7J 7K)}I 2C(){J 7L 7M().2C()}I 1c(d,m){8(K d==\'1k\'){F s=\' (\'+d.3Y+\')\';d=d.1c}Q{F s=\'\'}8(!d)J O;8(K m==\'1l\')m=\'1K\'+s+\': \'+m;Q m=[\'1K\'+s+\':\',m];8(3t.4r&&3t.4r.6u)3t.4r.6u(m);J O}$.1R.6g=I(o,c){J 1i.1K(o,c)};$.26($.1I,{\'7P\':I(t){F a=t*t;J t*(-a*t+4*a-6*t+4)},\'7R\':I(t){J t*(4*t*t-9*t+6)},\'7S\':I(t){F a=t*t;J t*(33*a*a-7T*a*t+7U*a-67*t+15)}})})(7V);',62,492,'|||||||opts|if|||||||||||||||||||||||||||||||||var|items|conf|function|return|typeof|cf_e|true|itms|false|visible|else|scrl|width|auto|total|length|case|trigger|button|first||children|visibleConf|bind|number||css|prev|break|tt0|next|pagination|debug|variable|stopPropagation|anims|slice|padding|this|duration|object|string|scroll|push|for|pre|data|boolean|left|usePadding|height|filter|a_dur|switch|undefined|call|triggerHandler|align|container|wrp|marginRight|tmrs|play|fx|easing|remove|carouFredSel|eq|sz_resetMargin|circular|Math|each|post|fn|queu|c_new|isScrolling|cfs_origCssMargin|is|clbk|isPaused|while|sc_setScroll|unbind|isStopped|stopImmediatePropagation|onAfter|preventDefault|extend|outerWidth|l_cur|w_siz|onBefore|Not|null|l_old|crossfade|sc_startScroll|opacity|uncover|max|synchronise|pR|cf_c|pauseOnHover|c_old|parseInt|adjust|old|direction|isNaN|cookie|fade|removeClass|key|l_new|opts_orig|default|mousewheel|updatePageStatus|getTime|css_o|ms_getSizes|adj|cover|resume|last|gn_getVisibleItemsNext|start|responsive|min|cf_getItemsAdjust|ceil|hidden|startTime|scrolling|indexOf|nv_enableNavi|right|is_array|slideTo|pause|cf_sortParams|outerHeight||addClass|top||anchorBuilder|floor|ms_getTotalSize||||split|jquery|innerWidth|sc_clearTimers|parent|hide|ms_getTrueInnerSize|infinite|event|show|queue|ani_o|bt_pauseOnHoverConfig|Carousel|events|gi_getCurrentItems|pauseDuration|minimum|ns2|window|gn_getItemIndex|timePassed|go_getNaviObject|dur2|wN|sc_callCallbacks|touchwipe|prefix|ms_getTrueLargestSize|vI|apply|100|perc|currentPosition|document|to|position|sz_setSizes|nv_showNavi|before|appendTo|sc_stopScroll|currentPage|gn_getVisibleItemsNextFilter|maxDimention|of|substr|marginBottom|pauseOnEvent|get|selector|ms_getPercentage||cur_l|sz|stopped|_cfs_init|serialNumber|eval|gn_getVisibleItemsPrev|keys||cf_mapWrapperSizes|cf_getAdjust|org|onEnd|end|clone|none|mouseleave|Number|isHidden|mouseenter|cf_getAlignPadding|orgW|ms_isPercentage|di|go_getObject|valid|console|not|cfs_isCarousel|conditions|configuration|type|defaults|fx_cover|fx_uncover|upDateOnWindowResize|orgDuration|element|cf_setCookie|up|gn_getVisibleItemsNextTestCircular|gi_getOldItemsNext|gi_getNewItemsNext|finish|stop|slideToPage|_cfs_unbind_events|updateSizes|absolute|linkAnchors|marginLeft|_cfs_bind_buttons|marginTop|click|float|textAlign|gn_getVisibleOrg|_cfs_unbind_buttons|backward|scrolled|cf_getSynchArr||mousewheelPrev|bt_mousesheelNumber|mousewheelNext|wipe|pauseOnResize|delay|ns3||wrapper|bottom|continue|classnames|new_w|nw|old_w|seco|cf_getKeyCode|gn_getItemsPrevFilter|gn_getItemsNextFilter|cf_getItemAdjustMinMax|ms_getLargestSize|toLowerCase|arr|substring|ms_hasVariableSizes|sta|center|selected|_cfs_build|gn_getVisibleItemsPrevFilter|destroy|gn_getScrollItemsNextFilter|forward|page|directscroll|Item|the|new_m|innerHeight|needed|enough|dx|down|onPauseStart|jumpToStart|keyup|keyCode|pageAnchorBuilder|500|No|configs|onPauseEnd|classname|_cfs_bind_events|cf_getPadding|cf_readCookie|cfs_origCss|random|fixed|itm|onCreate|namespace|after|span|animate|complete|append|ms_getPaddingBorderMargin||_cfs_destroy|secp|_cfs_currentPosition|gi_getNewItemsPrev|_cfs_configuration|onPausePause|concat|cfs_tempCssMargin|caroufredsel|hash|s2|index|Set|gi_getOldItemsPrev|Scrolling|l1|l2|shift|join|_cfs_slide_|paused|gn_getScrollItemsPrevFilter|log|wipeRight|The|found|Callback|returned|automatically|second|resize|removeItem|round|timer|currentVisible|wrap|or|class|_cfs_slide_prev|attr|body|unshift|find|location|id|moved|relative|overflow|swing|_cfs_slide_next|cfs|div|caroufredsel_wrapper|Infinity|href|Available|Width|be|clearTimeout|fx_fade|widths|Preventing|non|sliding|setTimeout|hiding|navigation|should|disabled|replaceWith|prependTo|prevPage|heights|Page|nextPage|2500|prepend|carousel|resumed|paddingLeft|paddingRight|paddingTop|paddingBottom|outer|inner|option|insertItem|min_move_x|currently|px|min_move_y|em|preventDefaultEvents|caroufredsel_cookie_|even|odd|path|charAt|immediate|instanceof|Array|new|Date|wipeUp|wipeDown|quadratic|wipeLeft|cubic|elastic|106|126|jQuery'.split('|'),0,{}))
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Thomas Michalak
3
  Donate link: http://www.mightymess.com/soundcloud-is-gold-wordpress-plugin
4
  Tags: soundcloud, integrated, media, shortcode, browse, design, easy, simple, music, sound, js, live preview, flash, html5
5
  Requires at least: 3.2
6
- Tested up to: 3.2.1
7
- Stable tag: 1.0.6
8
 
9
  Browse through your soundcloud tracks, sets and favourites. Select and add tracks, sets or favourites to your posts. Live preview, easy.
10
 
@@ -16,6 +16,8 @@ Browse through your soundcloud tracks, sets and favourites. Select and add track
16
  You can set default settings in the option page, choose your defaut soundcloud player (Mini, Standard, Artwork, Html5), it's width, add extra classes for you CSS lovers, show comments, autoplay and your favorite color.
17
  You'll also be able to set players to different settings before adding to your post if you fancy a one off change.
18
 
 
 
19
  **Soundcloud is Gold** use a shortcode but the "Soundcloud is Gold" tab will write it for you dynamicly as you select parameters, and on top of this it will provide a nice live preview of your player so you know what does what. When done just press the 'insert soundcloud player' and it will added to your post just like when you're adding a photo or gallery.
20
 
21
  Check out my [TM soundcloud profile](http://www.soundcloud.com/t-m), more [mighty mess](http://www.mightymess.com) and if you love it please rate it on the [Soundcloud is Gold wordpress plugin page](http://wordpress.org/extend/plugins/soundcloud-is-gold/). If you use it and want to help, [donations are always welcomed](http://www.mightymess.com/soundcloud-is-gold-wordpress-plugin) or you could like, tweet or just drop a line on [Soundcloud is Gold](http://www.mightymess.com/soundcloud-is-gold-wordpress-plugin) and show some love :)
@@ -25,6 +27,7 @@ Latest developments updates on twitter: [#soundcloudisgold](https://twitter.com/
25
  = Features =
26
 
27
  * Browse through your soundcloud tracks, sets and favorites from a tab in the media upload window (see screenshot), no need to go back and forth between soundcloud and your website.
 
28
  * Live Preview in the Tab, see what does what instantly (see screenshot).
29
  * Integrates perfectly with wordpress media upload by using the same listing style that you get with the images (see screenshot).
30
  * See track's info directly in the tab (description, url, cover, etc...).
@@ -51,11 +54,12 @@ That's just my opinion of course...
51
 
52
  = To Do List =
53
 
54
- * V1.1: Advance Settings (change background color and comments color, playcounts, buy link, font, wmode, etc, show/hide styled shortcode, number of tracks per page)
 
 
 
 
55
  * Add Widget
56
- * if no id is specified in the shortcode (e.g [soundcloud]), display the latest track.
57
- * Possibility to add multiple users for thoses with multiple soundcloud account.
58
- * Possibility to set a different user in the 'Soundcloud is Gold tab' to add tracks from different people.
59
  * Add Soundcloud default Width to the options
60
  * Trigger live preview when changing Soundcloud user name
61
  * Live search while typing a name in the user name field. So if you're looking for someone it's kind of easier.
@@ -65,6 +69,9 @@ That's just my opinion of course...
65
 
66
  == Installation ==
67
 
 
 
 
68
  Just follow the usual procedure. Log on to your wordpress, go to plugin -> add new -> search 'Soundcloud is Gold' -> click install
69
 
70
 
@@ -111,11 +118,12 @@ Yes, you can. If asked nicely and the requests are sensibles, I almost always in
111
 
112
  = Can you help me? =
113
 
114
- Sometimes, I generaly keep a eye on my plugin's forums and website's comments. Bear in mind that I've got a full time job and a life, so I can't always help straight away.
115
 
116
  == Upgrade Notice ==
117
 
118
- When upgrading from 1.0.1 and earlier: All shortcode attributes are now lowercase (autoPlay is now autoplay, playerType is now playertype). Sorry about that but it's needed, so if you have some custom ones in your posts you will have to change those manually.
 
119
 
120
 
121
 
@@ -130,6 +138,15 @@ When upgrading from 1.0.1 and earlier: All shortcode attributes are now lowercas
130
 
131
  == Changelog ==
132
 
 
 
 
 
 
 
 
 
 
133
  = 1.0.6 =
134
  * Now you can browse and add Sets and your favorites ;)
135
 
3
  Donate link: http://www.mightymess.com/soundcloud-is-gold-wordpress-plugin
4
  Tags: soundcloud, integrated, media, shortcode, browse, design, easy, simple, music, sound, js, live preview, flash, html5
5
  Requires at least: 3.2
6
+ Tested up to: 3.3.1
7
+ Stable tag: 2.0
8
 
9
  Browse through your soundcloud tracks, sets and favourites. Select and add tracks, sets or favourites to your posts. Live preview, easy.
10
 
16
  You can set default settings in the option page, choose your defaut soundcloud player (Mini, Standard, Artwork, Html5), it's width, add extra classes for you CSS lovers, show comments, autoplay and your favorite color.
17
  You'll also be able to set players to different settings before adding to your post if you fancy a one off change.
18
 
19
+ **Save multiple users, very useful for labels, collectives or artists with many projects.**
20
+
21
  **Soundcloud is Gold** use a shortcode but the "Soundcloud is Gold" tab will write it for you dynamicly as you select parameters, and on top of this it will provide a nice live preview of your player so you know what does what. When done just press the 'insert soundcloud player' and it will added to your post just like when you're adding a photo or gallery.
22
 
23
  Check out my [TM soundcloud profile](http://www.soundcloud.com/t-m), more [mighty mess](http://www.mightymess.com) and if you love it please rate it on the [Soundcloud is Gold wordpress plugin page](http://wordpress.org/extend/plugins/soundcloud-is-gold/). If you use it and want to help, [donations are always welcomed](http://www.mightymess.com/soundcloud-is-gold-wordpress-plugin) or you could like, tweet or just drop a line on [Soundcloud is Gold](http://www.mightymess.com/soundcloud-is-gold-wordpress-plugin) and show some love :)
27
  = Features =
28
 
29
  * Browse through your soundcloud tracks, sets and favorites from a tab in the media upload window (see screenshot), no need to go back and forth between soundcloud and your website.
30
+ * Save multiple users, very useful for labels, collectives or artists with many projects
31
  * Live Preview in the Tab, see what does what instantly (see screenshot).
32
  * Integrates perfectly with wordpress media upload by using the same listing style that you get with the images (see screenshot).
33
  * See track's info directly in the tab (description, url, cover, etc...).
54
 
55
  = To Do List =
56
 
57
+ * v2.1: new UI.
58
+ * V2.1: Advance Settings (change background color and comments color, playcounts, buy link, font, wmode, etc, show/hide styled shortcode, number of tracks per page)
59
+ * v2.1: url attribute for shortcode: easier for people using the shortcode manually.
60
+ * v2.1: user attribute for shortcode: display the latest track.
61
+ * v2.1: other soundcloud shortcode conflict fix (jetpack)
62
  * Add Widget
 
 
 
63
  * Add Soundcloud default Width to the options
64
  * Trigger live preview when changing Soundcloud user name
65
  * Live search while typing a name in the user name field. So if you're looking for someone it's kind of easier.
69
 
70
  == Installation ==
71
 
72
+ = Updating =
73
+ When updating to 2.0, if you're experiencing issues, deactivate and reactivate the plugin from the plugin page. This is due to switching to the Settings API. Sorry for the inconvenient.
74
+
75
  Just follow the usual procedure. Log on to your wordpress, go to plugin -> add new -> search 'Soundcloud is Gold' -> click install
76
 
77
 
118
 
119
  = Can you help me? =
120
 
121
+ Sometimes, I generally keep a eye on my plugin's forums and website's comments. Bear in mind that I've got a full time job and a life, so I can't always help straight away. I will not reply to people who obviously don't read the faqs or the forum or just say 'it doesn't work'.
122
 
123
  == Upgrade Notice ==
124
 
125
+ = 2.0 =
126
+ When updating to 2.0, if you're experiencing issues, deactivate and reactivate the plugin from the plugin page. This is due to switching to the Settings API. Sorry for the inconvenient.
127
 
128
 
129
 
138
 
139
  == Changelog ==
140
 
141
+ = 2.0 =
142
+ * Save multiple users, very useful for labels, collectives or artists with many projects.
143
+ * favourites browsing fix.
144
+ * Settings API (Should fix the multi wp install issues)
145
+
146
+ = 1.0.7 =
147
+ * Moved to Settings API, which should enable multi-site compatibility (good tutorial at http://www.presscoders.com/2010/05/wordpress-settings-api-explained/ and plugin for reference at http://wordpress.org/extend/plugins/plugin-options-starter-kit/)
148
+ * Fixed bug where pagination would always go back to tracks when browsing sets or favourites. Thanks to givafizz for spotting it.
149
+
150
  = 1.0.6 =
151
  * Now you can browse and add Sets and your favorites ;)
152
 
screenshot-1.jpg CHANGED
Binary file
screenshot-2.jpg CHANGED
Binary file
screenshot-5.jpg CHANGED
Binary file
soundcloud-is-gold-advanced.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $soundcloudIsGoldAdvancedPlayerDefault = array(
3
+ 'checkboxes' => array(
4
+ 'buying' => array('label' => 'Show/Hide Buying', 'slug' => 'Buying', 'value' => TRUE, 'type' => 'checkboxes'),
5
+ 'sharing' => array('label' => 'Show/Hide Sharing', 'slug' => 'Sharing', 'value' => TRUE, 'type' => 'checkboxes'),
6
+ 'show_bpm' => array('label' => 'Show/Hide Bpm', 'slug' => 'bpm', 'value' => TRUE, 'type' => 'checkboxes'),
7
+ 'show_playcount' => array('label' => 'Show/Hide Playcount', 'slug' => 'Playcount', 'value' => TRUE, 'type' => 'checkboxes'),
8
+ 'enable_api' => array('label' => 'Enable API', 'slug' => 'Api', 'value' => FALSE, 'type' => 'checkboxes'),
9
+ 'single_active' => array('label' => 'Single Active', 'slug' => 'SingleActive', 'value' => FALSE, 'type' => 'checkboxes'),
10
+ 'show_user' => array('label' => 'Show/Hide User', 'slug' => 'User', 'value' => TRUE, 'type' => 'checkboxes')
11
+ ),
12
+ 'texts' => array(
13
+ 'theme_color' => array('label' => 'Theme Color', 'slug' => 'ThemeColor', 'value' => '', 'type' => 'colorPicker'),
14
+ 'text_buy_track' => array('label' => 'Text buy track', 'slug' => 'TextBuyTrack', 'value' => '', 'type' => 'texts'),
15
+ 'text_buy_set' => array('label' => 'Text buy set', 'slug' => 'TextBuySet', 'value' => '', 'type' => 'texts'),
16
+ 'text_download_track' => array('label' => 'Text download track', 'slug' => 'TextDownloadTrack', 'value' => '', 'type' => 'texts'),
17
+ 'start_track' => array('label' => 'Start Track', 'slug' => 'StartTrack', 'value' => '', 'type' => 'texts'),
18
+ 'height' => array('label' => 'Height', 'slug' => 'Height', 'value' => '', 'type' => 'texts'),
19
+ 'font' => array('label' => 'Font', 'slug' => 'Font', 'value' => '', 'type' => 'texts')
20
+ )
21
+ );
22
+ add_option('soundcloud_is_gold_advanced_player', $soundcloudIsGoldAdvancedPlayerDefault);
23
+
24
+ /* Default Settings */
25
+ $soundcloudIsGoldAdvancedPlayer = get_option('soundcloud_is_gold_advanced_player');
26
+ printl($soundcloudIsGoldAdvancedPlayer);
27
+ ?>
28
+ <div id="soundcloudMMAdvancedSettingsOptions" class="subSettings">
29
+ <a href="#" title="bring it on!" id="soundcloudMMAdvancedSettingsShowHide" class="soundcloudMMAdvancedSettingsShowHide">I'm a grown up, show me those Advanced Options!</a>
30
+ <div class="soundcloudMMAdvancedSettingsPanels">
31
+ <?php foreach($soundcloudIsGoldAdvancedPlayer as $topKey => $advancePlayerOptions) : ?>
32
+ <ul class="subSettings <?php echo $topKey ?>">
33
+ <?php foreach($advancePlayerOptions as $key => $advancePlayerOption) : ?>
34
+
35
+ <!-- ColorPicker Field -->
36
+ <?php if(isset($advancePlayerOption['type']) && $advancePlayerOption['type'] == 'colorPicker') :?>
37
+ <li>
38
+ <label for="soundcloudMM<?php echo $advancePlayerOption['slug'] ?>"><?php echo $advancePlayerOption['label'] ?></label>
39
+ <div class="soundcloudMMColorPickerContainer" id="soundcloudMMColorPickerContainer">
40
+ <input type="text" class="soundcloudMMInput soundcloudMMColor soundcloudMM<?php echo $advancePlayerOption['slug'] ?>" id="soundcloudMM<?php echo $advancePlayerOption['slug'] ?>" name="soundcloud_is_gold_advanced_player[<?php echo $topKey ?>][<?php echo $key ?>][value]" value="<?php echo $advancePlayerOption['value'] ?>" style="background-color:<?php echo $advancePlayerOption['value'] ?>"/><a href="#" class="soundcloudMMBt soundcloudMMBtSmall inline blue soundcloudMMRounder soundcloudMMResetColor">reset to default</a>
41
+ <div id="soundcloudMMColorPicker" class="shadow soundcloudMMColorPicker"><div id="soundcloudMMColorPickerSelect" class="soundcloudMMColorPickerSelect"></div><a id="soundcloudMMColorPickerClose" class="blue soundcloudMMBt soundcloudMMColorPickerClose">done</a></div>
42
+ </div>
43
+ </li>
44
+ <?php endif; ?>
45
+
46
+ <!-- Text Fields -->
47
+ <?php if(isset($advancePlayerOption['type']) && $advancePlayerOption['type'] == 'texts' && $key != 'start_track') :?>
48
+ <li><label for="soundcloudMM<?php echo $advancePlayerOption['slug'] ?>"><?php echo $advancePlayerOption['label'] ?></label><input type="text" value="<?php echo $advancePlayerOption['value'] ?>" name="soundcloud_is_gold_advanced_player[<?php echo $topKey ?>][<?php echo $key ?>][value]" class="soundcloudMMInput soundcloudMM<?php echo $advancePlayerOption['slug'] ?>" id="soundcloudMM<?php echo $advancePlayerOption['slug'] ?>" /></li>
49
+ <?php endif; ?>
50
+
51
+ <!-- Checkboxes Fields -->
52
+ <?php if(isset($advancePlayerOption['type']) && $advancePlayerOption['type'] == 'checkboxes') :?>
53
+ <li><input type="checkbox" <?php echo (isset($advancePlayerOption['value']) && $advancePlayerOption['value']) ? 'checked="checked"' : ''?> name="soundcloud_is_gold_advanced_player[<?php echo $topKey ?>][<?php echo $key ?>][value]" value="true" class="soundcloudMM<?php echo $advancePlayerOption['slug'] ?>" id="soundcloudMM<?php echo $advancePlayerOption['slug'] ?>"/><label for="soundcloudMM<?php echo $advancePlayerOption['slug'] ?>"><?php echo $advancePlayerOption['label'] ?></label></li>
54
+ <?php endif; ?>
55
+
56
+ <?php endforeach; ?>
57
+ </ul>
58
+ <?php endforeach; ?>
59
+ </div>
60
+ </div>
soundcloud-is-gold-css.css CHANGED
@@ -57,6 +57,7 @@
57
  margin-left:5px;
58
  }
59
 
 
60
  /*** USEFULL ***/
61
  .soundcloudMMWrapper .left{
62
  float:left;
@@ -73,8 +74,13 @@
73
  .soundcloudMMWrapper .clear{
74
  clear:both;
75
  }
76
-
77
-
 
 
 
 
 
78
  /*** COLORS ***/
79
  .shadow{
80
  box-shadow:0 0 10px #666666;
@@ -91,6 +97,11 @@
91
  -moz-box-shadow:0 0 15px #333333;
92
  -webkit-box-shadow: 0 0 15px #333333;
93
  }
 
 
 
 
 
94
  .soundcloudMMWrapper .darkGrey{
95
  background:#555555;
96
  }
@@ -194,7 +205,7 @@
194
  color:#641606;
195
  text-decoration:underline;
196
  }
197
- .soundcloudMMWrapper .soundcloudMMBt.orangeGradient:hover, .soundcloudMMWrapper .orangeGradient:hover{
198
  background:#FF3E0F;
199
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#AA0C03', endColorstr='#FF3E0F'); /* for IE */
200
  background: -webkit-gradient(linear, left top, left bottom, from(#AA0C03), to(#FF3E0F)); /* for webkit browsers */
@@ -228,6 +239,7 @@
228
  width: 100%;
229
  background:#333333;
230
  position:relative;
 
231
  }
232
  #soundcloudMMTop #soundcloudMMLogo {
233
  display: block;
@@ -287,14 +299,175 @@
287
  float:left;
288
  width:100%;
289
  padding:5px 0 30px 0;
 
 
290
  }
291
 
292
 
293
- /*** User Name ***/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294
  #soundcloudIsGoldUser{
295
- font-weight:bold;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
296
  }
297
- /*** Settings ***/
 
 
 
 
 
298
  #soundcloudMMSettings{
299
  float: left;
300
  list-style: none outside none;
@@ -304,13 +477,25 @@
304
  text-shadow:none;
305
  font-size:120%;
306
  }
307
- #soundcloudMMSettings li{
308
- margin-bottom:2%;
309
- padding:2%;
 
 
 
310
  }
311
- #soundcloudMMSettings li label{
312
- width:20%;
 
 
 
 
 
 
 
 
313
  }
 
314
  .soundcloudMMInput{
315
  margin: 0 0 0 2%;
316
  padding: 10px;
@@ -325,6 +510,7 @@ select.soundcloudMMInput option{
325
  .subSettings{
326
  display: inline;
327
  margin: 0 0 0 0;
 
328
  }
329
  .subSettings li{
330
  display: inline;
@@ -382,7 +568,7 @@ select.soundcloudMMInput option{
382
  width:96%;
383
  margin:1%;
384
  }
385
- /*** EXTRAS ***/
386
  #soundcloudMMExtras{
387
  float: left;
388
  font-size: 120%;
@@ -391,6 +577,7 @@ select.soundcloudMMInput option{
391
  padding: 2%;
392
  text-shadow: none !important;
393
  width: 96%;
 
394
  }
395
  #soundcloudMMExtras li{
396
  display: block;
@@ -402,7 +589,43 @@ select.soundcloudMMInput option{
402
  .subSettings.texts li .soundcloudMMInput.soundcloudMMClasses{
403
  width:20%;
404
  }
405
- /** Preview **/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
406
  .soundcloudMMEmbed{
407
  padding: 1% 0% 1.5% 0%;
408
  }
@@ -427,7 +650,7 @@ select.soundcloudMMInput option{
427
  /** Disclaimer **/
428
  #disclaimer{
429
  color:#666666;
430
- font-size:60%;
431
  margin:10px 0;
432
  float:right;
433
  }
@@ -442,6 +665,39 @@ select.soundcloudMMInput option{
442
  margin-right:5px;
443
  }
444
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
445
  .soundcloudMMColorPicker .soundcloudMMColorPickerClose{
446
  display: block;
447
  padding: 6% 2%;
57
  margin-left:5px;
58
  }
59
 
60
+
61
  /*** USEFULL ***/
62
  .soundcloudMMWrapper .left{
63
  float:left;
74
  .soundcloudMMWrapper .clear{
75
  clear:both;
76
  }
77
+ .soundcloudMMfullWidth {
78
+ width:100%;
79
+ }
80
+ .soundcloudMMWrapper .clearfix {
81
+ float: none;
82
+ clear: both;
83
+ }
84
  /*** COLORS ***/
85
  .shadow{
86
  box-shadow:0 0 10px #666666;
97
  -moz-box-shadow:0 0 15px #333333;
98
  -webkit-box-shadow: 0 0 15px #333333;
99
  }
100
+ .lightShadow{
101
+ box-shadow:0 0 5px #9B9B9B;
102
+ -moz-box-shadow:0 0 5px #9B9B9B;
103
+ -webkit-box-shadow: 0 0 5px #9B9B9B;
104
+ }
105
  .soundcloudMMWrapper .darkGrey{
106
  background:#555555;
107
  }
205
  color:#641606;
206
  text-decoration:underline;
207
  }
208
+ .soundcloudMMWrapper .soundcloudMMBt.orangeGradient:hover{
209
  background:#FF3E0F;
210
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#AA0C03', endColorstr='#FF3E0F'); /* for IE */
211
  background: -webkit-gradient(linear, left top, left bottom, from(#AA0C03), to(#FF3E0F)); /* for webkit browsers */
239
  width: 100%;
240
  background:#333333;
241
  position:relative;
242
+ border-bottom:#666 solid 1px;
243
  }
244
  #soundcloudMMTop #soundcloudMMLogo {
245
  display: block;
299
  float:left;
300
  width:100%;
301
  padding:5px 0 30px 0;
302
+ border-bottom:#CCC solid 1px;
303
+ border-top:#FFF 1px solid;
304
  }
305
 
306
 
307
+ /***************************************/
308
+ /** **/
309
+ /** User Name **/
310
+ /** **/
311
+ /***************************************/
312
+ /** Main **/
313
+ #soundcloudIsGoldUsernameCarouselWrapper, #soundcloudIsGoldAddUserContainer{
314
+ bottom: 0;
315
+ right: 0;
316
+ float: left;
317
+ overflow: hidden;
318
+ position: relative;
319
+ width: 354px;
320
+ margin:0;
321
+ padding:0;
322
+ }
323
+ /** Active User **/
324
+ #soundcloudIsGoldActiveUserContainer{
325
+ border-right: solid 1px #CCC;
326
+ padding: 0 1% 0 0;
327
+ margin: 0 1% 0 0;
328
+ float:left;
329
+ }
330
+ #soundcloudIsGoldActiveLabel{
331
+ background: url("./images/active.png") no-repeat left top;
332
+ width:49px;
333
+ height:50px;
334
+ position:absolute;
335
+ left:0;
336
+ top:0;
337
+ }
338
+ /** Add User **/
339
+ #soundcloudIsGoldAddUserContainer{
340
+ width:120px;
341
+ height: 120px;
342
+ border-right: solid 1px #CCC;
343
+ padding: 0 1% 0 0;
344
+ margin: 0 0 0 0;
345
+ }
346
+ #soundcloudIsGoldNewUser{
347
+ font-size: 70%;
348
+ font-weight: normal;
349
+ margin: 38px 0 4px 0;
350
+ width: 99%;
351
+ }
352
+ #soundcloudIsGoldAddUser{
353
+ font-size: 70%;
354
+ margin: 0;
355
+ padding: 0.5% 0;
356
+ width: 99%;
357
+ }
358
  #soundcloudIsGoldUser{
359
+ font-weight:bold;
360
+ width:100%;
361
+ }
362
+ #soundcloudIsGoldUserError{
363
+ height: 102px;
364
+ left: 0;
365
+ margin: 0;
366
+ padding: 4px;
367
+ position: absolute;
368
+ top: 5px;
369
+ width: 112px;
370
+ font-size:70%;
371
+ text-align:center;
372
+ display:none;
373
+ }
374
+ #soundcloudIsGoldUserError p{
375
+ position:absolute;
376
+ top:20%;
377
+ left:0;
378
+ width:100%;
379
+ color:#FFF;
380
+ }
381
+ #soundcloudIsGoldUserError a{
382
+ position:absolute;
383
+ bottom:5%;
384
+ width:90%;
385
+ }
386
+ /** Carousel **/
387
+ #soundcloudIsGoldUsernameCarouselWrapper{
388
+ height: 138px;
389
+ padding-left:15px;
390
+ background:URL("./images/addpointer.png") no-repeat -10px 50px;
391
+ }
392
+ #soundcloudIsGoldUsernameCarousel{
393
+
394
+ }
395
+ .caroufredsel_wrapper{
396
+ margin:0 !important;
397
+ }
398
+ #soundcloudIsGoldUsernameCarousel .soundcloudIsGoldUserContainer{
399
+ cursor: pointer;
400
+ }
401
+ #soundcloudIsGoldUsernameCarouselNav {
402
+ text-align:center;
403
+ padding-top:5px;
404
+ background:#FFF;
405
+ }
406
+ #soundcloudIsGoldUsernameCarouselNav a {
407
+ background: url(./images/pag.png) 0 0 no-repeat transparent;
408
+ width: 15px;
409
+ height: 15px;
410
+ margin: 0 5px 0 0;
411
+ display: inline-block;
412
+ }
413
+ #soundcloudIsGoldUsernameCarouselNav a.selected {
414
+ background-position: -15px 0;
415
+ cursor: default;
416
+ }
417
+ #soundcloudIsGoldUsernameCarouselNav a span {
418
+ display: none;
419
+ }
420
+ /** User **/
421
+ .soundcloudIsGoldUserContainer{
422
+ width:100px;
423
+ height:100px;
424
+ padding:4px;
425
+ margin:5px 4px;
426
+ float:left;
427
+ border:solid 1px #DDD;
428
+ background-color:#F6F6F6;
429
+ background-repeat:no-repeat;
430
+ background-position: center center;
431
+ position:relative;
432
+ display:block;
433
+ }
434
+ .soundcloudIsGoldUserContainer div{
435
+ width:100px;
436
+ height:100px;
437
+ }
438
+ .soundcloudIsGoldUserContainer div p{
439
+ background:#F6F6F6;
440
+ bottom: 0;
441
+ font-size: 60%;
442
+ left: 0;
443
+ padding: 0 6px;
444
+ position: absolute;
445
+ width: 96px;
446
+ }
447
+ .soundcloudIsGoldUserContainer div:hover{
448
+ }
449
+ .soundcloudIsGoldUserContainer div:hover p{
450
+ color:#F6F6F6;
451
+ background:#333;
452
+ }
453
+ .soundcloudIsGoldRemoveUser {
454
+ background: url(./images/remove.png) 0 0 no-repeat transparent;
455
+ width: 20px;
456
+ height: 20px;
457
+ position:absolute;
458
+ top:-7px;
459
+ right:-7px;
460
+ }
461
+ .soundcloudIsGoldRemoveUser:hover {
462
+ background-position: -20px 0;
463
+ cursor: pointer;
464
  }
465
+
466
+ /************************************/
467
+ /** **/
468
+ /** SETTINGS **/
469
+ /** **/
470
+ /************************************/
471
  #soundcloudMMSettings{
472
  float: left;
473
  list-style: none outside none;
477
  text-shadow:none;
478
  font-size:120%;
479
  }
480
+ #soundcloudMMSettings li.soundcloudMMBox{
481
+ display: block;
482
+ float: left;
483
+ margin-bottom: 2%;
484
+ padding: 2%;
485
+ width: 96%;
486
  }
487
+ #soundcloudMMSettings li.soundcloudMMBox label.optionLabel{
488
+ width:15%;
489
+ float:left;
490
+ display:block;
491
+ }
492
+ #soundcloudMMSettings li.soundcloudMMBox .subSettings, #soundcloudMMAdvancedSettingsOptions{
493
+ display:block;
494
+ width:84%;
495
+ float:right;
496
+ border-left:1px #EFEFEF solid;
497
  }
498
+ /** Subsettings **/
499
  .soundcloudMMInput{
500
  margin: 0 0 0 2%;
501
  padding: 10px;
510
  .subSettings{
511
  display: inline;
512
  margin: 0 0 0 0;
513
+ font-size:80%;
514
  }
515
  .subSettings li{
516
  display: inline;
568
  width:96%;
569
  margin:1%;
570
  }
571
+ /******* EXTRAS *******/
572
  #soundcloudMMExtras{
573
  float: left;
574
  font-size: 120%;
577
  padding: 2%;
578
  text-shadow: none !important;
579
  width: 96%;
580
+ border-top:solid 1px #FFF;
581
  }
582
  #soundcloudMMExtras li{
583
  display: block;
589
  .subSettings.texts li .soundcloudMMInput.soundcloudMMClasses{
590
  width:20%;
591
  }
592
+
593
+ /******* ADVANCED SETTINGS *******/
594
+ #soundcloudMMAdvancedSettingsOptions{
595
+
596
+ }
597
+ #soundcloudMMAdvancedSettingsOptions #soundcloudMMAdvancedSettingsShowHide{
598
+ padding:0 0 2% 5%;
599
+ width:79%;
600
+ display:block;
601
+ }
602
+ #soundcloudMMMain #soundcloudMMSettings .soundcloudMMBox #soundcloudMMAdvancedSettingsOptions .subSettings{
603
+ width:49%;
604
+ min-height:320px;
605
+ height: auto !important;
606
+ height: 320px;
607
+ }
608
+ #soundcloudMMMain #soundcloudMMSettings .soundcloudMMBox #soundcloudMMAdvancedSettingsOptions .subSettings.texts{
609
+ border:none;
610
+ }
611
+ #soundcloudMMMain #soundcloudMMSettings .soundcloudMMBox #soundcloudMMAdvancedSettingsOptions .subSettings li{
612
+ width:92%;
613
+ padding:2% 4% !important;
614
+ margin:0 !important;
615
+ float:left;
616
+ }
617
+ #soundcloudMMMain #soundcloudMMSettings .soundcloudMMBox #soundcloudMMAdvancedSettingsOptions .subSettings.texts li .soundcloudMMInput{
618
+ width:50%;
619
+ }
620
+ #soundcloudMMMain #soundcloudMMSettings .soundcloudMMBox #soundcloudMMAdvancedSettingsOptions .subSettings.texts li #soundcloudMMThemeColor{
621
+ width:30% !important;
622
+ }
623
+
624
+ /******* PREVIEW *******/
625
+ .previewLabel{
626
+ width: 100% !important;
627
+ float: none !important;
628
+ }
629
  .soundcloudMMEmbed{
630
  padding: 1% 0% 1.5% 0%;
631
  }
650
  /** Disclaimer **/
651
  #disclaimer{
652
  color:#666666;
653
+ font-size:70%;
654
  margin:10px 0;
655
  float:right;
656
  }
665
  margin-right:5px;
666
  }
667
 
668
+ /** Username **/
669
+ #soundcloudMMUsernameHeader{
670
+ margin:1em;
671
+ display:block;
672
+ }
673
+ #soundcloudMMUsernameHeader img{
674
+ vertical-align:middle;
675
+ border:solid 1px #ccc;
676
+ padding:4px;
677
+ background-color:#efefef;
678
+ }
679
+ #soundcloudMMUsernameHeader span{
680
+ color:#666;
681
+ padding:0 5px;
682
+ border-right: solid 1px #DDD;
683
+ }
684
+ #soundcloudMMShowUsernames, #soundcloudMMHideUsernames{
685
+ padding:0 5px;
686
+ }
687
+ #soundcloudMMUsermameTab{
688
+ border-bottom: 1px solid #DDDDDD;
689
+ float: left;
690
+ margin: 2%;
691
+ padding: 0 0 1%;
692
+ width: 96%;
693
+ display:block;
694
+ }
695
+ #soundcloudIsGoldAddUserContainer .soundcloudMMLoading{
696
+ height: 100%;
697
+ position: absolute;
698
+ width: 95%;
699
+ }
700
+ /** Color Picher **/
701
  .soundcloudMMColorPicker .soundcloudMMColorPickerClose{
702
  display: block;
703
  padding: 6% 2%;
soundcloud-is-gold-functions.php CHANGED
@@ -30,24 +30,84 @@ function get_soundcloud_is_gold_default_width($settings){
30
  return $settings[$settings['type']];
31
  }
32
  function get_soundcloud_is_gold_default_settings_for_js(){
33
- echo 'soundcloudIsGoldUser_default = "'.get_option('soundcloud_is_gold_user').'"; ';
34
- echo 'soundcloudIsGoldPlayerType_default = "'.get_option('soundcloud_is_gold_playerType').'"; ';
35
- $soundcloudIsGoldSettings = get_option('soundcloud_is_gold_settings');
 
 
 
 
 
 
 
36
  echo 'soundcloudIsGoldAutoPlay_default = '.((!isset($soundcloudIsGoldSettings[0]) || $soundcloudIsGoldSettings[0] == '') ? 'false' : 'true') .'; ';
37
  echo 'soundcloudIsGoldComments_default = '.((!isset($soundcloudIsGoldSettings[1]) || $soundcloudIsGoldSettings[1] == '') ? 'false' : 'true') .'; ';
38
  echo 'soundcloudIsGoldArtwork_default = '.((!isset($soundcloudIsGoldSettings[2]) || $soundcloudIsGoldSettings[2] == '') ? 'false' : 'true') .'; ';
39
- echo 'soundcloudIsGoldWidth_default = "'.get_soundcloud_is_gold_default_width(get_option('soundcloud_is_gold_width_settings')).'"; ';
40
- echo 'soundcloudIsGoldClasses_default = "'.get_option('soundcloud_is_gold_classes').'"; ';
41
- echo 'soundcloudIsGoldColor_default = "'.get_option('soundcloud_is_gold_color').'"; ';
 
42
  }
43
  function get_soundcloudIsGoldUserNumber(){
44
- $soundcloudIsGoldApiCall = 'http://api.soundcloud.com/users/'.get_option('soundcloud_is_gold_user').'.xml?client_id=9rD2GrGrajkmkw5eYFDp2g';
 
 
 
45
  $soundcloudIsGoldApiResponse = get_soundcloud_is_gold_api_response($soundcloudIsGoldApiCall);
46
  $result['tracks'] = ($soundcloudIsGoldApiResponse['response']->{'track-count'} == 0) ? '0' : $soundcloudIsGoldApiResponse['response']->{'track-count'};
47
  $result['sets'] = ($soundcloudIsGoldApiResponse['response']->{'playlist-count'} == 0) ? '0' : $soundcloudIsGoldApiResponse['response']->{'playlist-count'};
48
  $result['favorites'] = ($soundcloudIsGoldApiResponse['response']->{'public-favorites-count'} == 0) ? '0' : $soundcloudIsGoldApiResponse['response']->{'public-favorites-count'};
49
  return $result;
50
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  function get_soundcloud_is_gold_api_response($soundcloudIsGoldApiCall){
52
  //Set Error default message && default XML state
53
  $soundcloudIsGoldRespError = false;
@@ -79,7 +139,7 @@ function get_soundcloud_is_gold_api_response($soundcloudIsGoldApiCall){
79
  /*Pagination
80
  soundcloud_is_gold_pagination($totalItems, $currentPage, $perPage)
81
  */
82
- function soundcloud_is_gold_pagination($totalItems, $currentPage, $perPage, $post_ID){
83
 
84
  // The items on the current page.
85
  $offset = ($currentPage - 1) * $perPage;
@@ -96,11 +156,13 @@ function soundcloud_is_gold_pagination($totalItems, $currentPage, $perPage, $pos
96
  $disableLast = ($currentPage == $lastPage) ? ' disabled' : '';
97
 
98
  $output = '<div class="tablenav-pages"><span class="displaying-num">'.$totalItems.' tracks</span>';
99
- $output .= '<span class="pagination-links"><a href="?post_id='.$post_ID.'&tab=soundcloud_is_gold&paged='.$firstPage.'&TB_iframe=1&width=640&height=584" title="Go to the first page" class="first-page'.$disableFirst.'">&laquo;</a>';
100
- $output .= '<a href="?post_id='.$post_ID.'&tab=soundcloud_is_gold&paged='.$prevPage.'&TB_iframe=1&width=640&height=584" title="Go to the previous page" class="prev-page'.$disableFirst.'">&lsaquo;</a>';
 
101
  $output .= '<span class="paging-input">page '.$currentPage.' of <span class="total-pages">'.$lastPage.'</span></span>';
102
- $output .= '<a href="?post_id='.$post_ID.'&tab=soundcloud_is_gold&paged='.$nextPage.'&TB_iframe=1&width=640&height=584" title="Go to the next page" class="next-page'.$disableLast.'">&rsaquo;</a>';
103
- $output .= '<a href="?post_id='.$post_ID.'&tab=soundcloud_is_gold&paged='.$lastPage.'&TB_iframe=1&width=640&height=584" title="Go to the last page" class="last-page'.$disableLast.'">&raquo;</a></span></div>';
 
104
 
105
  return $output;
106
  }
@@ -173,7 +235,7 @@ add_action('media_upload_soundcloud_is_gold', 'soundcloud_is_gold_media_menu_han
173
  /*Add Soundcloud Button to Upload/Insert*/
174
  function plugin_media_button($context) {
175
  global $post_ID;
176
- $plugin_media_button = ' %s' . '<a id="add_soundcloud_is_gold" title="Insert Soundcloud Player" href="media-upload.php?post_id='.$post_ID.'&tab=soundcloud_is_gold&selectFormat=tracks&paged=1&TB_iframe=1&width=640&height=584" class="thickbox"><img alt="Insert Soundcloud Player" src="'.SIG_PLUGIN_DIR.'soundcloud-is-gold-icon.png"></a>';
177
  return sprintf($context, $plugin_media_button);
178
  }
179
  add_filter('media_buttons_context', 'plugin_media_button');
@@ -181,15 +243,18 @@ add_filter('media_buttons_context', 'plugin_media_button');
181
  /** Populate the new Soundcloud is Gold Tab **/
182
  function get_soundcloud_is_gold_user_tracks(){
183
  //Default Settings
184
- $soundcloudIsGoldUser = get_option('soundcloud_is_gold_user');
185
- $soundcloudIsGoldSettings = get_option('soundcloud_is_gold_settings');
186
- $soundcloudIsGoldPlayerType = get_option('soundcloud_is_gold_playerType');
 
 
 
187
  $soundcloudIsGoldPlayerTypeDefault = empty($soundcloudIsGoldPlayerType) ? TRUE : FALSE;
188
- $soundcloudIsGoldWidthSettings = get_option('soundcloud_is_gold_width_settings');
189
  $soundcloudIsGoldWidth = get_soundcloud_is_gold_default_width($soundcloudIsGoldWidthSettings);
190
- $soundcloudIsGoldClasses = get_option('soundcloud_is_gold_classes');
191
- $soundcloudIsGoldColor = get_option('soundcloud_is_gold_color');
192
-
193
  //Default Pagination Settings
194
  $soundcloudIsGoldTracksPerPage = 25;
195
  $soundcloudIsGoldPage = isset($_REQUEST['paged']) ? $_REQUEST['paged'] : '1';
@@ -198,16 +263,23 @@ function get_soundcloud_is_gold_user_tracks(){
198
 
199
  //API Call
200
  $soundcloudIsGoldSelectedFormat = isset($_REQUEST['selectFormat']) ? $_REQUEST['selectFormat'] : 'tracks';
201
- if($soundcloudIsGoldSelectedFormat == 'tracks') $soundcloudIsGoldApiCall = 'http://api.soundcloud.com/users/'.get_option('soundcloud_is_gold_user').'/tracks.xml?limit='.$soundcloudIsGoldTracksPerPage.'&offset='.$soundcloudIsGoldApiOffset.'&client_id=9rD2GrGrajkmkw5eYFDp2g';
202
- if($soundcloudIsGoldSelectedFormat == 'sets') $soundcloudIsGoldApiCall = 'http://api.soundcloud.com/users/'.get_option('soundcloud_is_gold_user').'/playlists.xml?limit='.$soundcloudIsGoldTracksPerPage.'&offset='.$soundcloudIsGoldApiOffset.'&client_id=9rD2GrGrajkmkw5eYFDp2g';
203
- if($soundcloudIsGoldSelectedFormat == 'favorites') $soundcloudIsGoldApiCall = 'http://api.soundcloud.com/users/'.get_option('soundcloud_is_gold_user').'/favorites.xml?limit='.$soundcloudIsGoldTracksPerPage.'&offset='.$soundcloudIsGoldApiOffset.'&client_id=9rD2GrGrajkmkw5eYFDp2g';
204
  $soundcloudIsGoldApiResponse = get_soundcloud_is_gold_api_response($soundcloudIsGoldApiCall);
205
 
206
  //Pagination and Actions
207
  $soundcloudIsGoldNumbers = get_soundcloudIsGoldUserNumber($soundcloudIsGoldSelectedFormat);
208
- $soundcloudIsGoldPagination = soundcloud_is_gold_pagination($soundcloudIsGoldNumbers[$soundcloudIsGoldSelectedFormat], $soundcloudIsGoldPage, $soundcloudIsGoldTracksPerPage, $post_id);
209
  $soundcloudIsGoldSelectTracksFavsSets = soundcloud_is_gold_select_tracks_favs_sets($soundcloudIsGoldSelectedFormat, $soundcloudIsGoldNumbers, $post_id);
210
 
 
 
 
 
 
 
 
211
  echo '<div id="soundcloudMMTabActions" class="tablenav">';
212
  //Select Tracks / Sets / Favs
213
  echo (isset($soundcloudIsGoldSelectTracksFavsSets)) ? $soundcloudIsGoldSelectTracksFavsSets : '';
@@ -245,11 +317,11 @@ function get_soundcloud_is_gold_user_tracks(){
245
  <a href="#" class="toggle describe-toggle-on soundcloud" id="show-<?php echo $soundcloudIsGoldtrack->id ?>">Show</a>
246
  <a href="#" class="toggle describe-toggle-off soundcloudMM">Hide</a>
247
  <div class="filename new"><span class="title soundcloudMMTitle" id="soundcloudMMTitle-<?php echo $soundcloudIsGoldtrack->id ?>"><?php echo $soundcloudIsGoldtrack->title ?></span></div>
248
- <table class="slidetoggle describe startclosed soundcloudMMWrapper <?php echo $soundcloudIsGoldSelectedFormat ?>">
249
  <thead id="media-head-<?php echo $soundcloudIsGoldtrack->id ?>" class="media-item-info">
250
  <tr valign="top">
251
  <td id="thumbnail-head-<?php echo $soundcloudIsGoldtrack->id ?>" class="A1B1">
252
- <p><a href="<?php echo $soundcloudIsGoldtrack->{'permalink-url'}?>" title="Go to the Soundcloud page" target="_blank"><img id="soundcloudMMThumb-<?php echo $soundcloudIsGoldtrack->id ?>" style="margin-top: 3px;" alt="" src="<?php echo ($soundcloudIsGoldtrack->{'artwork-url'} != '') ? $soundcloudIsGoldtrack->{'artwork-url'} : SIG_PLUGIN_DIR."/noThumbnail.gif" ?>" class="thumbnail"></a></p>
253
  </td>
254
  <td>
255
  <p><strong>Title:</strong> <?php echo $soundcloudIsGoldtrack->title ?></p>
@@ -330,7 +402,7 @@ function get_soundcloud_is_gold_user_tracks(){
330
  <p id="soundcloudMMEmbed-<?php echo $soundcloudIsGoldtrack->id ?>" class="field soundcloudMMEmbed" style="text-align:center">
331
  <!-- Soundcloud Preview here -->
332
  </p>
333
- <p class="soundcloudMMLoading" style="display:none"></p>
334
  </td>
335
  </tr>
336
  <tr class="soundcloudMM_shortcode">
@@ -378,17 +450,23 @@ function get_soundcloud_is_gold_user_tracks(){
378
  /******************************************************/
379
  add_shortcode('soundcloud', 'soundcloud_is_gold_shortcode');
380
  function soundcloud_is_gold_shortcode($atts){
381
- $soundcloudIsGoldSettings = get_option('soundcloud_is_gold_settings');
 
 
 
 
 
 
382
  //Only use lowercase as atts!
383
  extract( shortcode_atts( array(
384
  'id' => '1',
385
  'autoplay' => ((!isset($soundcloudIsGoldSettings[0]) || $soundcloudIsGoldSettings[0] == '') ? 'false' : 'true'),
386
  'comments' => ((!isset($soundcloudIsGoldSettings[1]) || $soundcloudIsGoldSettings[1] == '') ? 'false' : 'true'),
387
  'artwork' => ((!isset($soundcloudIsGoldSettings[2]) || $soundcloudIsGoldSettings[2] == '') ? 'false' : 'true'),
388
- 'width' => get_soundcloud_is_gold_default_width(get_option('soundcloud_is_gold_width_settings')),
389
- 'classes' => get_option('soundcloud_is_gold_classes'),
390
- 'playertype' => get_option('soundcloud_is_gold_playerType'),
391
- 'color' => get_option('soundcloud_is_gold_color'),
392
  'format' => 'tracks'
393
  ), $atts )
394
  );
@@ -404,26 +482,23 @@ function soundcloud_is_gold_shortcode($atts){
404
  /******************************************************/
405
 
406
 
407
- /** Preview **/
408
- add_action('wp_ajax_soundcloud_is_gold_player_preview', 'soundcloud_is_gold_player_preview');
409
- function soundcloud_is_gold_player_preview(){
410
- if(isset($_POST['request'])) echo soundcloud_is_gold_player($_POST['ID'], $_POST['autoPlay'], $_POST['comments'], $_POST['width'], $_POST['classes'], $_POST['playerType'], $_POST['color'], $_POST['artwork'], $_POST['format']);
411
- die;
412
- }
413
-
414
-
415
  /** The Player **/
416
  function soundcloud_is_gold_player($id, $autoPlay, $comments, $width, $classes, $playerTypes, $color, $artwork, $format){
417
-
 
 
 
 
 
 
418
  //Default values: Needed when not called trough shortode (like in the ajax preview)
419
- $soundcloudIsGoldSettings = get_option('soundcloud_is_gold_settings');
420
  if(!isset($autoPlay)) $autoPlay = ((!isset($soundcloudIsGoldSettings[0]) || $soundcloudIsGoldSettings[0] == '') ? 'false' : 'true');
421
  if(!isset($comments)) $comments = ((!isset($soundcloudIsGoldSettings[1]) || $soundcloudIsGoldSettings[1] == '') ? 'false' : 'true');
422
  if(!isset($artwork)) $artwork = ((!isset($soundcloudIsGoldSettings[2]) || $soundcloudIsGoldSettings[2] == '') ? 'false' : 'true');
423
- if(!isset($width)) $width = get_soundcloud_is_gold_default_width(get_option('soundcloud_is_gold_width_settings'));
424
- if(!isset($classes)) $classes = get_option('soundcloud_is_gold_classes');
425
- if(!isset($playerTypes)) $playerTypes = get_option('soundcloud_is_gold_playerType');
426
- if(!isset($color)) $color = get_option('soundcloud_is_gold_color');
427
  if(!isset($format)) $format = 'tracks';
428
  elseif($format == 'sets' || $format == 'set') $format = 'playlists';
429
  $html5Player = false;
@@ -471,13 +546,103 @@ function soundcloud_is_gold_player($id, $autoPlay, $comments, $width, $classes,
471
 
472
  }
473
 
474
-
 
 
 
 
 
 
 
 
 
 
475
  /** viewer Ajax **/
476
  add_action('wp_ajax_get_soundcloud_player', 'get_soundcloud_player');
477
  add_action('wp_ajax_nopriv_get_soundcloud_player', 'get_soundcloud_player');
478
  function get_soundcloud_player(){
479
  echo soundcloud_is_gold_player($_POST['id'], $_POST['width'], $_POST['comments'], $_POST['autoPlay'], $_POST['type'], $_POST['color'], $_POST['format']);
480
  die();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
481
 
 
 
482
  }
483
  ?>
30
  return $settings[$settings['type']];
31
  }
32
  function get_soundcloud_is_gold_default_settings_for_js(){
33
+ $options = get_option('soundcloud_is_gold_options');
34
+ //printl($options);
35
+ $soundcloudIsGoldActiveUser = isset($options['soundcloud_is_gold_active_user']) ? $options['soundcloud_is_gold_active_user'] : '';
36
+ $soundcloudIsGoldSettings = isset($options['soundcloud_is_gold_settings']) ? $options['soundcloud_is_gold_settings'] : '';
37
+ $soundcloudIsGoldPlayerType = isset($options['soundcloud_is_gold_playerType']) ? $options['soundcloud_is_gold_playerType'] : '';
38
+ $soundcloudIsGoldWidthSettings = isset($options['soundcloud_is_gold_width_settings']) ? $options['soundcloud_is_gold_width_settings'] : '';
39
+ $soundcloudIsGoldClasses = isset($options['soundcloud_is_gold_classes']) ? $options['soundcloud_is_gold_classes'] : '';
40
+ $soundcloudIsGoldColor = isset($options['soundcloud_is_gold_color']) ? $options['soundcloud_is_gold_color'] : '';
41
+
42
+ echo 'soundcloudIsGoldUser_default = "'.$soundcloudIsGoldActiveUser.'"; ';
43
  echo 'soundcloudIsGoldAutoPlay_default = '.((!isset($soundcloudIsGoldSettings[0]) || $soundcloudIsGoldSettings[0] == '') ? 'false' : 'true') .'; ';
44
  echo 'soundcloudIsGoldComments_default = '.((!isset($soundcloudIsGoldSettings[1]) || $soundcloudIsGoldSettings[1] == '') ? 'false' : 'true') .'; ';
45
  echo 'soundcloudIsGoldArtwork_default = '.((!isset($soundcloudIsGoldSettings[2]) || $soundcloudIsGoldSettings[2] == '') ? 'false' : 'true') .'; ';
46
+ echo 'soundcloudIsGoldPlayerType_default = "'.$soundcloudIsGoldPlayerType.'"; ';
47
+ echo 'soundcloudIsGoldWidth_default = "'.get_soundcloud_is_gold_default_width($soundcloudIsGoldWidthSettings).'"; ';
48
+ echo 'soundcloudIsGoldClasses_default = "'.$soundcloudIsGoldClasses.'"; ';
49
+ echo 'soundcloudIsGoldColor_default = "'.$soundcloudIsGoldColor.'"; ';
50
  }
51
  function get_soundcloudIsGoldUserNumber(){
52
+ $options = get_option('soundcloud_is_gold_options');
53
+ $soundcloudIsGoldActiveUser = isset($options['soundcloud_is_gold_active_user']) ? $options['soundcloud_is_gold_active_user'] : '';
54
+
55
+ $soundcloudIsGoldApiCall = 'http://api.soundcloud.com/users/'.$soundcloudIsGoldActiveUser.'.xml?client_id=9rD2GrGrajkmkw5eYFDp2g';
56
  $soundcloudIsGoldApiResponse = get_soundcloud_is_gold_api_response($soundcloudIsGoldApiCall);
57
  $result['tracks'] = ($soundcloudIsGoldApiResponse['response']->{'track-count'} == 0) ? '0' : $soundcloudIsGoldApiResponse['response']->{'track-count'};
58
  $result['sets'] = ($soundcloudIsGoldApiResponse['response']->{'playlist-count'} == 0) ? '0' : $soundcloudIsGoldApiResponse['response']->{'playlist-count'};
59
  $result['favorites'] = ($soundcloudIsGoldApiResponse['response']->{'public-favorites-count'} == 0) ? '0' : $soundcloudIsGoldApiResponse['response']->{'public-favorites-count'};
60
  return $result;
61
+ }
62
+ function get_soundcloud_is_gold_username_interface($options, $soundcloudIsGoldUsers){
63
+ ?>
64
+ <!-- Active User -->
65
+ <ul id="soundcloudIsGoldActiveUserContainer">
66
+ <li class="soundcloudIsGoldUserContainer" style="background-image:URL('<?php echo $options['soundcloud_is_gold_users'][$options['soundcloud_is_gold_active_user']][1] ?>')">
67
+ <span id="soundcloudIsGoldActiveLabel">&nbsp;</span>
68
+ <div>
69
+ <span class="soundcloudIsGoldRemoveUser" />&nbsp;</span>
70
+ <input type="hidden" value="<?php echo $options['soundcloud_is_gold_users'][$options['soundcloud_is_gold_active_user']][0]?>" name="soundcloud_is_gold_options[soundcloud_is_gold_users][<?php echo $options['soundcloud_is_gold_active_user'] ?>][0]" />
71
+ <input type="hidden" value="<?php echo $options['soundcloud_is_gold_users'][$options['soundcloud_is_gold_active_user']][1]?>" name="soundcloud_is_gold_options[soundcloud_is_gold_users][<?php echo $options['soundcloud_is_gold_active_user'] ?>][1]" />
72
+ <p><?php echo $options['soundcloud_is_gold_active_user'] ?></p>
73
+ </div>
74
+ </li>
75
+ <li class="hidden">
76
+ <input type="hidden" id="soundcloudIsGoldActiveUser" value="<?php echo $options['soundcloud_is_gold_active_user'] ?>" name="soundcloud_is_gold_options[soundcloud_is_gold_active_user]" />
77
+ </li>
78
+ </ul>
79
+ <!-- Add user -->
80
+ <ul id="soundcloudIsGoldAddUserContainer">
81
+ <li class="soundcloudMMLoading" style="display:none">&nbsp;</li>
82
+ <li id="soundcloudIsGoldUserError" class="orangeGradient soundcloudMMRounder">
83
+ <p>error message</p>
84
+ <a href="#" class="soundcloudMMBt soundcloudMMBtSmall blue soundcloudMMRounder ">close</a>
85
+ </li>
86
+ <li>
87
+ <input type="text" name="soundcloudIsGoldNewUser" id="soundcloudIsGoldNewUser"/>
88
+ <a id="soundcloudIsGoldAddUser" href="#" class="soundcloudMMBt blue soundcloudMMRounder soundcloudMMBtSmall" />Add Username</a>
89
+ </li>
90
+ </ul>
91
+ <!-- All inactive Users -->
92
+ <div id="soundcloudIsGoldUsernameCarouselWrapper">
93
+ <ul id="soundcloudIsGoldUsernameCarousel">
94
+ <?php foreach($soundcloudIsGoldUsers as $key => $user): ?>
95
+ <?php if($user[0] != $options['soundcloud_is_gold_active_user']) :?>
96
+ <li class="soundcloudIsGoldUserContainer" style="background-image:URL('<?php echo $user[1] ?>')">
97
+ <span class="soundcloudIsGoldRemoveUser" />&nbsp;</span>
98
+ <div>
99
+ <input type="hidden" value="<?php echo $user[0]?>" name="soundcloud_is_gold_options[soundcloud_is_gold_users][<?php echo $key ?>][0]" />
100
+ <input type="hidden" value="<?php echo $user[1]?>" name="soundcloud_is_gold_options[soundcloud_is_gold_users][<?php echo $key ?>][1]" />
101
+ <p><?php echo $user[0] ?></p>
102
+ </div>
103
+ </li>
104
+ <?php endif; endforeach; ?>
105
+ </ul>
106
+ <div id="soundcloudIsGoldUsernameCarouselNav"></div>
107
+ </div>
108
+ <?php
109
+ }
110
+
111
  function get_soundcloud_is_gold_api_response($soundcloudIsGoldApiCall){
112
  //Set Error default message && default XML state
113
  $soundcloudIsGoldRespError = false;
139
  /*Pagination
140
  soundcloud_is_gold_pagination($totalItems, $currentPage, $perPage)
141
  */
142
+ function soundcloud_is_gold_pagination($format, $totalItems, $currentPage, $perPage, $post_ID){
143
 
144
  // The items on the current page.
145
  $offset = ($currentPage - 1) * $perPage;
156
  $disableLast = ($currentPage == $lastPage) ? ' disabled' : '';
157
 
158
  $output = '<div class="tablenav-pages"><span class="displaying-num">'.$totalItems.' tracks</span>';
159
+ $output .= '<span class="pagination-links">';
160
+ $output .= '<a href="?post_id='.$post_ID.'&tab=soundcloud_is_gold&selectFormat='.$format.'&paged='.$firstPage.'&TB_iframe=1&width=640&height=584" title="Go to the first page" class="first-page'.$disableFirst.'">&laquo;</a>';
161
+ $output .= '<a href="?post_id='.$post_ID.'&tab=soundcloud_is_gold&selectFormat='.$format.'&paged='.$prevPage.'&TB_iframe=1&width=640&height=584" title="Go to the previous page" class="prev-page'.$disableFirst.'">&lsaquo;</a>';
162
  $output .= '<span class="paging-input">page '.$currentPage.' of <span class="total-pages">'.$lastPage.'</span></span>';
163
+ $output .= '<a href="?post_id='.$post_ID.'&tab=soundcloud_is_gold&selectFormat='.$format.'&paged='.$nextPage.'&TB_iframe=1&width=640&height=584" title="Go to the next page" class="next-page'.$disableLast.'">&rsaquo;</a>';
164
+ $output .= '<a href="?post_id='.$post_ID.'&tab=soundcloud_is_gold&selectFormat='.$format.'&paged='.$lastPage.'&TB_iframe=1&width=640&height=584" title="Go to the last page" class="last-page'.$disableLast.'">&raquo;</a>';
165
+ $output .= '</span></div>';
166
 
167
  return $output;
168
  }
235
  /*Add Soundcloud Button to Upload/Insert*/
236
  function plugin_media_button($context) {
237
  global $post_ID;
238
+ $plugin_media_button = ' %s' . '<a id="add_soundcloud_is_gold" title="Insert Soundcloud Player" href="media-upload.php?post_id='.$post_ID.'&tab=soundcloud_is_gold&selectFormat=tracks&paged=1&TB_iframe=1&width=640&height=584" class="thickbox"><img alt="Insert Soundcloud Player" src="'.SIG_PLUGIN_DIR.'images/soundcloud-is-gold-icon.png"></a>';
239
  return sprintf($context, $plugin_media_button);
240
  }
241
  add_filter('media_buttons_context', 'plugin_media_button');
243
  /** Populate the new Soundcloud is Gold Tab **/
244
  function get_soundcloud_is_gold_user_tracks(){
245
  //Default Settings
246
+ $options = get_option('soundcloud_is_gold_options');
247
+ //printl($options);
248
+ $soundcloudIsGoldActiveUser = isset($options['soundcloud_is_gold_active_user']) ? $options['soundcloud_is_gold_active_user'] : '';
249
+ $soundcloudIsGoldUsers = isset($options['soundcloud_is_gold_users']) ? $options['soundcloud_is_gold_users'] : '';
250
+ $soundcloudIsGoldSettings = isset($options['soundcloud_is_gold_settings']) ? $options['soundcloud_is_gold_settings'] : '';
251
+ $soundcloudIsGoldPlayerType = isset($options['soundcloud_is_gold_playerType']) ? $options['soundcloud_is_gold_playerType'] : '';
252
  $soundcloudIsGoldPlayerTypeDefault = empty($soundcloudIsGoldPlayerType) ? TRUE : FALSE;
253
+ $soundcloudIsGoldWidthSettings = isset($options['soundcloud_is_gold_width_settings']) ? $options['soundcloud_is_gold_width_settings'] : '';
254
  $soundcloudIsGoldWidth = get_soundcloud_is_gold_default_width($soundcloudIsGoldWidthSettings);
255
+ $soundcloudIsGoldClasses = isset($options['soundcloud_is_gold_classes']) ? $options['soundcloud_is_gold_classes'] : '';
256
+ $soundcloudIsGoldColor = isset($options['soundcloud_is_gold_color']) ? $options['soundcloud_is_gold_color'] : '';
257
+
258
  //Default Pagination Settings
259
  $soundcloudIsGoldTracksPerPage = 25;
260
  $soundcloudIsGoldPage = isset($_REQUEST['paged']) ? $_REQUEST['paged'] : '1';
263
 
264
  //API Call
265
  $soundcloudIsGoldSelectedFormat = isset($_REQUEST['selectFormat']) ? $_REQUEST['selectFormat'] : 'tracks';
266
+ if($soundcloudIsGoldSelectedFormat == 'tracks') $soundcloudIsGoldApiCall = 'http://api.soundcloud.com/users/'.$soundcloudIsGoldActiveUser.'/tracks.xml?limit='.$soundcloudIsGoldTracksPerPage.'&offset='.$soundcloudIsGoldApiOffset.'&client_id=9rD2GrGrajkmkw5eYFDp2g';
267
+ if($soundcloudIsGoldSelectedFormat == 'sets') $soundcloudIsGoldApiCall = 'http://api.soundcloud.com/users/'.$soundcloudIsGoldActiveUser.'/playlists.xml?limit='.$soundcloudIsGoldTracksPerPage.'&offset='.$soundcloudIsGoldApiOffset.'&client_id=9rD2GrGrajkmkw5eYFDp2g';
268
+ if($soundcloudIsGoldSelectedFormat == 'favorites') $soundcloudIsGoldApiCall = 'http://api.soundcloud.com/users/'.$soundcloudIsGoldActiveUser.'/favorites.xml?limit='.$soundcloudIsGoldTracksPerPage.'&offset='.$soundcloudIsGoldApiOffset.'&client_id=9rD2GrGrajkmkw5eYFDp2g';
269
  $soundcloudIsGoldApiResponse = get_soundcloud_is_gold_api_response($soundcloudIsGoldApiCall);
270
 
271
  //Pagination and Actions
272
  $soundcloudIsGoldNumbers = get_soundcloudIsGoldUserNumber($soundcloudIsGoldSelectedFormat);
273
+ $soundcloudIsGoldPagination = soundcloud_is_gold_pagination($soundcloudIsGoldSelectedFormat, $soundcloudIsGoldNumbers[$soundcloudIsGoldSelectedFormat], $soundcloudIsGoldPage, $soundcloudIsGoldTracksPerPage, $post_id);
274
  $soundcloudIsGoldSelectTracksFavsSets = soundcloud_is_gold_select_tracks_favs_sets($soundcloudIsGoldSelectedFormat, $soundcloudIsGoldNumbers, $post_id);
275
 
276
+ //Usernames
277
+ echo '<div class="soundcloudMMWrapper">';
278
+ echo '<div id="soundcloudMMUsernameHeader"><img src="'.$soundcloudIsGoldUsers[$soundcloudIsGoldActiveUser][1].'" width="50" height="50"/><span>'.$soundcloudIsGoldUsers[$soundcloudIsGoldActiveUser][0].'</span> <a href="#" id="soundcloudMMShowUsernames">show users options</a><a href="#" id="soundcloudMMHideUsernames" class="hidden">hide users options</a></div>';
279
+ echo '<div id="soundcloudMMUsermameTab">';
280
+ get_soundcloud_is_gold_username_interface($options, $soundcloudIsGoldUsers);
281
+ echo '</div></div>';
282
+
283
  echo '<div id="soundcloudMMTabActions" class="tablenav">';
284
  //Select Tracks / Sets / Favs
285
  echo (isset($soundcloudIsGoldSelectTracksFavsSets)) ? $soundcloudIsGoldSelectTracksFavsSets : '';
317
  <a href="#" class="toggle describe-toggle-on soundcloud" id="show-<?php echo $soundcloudIsGoldtrack->id ?>">Show</a>
318
  <a href="#" class="toggle describe-toggle-off soundcloudMM">Hide</a>
319
  <div class="filename new"><span class="title soundcloudMMTitle" id="soundcloudMMTitle-<?php echo $soundcloudIsGoldtrack->id ?>"><?php echo $soundcloudIsGoldtrack->title ?></span></div>
320
+ <table class="slidetoggle describe startclosed soundcloudMMWrapper soundcloudMMMainWrapper <?php echo $soundcloudIsGoldSelectedFormat ?>">
321
  <thead id="media-head-<?php echo $soundcloudIsGoldtrack->id ?>" class="media-item-info">
322
  <tr valign="top">
323
  <td id="thumbnail-head-<?php echo $soundcloudIsGoldtrack->id ?>" class="A1B1">
324
+ <p><a href="<?php echo $soundcloudIsGoldtrack->{'permalink-url'}?>" title="Go to the Soundcloud page" target="_blank"><img id="soundcloudMMThumb-<?php echo $soundcloudIsGoldtrack->id ?>" style="margin-top: 3px;" alt="" src="<?php echo ($soundcloudIsGoldtrack->{'artwork-url'} != '') ? $soundcloudIsGoldtrack->{'artwork-url'} : SIG_PLUGIN_DIR."images/noThumbnail.gif" ?>" class="thumbnail"></a></p>
325
  </td>
326
  <td>
327
  <p><strong>Title:</strong> <?php echo $soundcloudIsGoldtrack->title ?></p>
402
  <p id="soundcloudMMEmbed-<?php echo $soundcloudIsGoldtrack->id ?>" class="field soundcloudMMEmbed" style="text-align:center">
403
  <!-- Soundcloud Preview here -->
404
  </p>
405
+ <p class="soundcloudMMLoading soundcloudMMPreviewLoading" style="display:none"></p>
406
  </td>
407
  </tr>
408
  <tr class="soundcloudMM_shortcode">
450
  /******************************************************/
451
  add_shortcode('soundcloud', 'soundcloud_is_gold_shortcode');
452
  function soundcloud_is_gold_shortcode($atts){
453
+ $options = get_option('soundcloud_is_gold_options');
454
+ $soundcloudIsGoldSettings = isset($options['soundcloud_is_gold_settings']) ? $options['soundcloud_is_gold_settings'] : '';
455
+ $soundcloudIsGoldPlayerType = isset($options['soundcloud_is_gold_playerType']) ? $options['soundcloud_is_gold_playerType'] : '';
456
+ $soundcloudIsGoldWidthSettings = isset($options['soundcloud_is_gold_width_settings']) ? $options['soundcloud_is_gold_width_settings'] : '';
457
+ $soundcloudIsGoldClasses = isset($options['soundcloud_is_gold_classes']) ? $options['soundcloud_is_gold_classes'] : '';
458
+ $soundcloudIsGoldColor = isset($options['soundcloud_is_gold_color']) ? $options['soundcloud_is_gold_color'] : '';
459
+
460
  //Only use lowercase as atts!
461
  extract( shortcode_atts( array(
462
  'id' => '1',
463
  'autoplay' => ((!isset($soundcloudIsGoldSettings[0]) || $soundcloudIsGoldSettings[0] == '') ? 'false' : 'true'),
464
  'comments' => ((!isset($soundcloudIsGoldSettings[1]) || $soundcloudIsGoldSettings[1] == '') ? 'false' : 'true'),
465
  'artwork' => ((!isset($soundcloudIsGoldSettings[2]) || $soundcloudIsGoldSettings[2] == '') ? 'false' : 'true'),
466
+ 'width' => get_soundcloud_is_gold_default_width($soundcloudIsGoldWidthSettings),
467
+ 'classes' => $soundcloudIsGoldClasses,
468
+ 'playertype' => $soundcloudIsGoldPlayerType,
469
+ 'color' => $soundcloudIsGoldColor,
470
  'format' => 'tracks'
471
  ), $atts )
472
  );
482
  /******************************************************/
483
 
484
 
 
 
 
 
 
 
 
 
485
  /** The Player **/
486
  function soundcloud_is_gold_player($id, $autoPlay, $comments, $width, $classes, $playerTypes, $color, $artwork, $format){
487
+ $options = get_option('soundcloud_is_gold_options');
488
+ $soundcloudIsGoldSettings = isset($options['soundcloud_is_gold_settings']) ? $options['soundcloud_is_gold_settings'] : '';
489
+ $soundcloudIsGoldPlayerType = isset($options['soundcloud_is_gold_playerType']) ? $options['soundcloud_is_gold_playerType'] : '';
490
+ $soundcloudIsGoldWidthSettings = isset($options['soundcloud_is_gold_width_settings']) ? $options['soundcloud_is_gold_width_settings'] : '';
491
+ $soundcloudIsGoldClasses = isset($options['soundcloud_is_gold_classes']) ? $options['soundcloud_is_gold_classes'] : '';
492
+ $soundcloudIsGoldColor = isset($options['soundcloud_is_gold_color']) ? $options['soundcloud_is_gold_color'] : '';
493
+
494
  //Default values: Needed when not called trough shortode (like in the ajax preview)
 
495
  if(!isset($autoPlay)) $autoPlay = ((!isset($soundcloudIsGoldSettings[0]) || $soundcloudIsGoldSettings[0] == '') ? 'false' : 'true');
496
  if(!isset($comments)) $comments = ((!isset($soundcloudIsGoldSettings[1]) || $soundcloudIsGoldSettings[1] == '') ? 'false' : 'true');
497
  if(!isset($artwork)) $artwork = ((!isset($soundcloudIsGoldSettings[2]) || $soundcloudIsGoldSettings[2] == '') ? 'false' : 'true');
498
+ if(!isset($width)) $width = get_soundcloud_is_gold_default_width($soundcloudIsGoldWidthSettings);
499
+ if(!isset($classes)) $classes = $soundcloudIsGoldClasses;
500
+ if(!isset($playerTypes)) $playerTypes = $soundcloudIsGoldPlayerType;
501
+ if(!isset($color)) $color = $soundcloudIsGoldColor;
502
  if(!isset($format)) $format = 'tracks';
503
  elseif($format == 'sets' || $format == 'set') $format = 'playlists';
504
  $html5Player = false;
546
 
547
  }
548
 
549
+ /*******************************************/
550
+ /** **/
551
+ /** AJAX **/
552
+ /** **/
553
+ /*******************************************/
554
+ /** Preview **/
555
+ add_action('wp_ajax_soundcloud_is_gold_player_preview', 'soundcloud_is_gold_player_preview');
556
+ function soundcloud_is_gold_player_preview(){
557
+ if(isset($_POST['request'])) echo soundcloud_is_gold_player($_POST['ID'], $_POST['autoPlay'], $_POST['comments'], $_POST['width'], $_POST['classes'], $_POST['playerType'], $_POST['color'], $_POST['artwork'], $_POST['format']);
558
+ die;
559
+ }
560
  /** viewer Ajax **/
561
  add_action('wp_ajax_get_soundcloud_player', 'get_soundcloud_player');
562
  add_action('wp_ajax_nopriv_get_soundcloud_player', 'get_soundcloud_player');
563
  function get_soundcloud_player(){
564
  echo soundcloud_is_gold_player($_POST['id'], $_POST['width'], $_POST['comments'], $_POST['autoPlay'], $_POST['type'], $_POST['color'], $_POST['format']);
565
  die();
566
+ }
567
+ /** Add username **/
568
+ add_action('wp_ajax_soundcloud_is_gold_add_user', 'soundcloud_is_gold_add_user');
569
+ function soundcloud_is_gold_add_user(){
570
+ if(isset($_POST['request'])){
571
+ $options = get_option('soundcloud_is_gold_options');
572
+ if(isset($options['soundcloud_is_gold_users'])){
573
+ $return = 'error';
574
+ //Check if username doesn't exist already and is not blank
575
+ if(!empty($_POST['username']) && !array_key_exists($_POST['username'], $options['soundcloud_is_gold_users'])){
576
+ $newUsername = str_replace(" ", "-", trim($_POST['username']));
577
+ //Get user info
578
+ $userInfo = get_soundcloud_is_gold_api_response("http://api.soundcloud.com/users/".$newUsername.".xml?client_id=9rD2GrGrajkmkw5eYFDp2g");
579
+ if(isset($userInfo) && isset($userInfo['response']->permalink)){
580
+ $newUsername = (string)$userInfo['response']->permalink;
581
+ $newUsernameImg = (string)$userInfo['response']->{'avatar-url'}[0];
582
+
583
+ $return = '<li class="soundcloudIsGoldUserContainer" style="background-image:URL('.$newUsernameImg.')">';
584
+ $return .= '<span class="soundcloudIsGoldRemoveUser" />&nbsp;</span>';
585
+ $return .= '<div>';
586
+ $return .= '<input type="hidden" value="'.$newUsername.'" name="soundcloud_is_gold_options[soundcloud_is_gold_users]['.$newUsername.'][0]" />';
587
+ $return .= '<input type="hidden" value="'.$newUsernameImg.'" name="soundcloud_is_gold_options[soundcloud_is_gold_users]['.$newUsername.'][1]" />';
588
+ $return .= '<p>'.$newUsername.'</p>';
589
+ $return .= '</div>';
590
+ $return .= '</li>';
591
+
592
+ //Tab: extra actions
593
+ if($_POST['updateOption'] == '1'){
594
+ $options['soundcloud_is_gold_users'][$newUsername][0] = $newUsername;
595
+ $options['soundcloud_is_gold_users'][$newUsername][1] = $newUsernameImg;
596
+ update_option( 'soundcloud_is_gold_options', $options );
597
+ }
598
+ }
599
+ }
600
+ echo $return;
601
+ }
602
+ }
603
+ die;
604
+ }
605
+ /** Set Active User **/
606
+ add_action('wp_ajax_soundcloud_is_gold_set_active_user', 'soundcloud_is_gold_set_active_user');
607
+ function soundcloud_is_gold_set_active_user(){
608
+ $message = 'error';
609
+ if(isset($_POST['request'])){
610
+ $options = get_option('soundcloud_is_gold_options');
611
+ if(isset($options['soundcloud_is_gold_active_user'])){
612
+ //Check if username exist and is not blank
613
+ if(!empty($_POST['username']) && array_key_exists($_POST['username'], $options['soundcloud_is_gold_users'])){
614
+ $options['soundcloud_is_gold_active_user'] = $_POST['username'];
615
+ update_option( 'soundcloud_is_gold_options', $options );
616
+ $message = 'done';
617
+ }
618
+ }
619
+ }
620
+ echo $message;
621
+ die;
622
+ }
623
+ /** Delete User **/
624
+ add_action('wp_ajax_soundcloud_is_gold_delete_user', 'soundcloud_is_gold_delete_user');
625
+ function soundcloud_is_gold_delete_user(){
626
+ $message = 'error';
627
+ if(isset($_POST['request'])){
628
+ $options = get_option('soundcloud_is_gold_options');
629
+ if(isset($options['soundcloud_is_gold_active_user'])){
630
+ //Check username exist and isn't blank
631
+ if(!empty($_POST['username']) && array_key_exists($_POST['username'], $options['soundcloud_is_gold_users'])){
632
+ //Remove from users
633
+ unset($options['soundcloud_is_gold_users'][$_POST['username']]);
634
+ //If active user, set the first element to be active
635
+ if($options['soundcloud_is_gold_active_user'] == $_POST['username']){
636
+ $newActiveUser = array_shift(array_values($options['soundcloud_is_gold_users']));
637
+ $options['soundcloud_is_gold_active_user'] = $newActiveUser[0];
638
+ }
639
+ update_option( 'soundcloud_is_gold_options', $options );
640
+ $message = 'done';
641
+ }
642
+ }
643
+ }
644
 
645
+ echo $message;
646
+ die;
647
  }
648
  ?>
soundcloud-is-gold-js.js CHANGED
@@ -3,23 +3,174 @@ jQuery(document).ready(function($){
3
  /**INIT **/
4
  $(".soundcloudMMLoading").css('display', 'none');
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  /*** OPTIONS ***/
7
- /*$(".soundcloudMMInput").each(function(){
8
- var cleanOnce = false;
9
- $(this).focus(function(){
10
- if(!cleanOnce){
11
- $(this).val('');
12
- cleanOnce = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  }
14
  });
15
- });*/
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  /******************************************/
19
  /** SOUNDCLOUD **/
20
  /******************************************/
21
  //Attach Events for Player Preview and Shortcode
22
- $('.soundcloudMMWrapper').each(function(){
23
  var mySelf = $(this);
24
  //On changing settings
25
  $('input[type=checkbox], input[type=radio], .soundcloudMMWPSelectedWidth, .soundcloudMMColorPickerClose', this).click(function(){
@@ -120,6 +271,7 @@ jQuery(document).ready(function($){
120
  else newHeight = '165px';
121
  break;
122
  case 'Artwork':
 
123
  newHeight = width;
124
  break;
125
  case 'html5':
@@ -127,16 +279,6 @@ jQuery(document).ready(function($){
127
  else newHeight = '450px';
128
  break;
129
  }
130
- //Tell user it's loading
131
- $('.soundcloudMMEmbed', parent).fadeOut('fast', function(){
132
- $('.soundcloudMMLoading', parent).fadeIn();
133
- $('.soundcloudMMLoading', parent).animate({
134
- height: newHeight
135
- }, 'slow', function(){
136
-
137
- });
138
- });
139
-
140
  //Set request
141
  var myData = {
142
  action: 'soundcloud_is_gold_player_preview',
@@ -151,15 +293,26 @@ jQuery(document).ready(function($){
151
  color: color,
152
  format: format
153
  };
154
- jQuery.post(ajaxurl, myData, function(response) {
155
- if(response){
156
- $('.soundcloudMMEmbed', parent).css('height', newHeight).html(response);
157
- $('.soundcloudMMLoading', parent).fadeOut(function(){
158
- $(this).css('display', 'none');
159
- $('.soundcloudMMEmbed', parent).fadeIn();
 
 
 
 
 
 
 
 
 
 
160
  });
161
- }
162
- });
 
163
 
164
  }
165
 
@@ -188,12 +341,26 @@ jQuery(document).ready(function($){
188
  $('.soundcloudMMResetColor', this).click(function(e){
189
  e.preventDefault();
190
  soundcloudMMColorPicker.setColor(soundcloudIsGoldColor_default);
191
- colorInput.val(soundcloudIsGoldColor_default);
192
  updateMe(parent, true);
193
  });
194
  });
195
  }
196
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  function getID(t){
198
  myID = t.attr('id').match(/[0-9]+./);
199
  return myID[0];
3
  /**INIT **/
4
  $(".soundcloudMMLoading").css('display', 'none');
5
 
6
+ $("#soundcloudMMShowUsernames").click(function(e){
7
+ e.preventDefault();
8
+ $("#soundcloudMMUsermameTab").slideDown('fast');
9
+ $("#soundcloudMMHideUsernames").removeClass('hidden');
10
+ $(this).addClass('hidden');
11
+ });
12
+ $("#soundcloudMMHideUsernames").click(function(e){
13
+ e.preventDefault();
14
+ $("#soundcloudMMUsermameTab").slideUp('fast');
15
+ $("#soundcloudMMShowUsernames").removeClass('hidden');
16
+ $(this).addClass('hidden');
17
+ });
18
+
19
  /*** OPTIONS ***/
20
+ /* CarouFredSel: an infinite, circular jQuery carousel.
21
+ Configuration created by the "Configuration Robot"
22
+ at caroufredsel.frebsite.nl
23
+ */
24
+ $("#soundcloudIsGoldUserError a").click(function(e){
25
+ e.preventDefault();
26
+ $(this).parent().fadeOut();
27
+ }).parent().css("display", "none");
28
+
29
+ carousel()
30
+ $("#soundcloudMMUsermameTab").slideUp('fast');
31
+
32
+ function carousel(){
33
+ $("#soundcloudIsGoldUsernameCarousel").carouFredSel({
34
+ circular: false,
35
+ infinite: false,
36
+ width: 354,
37
+ height: 118,
38
+ align: "left",
39
+ padding: [0, 0, 0, 0],
40
+ margin: [0, 0, 0, 0],
41
+ items: {
42
+ visible: 3,
43
+ width: 118,
44
+ height: 118
45
+ },
46
+ auto: false,
47
+ pagination: "#soundcloudIsGoldUsernameCarouselNav"
48
+ }).find("li .soundcloudIsGoldRemoveUser").click(function() {
49
+ removeUser($(this).parent());
50
+ removeUserFromOptions($("div input:first", $(this).parent()).val(), false);
51
+ }).css("cursor", "pointer");
52
+ makeUserActive();
53
+ removeActiveUser();
54
+ }
55
+
56
+ /** Remove User **/
57
+ function removeUser(that){
58
+ that.animate({
59
+ opacity : 0
60
+ }, 500).animate({
61
+ width : 0,
62
+ margin : 0,
63
+ borderWidth : 0
64
+ }, 400, function() {
65
+ $("#soundcloudIsGoldUsernameCarousel").trigger("removeItem", that);
66
+ });
67
+ }
68
+ /** Remove User From Options (Tab only) **/
69
+ function removeUserFromOptions(usernameToRemove, reload){
70
+ if($("#soundcloudMMUsermameTab").length){
71
+ console.log(usernameToRemove);
72
+ //Set request
73
+ var myData = {
74
+ action: 'soundcloud_is_gold_delete_user',
75
+ request: 'soundcloudIsGoldDeleteUser',
76
+ username: usernameToRemove
77
+ };
78
+ jQuery.post(ajaxurl, myData, function(response) {
79
+ if(response == 'done' && reload) location.reload();
80
+ });
81
+ }
82
+ }
83
+ /** Add new User **/
84
+ $("#soundcloudIsGoldAddUser").click(function(e){
85
+ e.preventDefault();
86
+ $(".soundcloudMMLoading").fadeIn('fast');
87
+ //Set request
88
+ var myData = {
89
+ action: 'soundcloud_is_gold_add_user',
90
+ request: 'soundcloudIsGoldAddUser',
91
+ username: $("#soundcloudIsGoldNewUser").val(),
92
+ updateOption : $("#soundcloudMMUsermameTab").length
93
+ };
94
+ jQuery.post(ajaxurl, myData, function(response) {
95
+ $(".soundcloudMMLoading").fadeOut('fast');
96
+ if(response != "error"){
97
+ var args = [response, "#soundcloudIsGoldUsernameCarousel li:first", true, 0];
98
+ $("#soundcloudIsGoldUsernameCarousel").trigger("insertItem", args);
99
+ carousel();
100
+ }else{
101
+ $("#soundcloudIsGoldUserError p").html("wrong username").parent().fadeIn();
102
  }
103
  });
104
+ });
105
 
106
+ /** Make User Active **/
107
+ function makeUserActive(){
108
+ $("#soundcloudIsGoldUsernameCarousel .soundcloudIsGoldUserContainer div").click(function(){
109
+ previousActiveUser = $("#soundcloudIsGoldActiveUserContainer .soundcloudIsGoldUserContainer");
110
+ newActiveUser = $(this).parent();
111
+ //Remove from Carousel
112
+ $(this).parent().fadeOut(function(){
113
+ //Copy new Active User to the Active User container and move active user label
114
+ newActiveUser.clone().css("margin", "5px 4px").appendTo("#soundcloudIsGoldActiveUserContainer").prepend($("#soundcloudIsGoldActiveLabel")).fadeIn();
115
+ //Update hidden field for active user
116
+ $("#soundcloudIsGoldActiveUser").val($('p', newActiveUser).html());
117
+ //Remove it from carousel
118
+ $("#soundcloudIsGoldUsernameCarousel").trigger("removeItem", $(this));
119
+ //Move old active user to carousel
120
+ var args = [previousActiveUser, "#soundcloudIsGoldUsernameCarousel li:first", true, 0];
121
+ $("#soundcloudIsGoldUsernameCarousel").trigger("insertItem", args);
122
+ //Init Carousel
123
+ carousel();
124
+ //Tab: extra actions
125
+ if($("#soundcloudMMUsermameTab").length) {
126
+ $(".soundcloudMMLoading").fadeIn('fast');
127
+ //Set request
128
+ var myData = {
129
+ action: 'soundcloud_is_gold_set_active_user',
130
+ request: 'soundcloudIsGoldSetActiveUser',
131
+ username: $("#soundcloudIsGoldActiveUser").val()
132
+ };
133
+ jQuery.post(ajaxurl, myData, function(response) {
134
+ if(response != "error"){
135
+ //Reload Tab
136
+ location.reload();
137
+ }else{
138
+ //Error
139
+ $("#soundcloudIsGoldUserError p").html("wrong username").parent().fadeIn();
140
+ }
141
+ });
142
+ }
143
+ });
144
+
145
+ });
146
+ }
147
+
148
+ /** Remove Active user **/
149
+ function removeActiveUser(){
150
+ $("#soundcloudIsGoldActiveUserContainer .soundcloudIsGoldUserContainer .soundcloudIsGoldRemoveUser").click(function(){
151
+ removeUserFromOptions($("input:first", $(this).parent()).val(), true);
152
+ activeUserToRemove = $(this).parent().parent();
153
+ activeUserToRemove.fadeOut(function(){
154
+ //Copy new Active User to the Active User container and move active user label
155
+ $("#soundcloudIsGoldUsernameCarousel .soundcloudIsGoldUserContainer:first").clone().css("margin", "5px 4px").appendTo("#soundcloudIsGoldActiveUserContainer").prepend($("#soundcloudIsGoldActiveLabel")).fadeIn();
156
+ //Delete Active User
157
+ $(this).remove();
158
+ //Move First User from Carousel to Active
159
+ $("#soundcloudIsGoldUsernameCarousel .soundcloudIsGoldUserContainer:first").fadeOut(function(){
160
+ //Remove it from carousel
161
+ removeUser($(this));
162
+ //Update hidden field for active user
163
+ $("#soundcloudIsGoldActiveUser").val($('#soundcloudIsGoldActiveUserContainer .soundcloudIsGoldUserContainer div p').html());
164
+ });
165
+ });
166
+ });
167
+ }
168
 
169
  /******************************************/
170
  /** SOUNDCLOUD **/
171
  /******************************************/
172
  //Attach Events for Player Preview and Shortcode
173
+ $('.soundcloudMMMainWrapper').each(function(){
174
  var mySelf = $(this);
175
  //On changing settings
176
  $('input[type=checkbox], input[type=radio], .soundcloudMMWPSelectedWidth, .soundcloudMMColorPickerClose', this).click(function(){
271
  else newHeight = '165px';
272
  break;
273
  case 'Artwork':
274
+ width = '300px';
275
  newHeight = width;
276
  break;
277
  case 'html5':
279
  else newHeight = '450px';
280
  break;
281
  }
 
 
 
 
 
 
 
 
 
 
282
  //Set request
283
  var myData = {
284
  action: 'soundcloud_is_gold_player_preview',
293
  color: color,
294
  format: format
295
  };
296
+
297
+ //Tell user it's loading
298
+ $('.soundcloudMMEmbed', parent).fadeOut('fast', function(){
299
+ $('.soundcloudMMPreviewLoading', parent).fadeIn();
300
+ $('.soundcloudMMPreviewLoading', parent).animate({
301
+ height: newHeight
302
+ }, 'slow', function(){
303
+ //The Ajax request
304
+ jQuery.post(ajaxurl, myData, function(response) {
305
+ if(response){
306
+ $('.soundcloudMMEmbed', parent).css('height', newHeight).html(response);
307
+ $('.soundcloudMMPreviewLoading', parent).fadeOut('fast', function(){
308
+ $(this).css('display', 'none');
309
+ $('.soundcloudMMEmbed', parent).fadeIn();
310
+ });
311
+ }
312
  });
313
+
314
+ });
315
+ });
316
 
317
  }
318
 
341
  $('.soundcloudMMResetColor', this).click(function(e){
342
  e.preventDefault();
343
  soundcloudMMColorPicker.setColor(soundcloudIsGoldColor_default);
344
+ colorInput.val(soundcloudIsGoldColor_default).css('background-color', '#'+soundcloudIsGoldColor_default);
345
  updateMe(parent, true);
346
  });
347
  });
348
  }
349
 
350
+
351
+ /************** ADVANCED SETTINGS **************/
352
+ $('.soundcloudMMAdvancedSettingsPanels').css('display', 'none');
353
+ var closedAvancedSettingText = $('.soundcloudMMAdvancedSettingsShowHide').text();
354
+ var openedAvancedSettingText = "It's too much for me, take it away.";
355
+ $('.soundcloudMMAdvancedSettingsShowHide').click(function(e) {
356
+ e.preventDefault();
357
+ if($(this).text() == closedAvancedSettingText) $(this).text(openedAvancedSettingText);
358
+ else $(this).text(closedAvancedSettingText);
359
+ $('~ .soundcloudMMAdvancedSettingsPanels', this).slideToggle('slow', function() {
360
+ // Animation complete.
361
+ });
362
+ });
363
+
364
  function getID(t){
365
  myID = t.attr('id').match(/[0-9]+./);
366
  return myID[0];
soundcloud-is-gold.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Soundcloud is Gold
4
  Plugin URI: http://www.mightymess.com/soundcloud-is-gold-wordpress-plugin
5
  Description: <strong><a href="http://www.mightymess.com/soundcloud-is-gold-wordpress-plugin">Soundcloud is gold</a></strong> integrates perfectly into wordpress. Browse through your soundcloud tracks, sets and favorites from the 'soundcloud is gold' tab with the post's 'upload media' popup window. Select, set and add track, sets or favorites to your post using the soundcloud player. Live Preview, easy, smart and straightforward. You can set default settings in the option page, choose your defaut soundcloud player (Mini, Standard, Artwork, html5), its width, extra classes for you CSS lovers and your favorite colors. You'll still be able to set players to different settings before adding to your post if you fancy a one off change. Now with Html5 player!
6
- Version: 1.0.6
7
  Author: Thomas Michalak at Mighty Mess
8
  Author URI: http://www.mightymess.com/thomas-michalak
9
  License: GPL2 or Later
@@ -30,16 +30,19 @@ function get_soundcloud_is_gold_version() {
30
  /*** Plugin Init ***/
31
  add_action( 'admin_init', 'soundcloud_is_gold_admin_init' );
32
  function soundcloud_is_gold_admin_init() {
 
33
  wp_register_script('soundcloud-is-gold-js', SIG_PLUGIN_DIR.'soundcloud-is-gold-js.js', array('jquery', 'farbtastic'));
 
34
  wp_register_style('soundcloud-is-gold-css', SIG_PLUGIN_DIR.'soundcloud-is-gold-css.css');
35
- wp_register_style('ChunkFive', SIG_PLUGIN_DIR.'ChunkFive-fontfacekit/stylesheet.css');
36
- wp_register_style('Quicksand', SIG_PLUGIN_DIR.'Quicksand-fontfacekit/stylesheet.css');
37
  wp_register_style('soundcloud-is-gold-editor-css', SIG_PLUGIN_DIR.'tinymce-plugin/soundcloud-is-gold-editor_plugin.css');
38
  }
39
  //Plugin option scripts
40
  function soundcloud_is_gold_option_scripts() {
41
  wp_enqueue_script('farbtastic');
42
  wp_enqueue_script('soundcloud-is-gold-js');
 
43
  }
44
  //Plugin option style
45
  function soundcloud_is_gold_option_styles() {
@@ -54,19 +57,24 @@ function soundcloud_is_gold_option_fonts() {
54
  /*** Add Admin Menu ***/
55
  add_action('admin_menu', 'soundcloud_is_gold_menu');
56
  function soundcloud_is_gold_menu() {
57
- $soundcloudIsGoldPage = add_menu_page('Soundcloud is Gold: Options', 'Soundcloud is Gold', 'activate_plugins', 'soundcloud-is-gold.php', 'soundcloud_is_gold_options', SIG_PLUGIN_DIR.'soundcloud-is-gold-icon.png');
58
- add_action( "admin_print_scripts-$soundcloudIsGoldPage", 'soundcloud_is_gold_option_scripts' ); // Add script
59
- add_action( "admin_print_styles-$soundcloudIsGoldPage", 'soundcloud_is_gold_option_styles' ); // Add Style
60
- add_action( "admin_print_styles-$soundcloudIsGoldPage", 'soundcloud_is_gold_option_fonts' ); // Add Fonts
 
 
 
 
61
  }
62
  /*** Link to Settings from the plugin Page ***/
63
- function soundcloud_is_gold_settings_link($links) {
64
- $settings_link = '<a href="admin.php?page=soundcloud-is-gold.php">Settings</a>';
65
- array_unshift($links, $settings_link);
66
- return $links;
 
 
67
  }
68
- $plugin = plugin_basename(__FILE__);
69
- add_filter("plugin_action_links_$plugin", 'soundcloud_is_gold_settings_link', 10, 2 );
70
 
71
  /*** Add tint Mce Soundcloud is Gold Plugin ***/
72
  add_filter("mce_external_plugins", 'soundcloud_is_gold_mce_plugin');
@@ -75,38 +83,71 @@ add_filter('mce_css', 'soundcloud_is_gold_mce_css');
75
 
76
 
77
  /*** Options and Utilities***/
78
- $soundcloudIsGoldDefaultUsers = array('t-m', 'anna-chocola');
79
- add_option('soundcloud_is_gold_user', $soundcloudIsGoldDefaultUsers[array_rand($soundcloudIsGoldDefaultUsers, 1)]);
80
-
81
- $soundcloudIsGoldDefaultSettings = array(
 
 
 
 
 
 
 
 
 
 
 
 
82
  false,
83
  true,
84
  true
85
- );
86
- add_option('soundcloud_is_gold_settings', $soundcloudIsGoldDefaultSettings);
87
- add_option('soundcloud_is_gold_playerType', 'Standard');
88
- $soundcloudIsGoldWitdhDefaultSettings = array(
89
  "type" => "custom",
90
  "wp" => "medium",
91
- "custom" => "100%"
92
-
93
- );
94
- add_option('soundcloud_is_gold_width_settings', $soundcloudIsGoldWitdhDefaultSettings);
95
- add_option('soundcloud_is_gold_classes', '');
96
- add_option('soundcloud_is_gold_color', 'ff7700');
97
-
98
- //delete_option(soundcloud_is_gold_width_settings);
99
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  /*** Options Output ***/
101
  function soundcloud_is_gold_options(){
102
- $soundcloudIsGoldUser = get_option('soundcloud_is_gold_user');
103
- $soundcloudIsGoldSettings = get_option('soundcloud_is_gold_settings');
104
- $soundcloudIsGoldPlayerType = get_option('soundcloud_is_gold_playerType');
 
 
 
105
  $soundcloudIsGoldPlayerTypeDefault = empty($soundcloudIsGoldPlayerType) ? TRUE : FALSE;
106
- $soundcloudIsGoldWidthSettings = get_option('soundcloud_is_gold_width_settings');
107
- $soundcloudIsGoldClasses = get_option('soundcloud_is_gold_classes');
108
- $soundcloudIsGoldColor = get_option('soundcloud_is_gold_color');
109
- $soundcloudIsGoldApiCall = 'http://api.soundcloud.com/users/'.$soundcloudIsGoldUser.'/tracks.xml?limit=1&client_id=9rD2GrGrajkmkw5eYFDp2g';
 
110
 
111
  $soundcloudIsGoldApiResponse = get_soundcloud_is_gold_api_response($soundcloudIsGoldApiCall);
112
  if(isset($soundcloudIsGoldApiResponse['response']) && $soundcloudIsGoldApiResponse['response']){
@@ -123,43 +164,48 @@ function soundcloud_is_gold_options(){
123
  <?php get_soundcloud_is_gold_default_settings_for_js(); ?>
124
  </script>
125
 
126
- <div class="soundcloudMMWrapper soundcloudMMOptions">
127
-
128
  <div id="soundcloudMMTop" class="darkGreyGradient">
129
- <a id="soundcloudMMLogo" class="orangeGradient" href="http://www.soundcloud.com" title="visit SoundCloud website"><img src="<?php echo SIG_PLUGIN_DIR ?>/soundcloud-logo-sc.png" width="107" height="71" alt="Soundcloud Logo"/></a>
130
  <a id="soundcloudMMHeader" class="mediumGreyGradient textShadow" href="http://www.mightymess.com/soundcloud-is-gold-wordpress-plugin" alt="Visit Mighty Mess for more cool stuff">
131
  <span class="soundcloudMMTitle">SoundCloud is gold <small>by Thomas Michalak</small></span>
132
  <span class="soundcloudMMUrl">www.mightymess.com/soundcloud-is-gold-wordpress-plugin</span>
133
  </a>
134
- <p id="soundcloudMMVersion">version <?php echo get_soundcloud_is_gold_version() ?></p>
135
  </div>
136
 
137
  <div id="soundcloudMMMain" class="lightBlueGradient">
138
  <form method="post" action="options.php" id="soundcloudMMMainForm" name="soundcloudMMMainForm" class="">
139
- <p class="hidden soundcloudMMId" id="soundcloudMMId-<?php echo $soundcouldMMId ?>"><?php echo $soundcouldMMId ?></p>
140
- <?php wp_nonce_field('update-options'); ?>
141
  <ul id="soundcloudMMSettings">
142
- <li class="soundcloudMMBox"><label>User Name</label><input class="soundcloudMMInput <?php echo empty($soundcloudIsGoldUser) ? 'soundcloudMMInputInfo' : '' ?>" type="text" name="soundcloud_is_gold_user" id="soundcloudIsGoldUser" value="<?php echo $soundcloudIsGoldUser ?>"></li>
143
- <li class="soundcloudMMBox"><label>Default Settings</label>
 
 
 
 
144
  <ul class="subSettings checkboxes">
145
- <li><input type="checkbox" <?php echo (isset($soundcloudIsGoldSettings[0]) && $soundcloudIsGoldSettings[0]) ? 'checked="checked"' : ''?> name="soundcloud_is_gold_settings[0]" value="true" class="soundcloudMMAutoPlay" id="soundcloudMMAutoPlay"/><label for="soundcloudMMAutoPlay">Play Automatically</label></li>
146
- <li><input type="checkbox" <?php echo (isset($soundcloudIsGoldSettings[1]) && $soundcloudIsGoldSettings[1]) ? 'checked="checked"' : ''?> name="soundcloud_is_gold_settings[1]" value="true" class="soundcloudMMShowComments" id="soundcloudMMShowComments"/><label for="soundcloudMMShowComments">Show comments <small>(Standard and Artwork player)</small></label></li>
147
- <li><input type="checkbox" <?php echo (isset($soundcloudIsGoldSettings[2]) && $soundcloudIsGoldSettings[2]) ? 'checked="checked"' : ''?> name="soundcloud_is_gold_settings[2]" value="true" class="soundcloudMMShowArtwork" id="soundcloudMMShowArtwork"/><label for="soundcloudMMShowArtwork">Show Artwork <small>(html5 player)</small></label></li>
148
  </ul>
149
  </li>
150
- <li class="soundcloudMMBox"><label>Default Player Type</label>
 
151
  <ul class="subSettings radios">
152
  <?php
153
  foreach(get_soundcloud_is_gold_player_types() as $type) : ?>
154
- <li><input name="soundcloud_is_gold_playerType" id="<?php echo $type ?>" class="soundcloudMMPlayerType" type="radio" value="<?php echo $type ?>" <?php if($soundcloudIsGoldPlayerTypeDefault && $type == 'Standard') echo 'checked="checked"'; else echo ($soundcloudIsGoldPlayerType === $type) ? 'checked="checked"' : '' ?> /><label for="<?php echo $type ?>"><?php echo $type; if($type == 'Artwork') echo ' <small>(not available on free soundcloud account)</small>'; if($type == 'html5') echo ' <small>new! (beta)</small>' ?></label></li>
155
  <?php endforeach; ?>
156
  </ul>
157
  </li>
158
- <li class="soundcloudMMBox"><label>Default Width</label>
 
159
  <ul id="soundcloudMMWidthSetting" class="subSettings texts">
160
  <li>
161
- <input name="soundcloud_is_gold_width_settings[type]" <?php echo ($soundcloudIsGoldWidthSettings['type'] == "wp") ? 'checked="checked"' : ''; ?> id="soundcloudMMWpWidth" value="wp" type="radio" class="soundcloudMMWpWidth soundcloudMMWidthType radio"/><label for="soundcloudMMWpWidth">Media Width</label>
162
- <select class="soundcloudMMInput soundcloudMMWidth" name="soundcloud_is_gold_width_settings[wp]">
163
  <?php foreach(get_soundcloud_is_gold_wordpress_sizes() as $key => $soundcloudIsGoldMediaSize) : ?>
164
  <?php
165
  //First Time, then Other Times
@@ -170,46 +216,51 @@ function soundcloud_is_gold_options(){
170
  </select>
171
  </li>
172
  <li>
173
- <input name="soundcloud_is_gold_width_settings[type]" <?php echo ($soundcloudIsGoldWidthSettings['type'] == "custom") ? 'checked="checked"' : ''; ?> id="soundcloudMMCustomWidth" value="custom" type="radio" class="soundcloudMMCustomWidth soundcloudMMWidthType radio"/><label for="soundcloudMMCustomWidth">Custom Width</label>
174
- <input name="soundcloud_is_gold_width_settings[custom]" id="soundcloudMMCustomSelectedWidth" class="soundcloudMMInput soundcloudMMWidth soundcloudMMCustomSelectedWidth" type="text" name="soundcloudMMCustomSelectedWidth" value="<?php echo $soundcloudIsGoldWidthSettings['custom'] ?>" />
175
  </li>
176
  </ul>
177
  </li>
178
- <li class="soundcloudMMBox"><label>Extras</label>
 
179
  <ul class="subSettings texts">
180
  <li>
181
  <label>Color</label>
182
  <div class="soundcloudMMColorPickerContainer" id="soundcloudMMColorPickerContainer">
183
- <input type="text" class="soundcloudMMInput soundcloudMMColor" id="soundcloudMMColor" name="soundcloud_is_gold_color" value="<?php echo $soundcloudIsGoldColor ?>" style="background-color:<?php echo $soundcloudIsGoldColor ?>"/><a href="#" class="soundcloudMMBt soundcloudMMBtSmall inline blue soundcloudMMRounder soundcloudMMResetColor">reset to default</a>
184
  <div id="soundcloudMMColorPicker" class="shadow soundcloudMMColorPicker"><div id="soundcloudMMColorPickerSelect" class="soundcloudMMColorPickerSelect"></div><a id="soundcloudMMColorPickerClose" class="blue soundcloudMMBt soundcloudMMColorPickerClose">done</a></div>
185
  </div>
186
  </li>
187
  <li class="clear">
188
- <label>Classes <small>(no commas)</small></label><input class="soundcloudMMInput soundcloudMMClasses" type="text" name="soundcloud_is_gold_classes" value="<?php echo $soundcloudIsGoldClasses ?>" />
189
  </li>
190
  </ul>
191
  </li>
192
- <li class="soundcloudMMBox"><label>Live Preview <small>(your latest track)</small></label>
 
 
 
 
 
193
  <?php if($soundcloudIsGoldApiResponse['response']) :?>
194
  <p class="soundcloudMMEmbed soundcloudMMEmbedOptions" style="text-align:center;">
195
  <!-- Soundcloud Preview here -->
196
  </p>
197
- <p class="soundcloudMMLoading" style="display:none"></p>
198
  <?php else : ?>
199
  <!-- Error getting XML -->
200
  <div class="soundcloudMMXmlError"><p><?php echo $soundcloudIsGoldApiResponse['error'] ? $soundcloudIsGoldApiResponse['error'] : "Oups! There's been a error while getting the tracks from soundcloud. Please reload the page."?></p></div>
201
  <?php endif; ?>
202
  </li>
203
  </ul>
204
- <input type="hidden" name="action" value="update" />
205
- <input type="hidden" name="page_options" value="soundcloud_is_gold_user, soundcloud_is_gold_settings, soundcloud_is_gold_playerType, soundcloud_is_gold_width_settings, soundcloud_is_gold_classes, soundcloud_is_gold_color" />
206
- <p id="soundcloudMMSubmit"><input type="submit" name="Submit" value="Save Your SoundCloud Settings" class="soundcloudMMBt orangeGradient"/></p>
207
- </form>
208
  </div>
209
  <ul id="soundcloudMMExtras" class="lightGreyGradient">
210
- <li><a href="http://soundcloud.com/t-m" title="TM's music on SoundCloud" class="soundcloudMMBt blue soundcloudMMRounder">TM on SoundCloud</a></li>
211
- <li><a href="http://www.mightymess.com" title="Thomas Michalak's Website" class="soundcloudMMBt blue soundcloudMMRounder">More Mighty Mess</a></li>
212
- <li><a href="http://wordpress.org/tags/soundcloud-is-gold?forum_id=10" title="Soundcloud is Gold Forum" class="soundcloudMMBt blue soundcloudMMRounder">Forum</a></li>
213
  <li>
214
  <form class="soundcloudMMBtForm" action="https://www.paypal.com/cgi-bin/webscr" method="post">
215
  <input type="hidden" name="cmd" value="_s-xclick">
3
  Plugin Name: Soundcloud is Gold
4
  Plugin URI: http://www.mightymess.com/soundcloud-is-gold-wordpress-plugin
5
  Description: <strong><a href="http://www.mightymess.com/soundcloud-is-gold-wordpress-plugin">Soundcloud is gold</a></strong> integrates perfectly into wordpress. Browse through your soundcloud tracks, sets and favorites from the 'soundcloud is gold' tab with the post's 'upload media' popup window. Select, set and add track, sets or favorites to your post using the soundcloud player. Live Preview, easy, smart and straightforward. You can set default settings in the option page, choose your defaut soundcloud player (Mini, Standard, Artwork, html5), its width, extra classes for you CSS lovers and your favorite colors. You'll still be able to set players to different settings before adding to your post if you fancy a one off change. Now with Html5 player!
6
+ Version: 2.0
7
  Author: Thomas Michalak at Mighty Mess
8
  Author URI: http://www.mightymess.com/thomas-michalak
9
  License: GPL2 or Later
30
  /*** Plugin Init ***/
31
  add_action( 'admin_init', 'soundcloud_is_gold_admin_init' );
32
  function soundcloud_is_gold_admin_init() {
33
+ register_setting( 'soundcloud_is_gold_options', 'soundcloud_is_gold_options' );
34
  wp_register_script('soundcloud-is-gold-js', SIG_PLUGIN_DIR.'soundcloud-is-gold-js.js', array('jquery', 'farbtastic'));
35
+ wp_register_script('carouFredSel', SIG_PLUGIN_DIR.'includes/jquery.carouFredSel-5.5.0-packed.js', array('jquery'));
36
  wp_register_style('soundcloud-is-gold-css', SIG_PLUGIN_DIR.'soundcloud-is-gold-css.css');
37
+ wp_register_style('ChunkFive', SIG_PLUGIN_DIR.'includes/ChunkFive-fontfacekit/stylesheet.css');
38
+ wp_register_style('Quicksand', SIG_PLUGIN_DIR.'includes/Quicksand-fontfacekit/stylesheet.css');
39
  wp_register_style('soundcloud-is-gold-editor-css', SIG_PLUGIN_DIR.'tinymce-plugin/soundcloud-is-gold-editor_plugin.css');
40
  }
41
  //Plugin option scripts
42
  function soundcloud_is_gold_option_scripts() {
43
  wp_enqueue_script('farbtastic');
44
  wp_enqueue_script('soundcloud-is-gold-js');
45
+ wp_enqueue_script('carouFredSel');
46
  }
47
  //Plugin option style
48
  function soundcloud_is_gold_option_styles() {
57
  /*** Add Admin Menu ***/
58
  add_action('admin_menu', 'soundcloud_is_gold_menu');
59
  function soundcloud_is_gold_menu() {
60
+ //Main
61
+ $soundcloudIsGoldPage = add_menu_page('Soundcloud is Gold: Options', 'Soundcloud is Gold', 'activate_plugins', __FILE__, 'soundcloud_is_gold_options', SIG_PLUGIN_DIR.'images/soundcloud-is-gold-icon.png');
62
+ add_action( "admin_print_scripts-$soundcloudIsGoldPage", 'soundcloud_is_gold_option_scripts' ); // Add script
63
+ add_action( "admin_print_styles-$soundcloudIsGoldPage", 'soundcloud_is_gold_option_styles' ); // Add Style
64
+ add_action( "admin_print_styles-$soundcloudIsGoldPage", 'soundcloud_is_gold_option_fonts' ); // Add Fonts
65
+ }
66
+ function soundcloud_is_gold_advanced_options() {
67
+ //include('soundcloud-is-gold-advanced.php');
68
  }
69
  /*** Link to Settings from the plugin Page ***/
70
+ function soundcloud_is_gold_settings_link($links, $file) {
71
+ if ( $file == plugin_basename( __FILE__ ) ) {
72
+ $settings_link = '<a href="admin.php?page=soundcloud-is-gold/soundcloud-is-gold.php">'.__('Settings').'</a>';
73
+ array_unshift($links, $settings_link);
74
+ }
75
+ return $links;
76
  }
77
+ add_filter("plugin_action_links", 'soundcloud_is_gold_settings_link', 10, 2 );
 
78
 
79
  /*** Add tint Mce Soundcloud is Gold Plugin ***/
80
  add_filter("mce_external_plugins", 'soundcloud_is_gold_mce_plugin');
83
 
84
 
85
  /*** Options and Utilities***/
86
+ register_activation_hook(__FILE__, 'soundcloud_is_gold_add_defaults');
87
+ function soundcloud_is_gold_add_defaults() {
88
+ $tmp = get_option('soundcloud_is_gold_options');
89
+ //First Time install or upgrade from version previous to 1.0.7
90
+ if(empty($tmp)) {
91
+ $soundcloudIsGoldDefaultUsers = array('anna-chocola' => array('anna-chocola', 'http://i1.sndcdn.com/avatars-000009470567-spqine-large.jpg?4387aef'), 't-m' => array('t-m', 'http://i1.sndcdn.com/avatars-000002680779-fkvvpj-large.jpg?4387aef'));
92
+ $soundcloudIsGoldDefaultUser = $soundcloudIsGoldDefaultUsers[array_rand($soundcloudIsGoldDefaultUsers, 1)][0];
93
+ if(get_option('soundcloud_is_gold_user')){
94
+ $soundcloudIsGoldDefaultUser = get_option('soundcloud_is_gold_user');
95
+ $userInfo = get_soundcloud_is_gold_api_response("http://api.soundcloud.com/users/".$soundcloudIsGoldDefaultUser.".xml?client_id=9rD2GrGrajkmkw5eYFDp2g");
96
+ $newUsername = (string)$userInfo['response']->permalink;
97
+ $newUsernameImg = (string)$userInfo['response']->{'avatar-url'}[0];
98
+ $soundcloudIsGoldDefaultUsers[$newUsername][0] = $newUsername;
99
+ $soundcloudIsGoldDefaultUsers[$newUsername][1] = $newUsernameImg;
100
+ }
101
+ $soundcloudIsGoldDefaultSettings = array(
102
  false,
103
  true,
104
  true
105
+ );
106
+ $soundcloudIsGoldWitdhDefaultSettings = array(
 
 
107
  "type" => "custom",
108
  "wp" => "medium",
109
+ "custom" => "100%"
110
+ );
111
+ //Either use previous settings from version prior to 1.0.7 or use defaults is first time install
112
+ $args = array(
113
+ 'soundcloud_is_gold_users' => $soundcloudIsGoldDefaultUsers,
114
+ 'soundcloud_is_gold_active_user' => $soundcloudIsGoldDefaultUser,
115
+ 'soundcloud_is_gold_settings' => (get_option('soundcloud_is_gold_settings')) ? get_option('soundcloud_is_gold_settings') : $soundcloudIsGoldDefaultSettings,
116
+ 'soundcloud_is_gold_playerType' => (get_option('soundcloud_is_gold_playerType')) ? get_option('soundcloud_is_gold_playerType') : 'html5',
117
+ 'soundcloud_is_gold_width_settings' => (get_option('soundcloud_is_gold_width_settings')) ? get_option('soundcloud_is_gold_width_settings') : $soundcloudIsGoldWitdhDefaultSettings,
118
+ 'soundcloud_is_gold_classes' => (get_option('soundcloud_is_gold_classes')) ? get_option('soundcloud_is_gold_classes') : '',
119
+ 'soundcloud_is_gold_color' => (get_option('soundcloud_is_gold_color')) ? get_option('soundcloud_is_gold_color') : 'ff7700'
120
+ );
121
+ //Update with old/default values
122
+ update_option('soundcloud_is_gold_options', $args);
123
+ //Delete old entries in db
124
+ delete_option("soundcloud_is_gold_user");
125
+ delete_option("soundcloud_is_gold_settings");
126
+ delete_option("soundcloud_is_gold_playerType");
127
+ delete_option("soundcloud_is_gold_width_settings");
128
+ delete_option("soundcloud_is_gold_classes");
129
+ delete_option("soundcloud_is_gold_color");
130
+ }
131
+ }
132
+ // Delete options table entries ONLY when plugin deactivated AND deleted
133
+ register_uninstall_hook(__FILE__, 'soundcloud_is_gold_delete_plugin_options');
134
+ function soundcloud_is_gold_delete_plugin_options() {
135
+ delete_option("soundcloud_is_gold_options");
136
+ }
137
  /*** Options Output ***/
138
  function soundcloud_is_gold_options(){
139
+ $options = get_option('soundcloud_is_gold_options');
140
+ //printl($options);
141
+ $soundcloudIsGoldActiveUser = isset($options['soundcloud_is_gold_active_user']) ? $options['soundcloud_is_gold_active_user'] : '';
142
+ $soundcloudIsGoldUsers = isset($options['soundcloud_is_gold_users']) ? $options['soundcloud_is_gold_users'] : '';
143
+ $soundcloudIsGoldSettings = isset($options['soundcloud_is_gold_settings']) ? $options['soundcloud_is_gold_settings'] : '';
144
+ $soundcloudIsGoldPlayerType = isset($options['soundcloud_is_gold_playerType']) ? $options['soundcloud_is_gold_playerType'] : '';
145
  $soundcloudIsGoldPlayerTypeDefault = empty($soundcloudIsGoldPlayerType) ? TRUE : FALSE;
146
+ $soundcloudIsGoldWidthSettings = isset($options['soundcloud_is_gold_width_settings']) ? $options['soundcloud_is_gold_width_settings'] : '';
147
+ $soundcloudIsGoldClasses = isset($options['soundcloud_is_gold_classes']) ? $options['soundcloud_is_gold_classes'] : '';
148
+ $soundcloudIsGoldColor = isset($options['soundcloud_is_gold_color']) ? $options['soundcloud_is_gold_color'] : '';
149
+
150
+ $soundcloudIsGoldApiCall = 'http://api.soundcloud.com/users/'.$soundcloudIsGoldActiveUser.'/tracks.xml?limit=1&client_id=9rD2GrGrajkmkw5eYFDp2g';
151
 
152
  $soundcloudIsGoldApiResponse = get_soundcloud_is_gold_api_response($soundcloudIsGoldApiCall);
153
  if(isset($soundcloudIsGoldApiResponse['response']) && $soundcloudIsGoldApiResponse['response']){
164
  <?php get_soundcloud_is_gold_default_settings_for_js(); ?>
165
  </script>
166
 
167
+ <div class="soundcloudMMWrapper soundcloudMMOptions soundcloudMMMainWrapper">
 
168
  <div id="soundcloudMMTop" class="darkGreyGradient">
169
+ <a id="soundcloudMMLogo" class="orangeGradient" href="http://www.soundcloud.com" title="visit SoundCloud website"><img src="<?php echo SIG_PLUGIN_DIR ?>/images/soundcloud-logo-sc.png" width="107" height="71" alt="Soundcloud Logo"/></a>
170
  <a id="soundcloudMMHeader" class="mediumGreyGradient textShadow" href="http://www.mightymess.com/soundcloud-is-gold-wordpress-plugin" alt="Visit Mighty Mess for more cool stuff">
171
  <span class="soundcloudMMTitle">SoundCloud is gold <small>by Thomas Michalak</small></span>
172
  <span class="soundcloudMMUrl">www.mightymess.com/soundcloud-is-gold-wordpress-plugin</span>
173
  </a>
174
+ <p id="soundcloudMMVersion">version <?php echo get_soundcloud_is_gold_version($options) ?></p>
175
  </div>
176
 
177
  <div id="soundcloudMMMain" class="lightBlueGradient">
178
  <form method="post" action="options.php" id="soundcloudMMMainForm" name="soundcloudMMMainForm" class="">
179
+ <p class="hidden soundcloudMMId" id="soundcloudMMId-<?php echo $soundcouldMMId ?>"><?php echo $soundcouldMMId ?></p>
180
+ <?php settings_fields('soundcloud_is_gold_options'); ?>
181
  <ul id="soundcloudMMSettings">
182
+ <!-- Username -->
183
+ <li class="soundcloudMMBox"><label class="optionLabel">User Name</label>
184
+ <?php get_soundcloud_is_gold_username_interface($options, $soundcloudIsGoldUsers) ?>
185
+ </li>
186
+ <!-- Default Settings -->
187
+ <li class="soundcloudMMBox"><label class="optionLabel">Default Settings</label>
188
  <ul class="subSettings checkboxes">
189
+ <li><input type="checkbox" <?php echo (isset($soundcloudIsGoldSettings[0]) && $soundcloudIsGoldSettings[0]) ? 'checked="checked"' : ''?> name="soundcloud_is_gold_options[soundcloud_is_gold_settings][0]" value="true" class="soundcloudMMAutoPlay" id="soundcloudMMAutoPlay"/><label for="soundcloudMMAutoPlay">Play Automatically</label></li>
190
+ <li><input type="checkbox" <?php echo (isset($soundcloudIsGoldSettings[1]) && $soundcloudIsGoldSettings[1]) ? 'checked="checked"' : ''?> name="soundcloud_is_gold_options[soundcloud_is_gold_settings][1]" value="true" class="soundcloudMMShowComments" id="soundcloudMMShowComments"/><label for="soundcloudMMShowComments">Show comments <small>(Standard and Artwork player)</small></label></li>
191
+ <li><input type="checkbox" <?php echo (isset($soundcloudIsGoldSettings[2]) && $soundcloudIsGoldSettings[2]) ? 'checked="checked"' : ''?> name="soundcloud_is_gold_options[soundcloud_is_gold_settings][2]" value="true" class="soundcloudMMShowArtwork" id="soundcloudMMShowArtwork"/><label for="soundcloudMMShowArtwork">Show Artwork <small>(html5 player)</small></label></li>
192
  </ul>
193
  </li>
194
+ <!-- Player Type -->
195
+ <li class="soundcloudMMBox"><label class="optionLabel">Default Player Type</label>
196
  <ul class="subSettings radios">
197
  <?php
198
  foreach(get_soundcloud_is_gold_player_types() as $type) : ?>
199
+ <li><input name="soundcloud_is_gold_options[soundcloud_is_gold_playerType]" id="<?php echo $type ?>" class="soundcloudMMPlayerType" type="radio" value="<?php echo $type ?>" <?php if($soundcloudIsGoldPlayerTypeDefault && $type == 'Standard') echo 'checked="checked"'; else echo ($soundcloudIsGoldPlayerType === $type) ? 'checked="checked"' : '' ?> /><label for="<?php echo $type ?>"><?php echo $type; if($type == 'Artwork') echo ' <small>(not available on free soundcloud account)</small>'; if($type == 'html5') echo ' <small>new! (beta)</small>' ?></label></li>
200
  <?php endforeach; ?>
201
  </ul>
202
  </li>
203
+ <!-- Width -->
204
+ <li class="soundcloudMMBox"><label class="optionLabel">Default Width</label>
205
  <ul id="soundcloudMMWidthSetting" class="subSettings texts">
206
  <li>
207
+ <input name="soundcloud_is_gold_options[soundcloud_is_gold_width_settings][type]" <?php echo ($soundcloudIsGoldWidthSettings['type'] == "wp") ? 'checked="checked"' : ''; ?> id="soundcloudMMWpWidth" value="wp" type="radio" class="soundcloudMMWpWidth soundcloudMMWidthType radio"/><label for="soundcloudMMWpWidth">Media Width</label>
208
+ <select class="soundcloudMMInput soundcloudMMWidth" name="soundcloud_is_gold_options[soundcloud_is_gold_width_settings][wp]">
209
  <?php foreach(get_soundcloud_is_gold_wordpress_sizes() as $key => $soundcloudIsGoldMediaSize) : ?>
210
  <?php
211
  //First Time, then Other Times
216
  </select>
217
  </li>
218
  <li>
219
+ <input name="soundcloud_is_gold_options[soundcloud_is_gold_width_settings][type]" <?php echo ($soundcloudIsGoldWidthSettings['type'] == "custom") ? 'checked="checked"' : ''; ?> id="soundcloudMMCustomWidth" value="custom" type="radio" class="soundcloudMMCustomWidth soundcloudMMWidthType radio"/><label for="soundcloudMMCustomWidth">Custom Width</label>
220
+ <input name="soundcloud_is_gold_options[soundcloud_is_gold_width_settings][custom]" id="soundcloudMMCustomSelectedWidth" class="soundcloudMMInput soundcloudMMWidth soundcloudMMCustomSelectedWidth" type="text" name="soundcloud_is_gold_options[soundcloudMMCustomSelectedWidth]" value="<?php echo $soundcloudIsGoldWidthSettings['custom'] ?>" />
221
  </li>
222
  </ul>
223
  </li>
224
+ <!-- Color and Classes -->
225
+ <li class="soundcloudMMBox"><label class="optionLabel">Extras</label>
226
  <ul class="subSettings texts">
227
  <li>
228
  <label>Color</label>
229
  <div class="soundcloudMMColorPickerContainer" id="soundcloudMMColorPickerContainer">
230
+ <input type="text" class="soundcloudMMInput soundcloudMMColor" id="soundcloudMMColor" name="soundcloud_is_gold_options[soundcloud_is_gold_color]" value="<?php echo $soundcloudIsGoldColor ?>" style="background-color:<?php echo $soundcloudIsGoldColor ?>"/><a href="#" class="soundcloudMMBt soundcloudMMBtSmall inline blue soundcloudMMRounder soundcloudMMResetColor">reset to default</a>
231
  <div id="soundcloudMMColorPicker" class="shadow soundcloudMMColorPicker"><div id="soundcloudMMColorPickerSelect" class="soundcloudMMColorPickerSelect"></div><a id="soundcloudMMColorPickerClose" class="blue soundcloudMMBt soundcloudMMColorPickerClose">done</a></div>
232
  </div>
233
  </li>
234
  <li class="clear">
235
+ <label>Classes <small>(no commas)</small></label><input class="soundcloudMMInput soundcloudMMClasses" type="text" name="soundcloud_is_gold_options[soundcloud_is_gold_classes]" value="<?php echo $soundcloudIsGoldClasses ?>" />
236
  </li>
237
  </ul>
238
  </li>
239
+ <!-- Advance Options -->
240
+ <!-- <li class="hidden soundcloudMMBox"><label class="optionLabel">Advanced Options</label>
241
+ <?php //soundcloud_is_gold_advanced_options() ?>
242
+ </li> -->
243
+ <!-- Preview -->
244
+ <li class="soundcloudMMBox"><label class="optionLabel previewLabel">Live Preview <small>(your latest track)</small></label>
245
  <?php if($soundcloudIsGoldApiResponse['response']) :?>
246
  <p class="soundcloudMMEmbed soundcloudMMEmbedOptions" style="text-align:center;">
247
  <!-- Soundcloud Preview here -->
248
  </p>
249
+ <p class="soundcloudMMLoading soundcloudMMPreviewLoading" style="display:none"></p>
250
  <?php else : ?>
251
  <!-- Error getting XML -->
252
  <div class="soundcloudMMXmlError"><p><?php echo $soundcloudIsGoldApiResponse['error'] ? $soundcloudIsGoldApiResponse['error'] : "Oups! There's been a error while getting the tracks from soundcloud. Please reload the page."?></p></div>
253
  <?php endif; ?>
254
  </li>
255
  </ul>
256
+ <!-- Submit -->
257
+ <p id="soundcloudMMSubmit"><input type="submit" name="Submit" value="<?php _e('Save Your SoundCloud Settings') ?>" class="soundcloudMMBt blue"/></p>
258
+ </form>
 
259
  </div>
260
  <ul id="soundcloudMMExtras" class="lightGreyGradient">
261
+ <li><a href="http://soundcloud.com/t-m" title="TM's music on SoundCloud" class="soundcloudMMBt orangeGradient soundcloudMMRounder">TM on SoundCloud</a></li>
262
+ <li><a href="http://www.mightymess.com" title="Thomas Michalak's Website" class="soundcloudMMBt orangeGradient soundcloudMMRounder">More Mighty Mess</a></li>
263
+ <li><a href="http://wordpress.org/tags/soundcloud-is-gold?forum_id=10" title="Soundcloud is Gold Forum" class="soundcloudMMBt orangeGradient soundcloudMMRounder">Forum</a></li>
264
  <li>
265
  <form class="soundcloudMMBtForm" action="https://www.paypal.com/cgi-bin/webscr" method="post">
266
  <input type="hidden" name="cmd" value="_s-xclick">
tinymce-plugin/soundcloud-is-gold-editor_plugin.css CHANGED
@@ -1,5 +1,5 @@
1
  img.soundcloudIsGold{
2
- background: url("../soundcloud-logo-sc.png") no-repeat scroll center center #DAE8F6;
3
  border: 1px solid #7B9DA2;
4
  height: 100px;
5
  width: 99%;
1
  img.soundcloudIsGold{
2
+ background: url("../images/soundcloud-logo-sc.png") no-repeat scroll center center #DAE8F6;
3
  border: 1px solid #7B9DA2;
4
  height: 100px;
5
  width: 99%;
uninstall.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- if( !defined( 'ABSPATH') && !defined('WP_UNINSTALL_PLUGIN') ) exit();
3
-
4
- delete_option("soundcloud_is_gold_user");
5
- delete_option("soundcloud_is_gold_settings");
6
- delete_option("soundcloud_is_gold_playerType");
7
- delete_option("soundcloud_is_gold_width_settings");
8
- delete_option("soundcloud_is_gold_classes");
9
- delete_option("soundcloud_is_gold_color");
10
-
11
- ?>