Theme Test Drive - Version 2.5.2

Version Description

Download this release

Release Info

Developer freediver
Plugin Icon 128x128 Theme Test Drive
Version 2.5.2
Comparing to
See all releases

Code changes from version 2.5 to 2.5.2

Files changed (6) hide show
  1. previewbubble.js +0 -137
  2. rate.png +0 -0
  3. readme.txt +8 -13
  4. screenshot-1.png +0 -0
  5. screenshot-2.png +0 -0
  6. themedrive.php +14 -22
previewbubble.js DELETED
@@ -1,137 +0,0 @@
1
- /*
2
- Preview Bubble Javascript by Juan Xavier Larrea <xavier@websnapr.com>
3
- http://www.websnapr.com
4
-
5
- ---
6
-
7
- Ingenier�a inversa por Javier P�rez <javier.perez.m@gmail.com>
8
- http://javierperez.eu
9
-
10
- ---
11
-
12
- WordPress 2+ Plugin by Andufo <info@andufo.com>
13
- http://andufo.com
14
- */
15
-
16
- if(typeof Array.prototype.push!="function") {
17
- Array.prototype.push=ArrayPush;
18
- function ArrayPush(_1) {
19
- this[this.length] = _1;
20
- }
21
- }
22
- function WSR_getElementsByClassName(node, tag_name, class_name) {
23
- if (!node)
24
- return;
25
- var nodes =(tag_name=="*" && node.all) ? node.all : node.getElementsByTagName(tag_name);
26
- var data = new Array();
27
- class_name = class_name.replace(/\-/g,"\\-");
28
- var find_class = new RegExp("(^|\\s)" + class_name + "(\\s|$)");
29
- var n;
30
- for(var i=0;i<nodes.length;i++){
31
- n = nodes[i];
32
- if(find_class.test(n.className)) {
33
- data.push(n);
34
- }
35
- }
36
- return(data);
37
- }
38
- function bindBubbles(e) {
39
- var entries = WSR_getElementsByClassName(document.getElementById("theme_preview"), "div", "theme_links");
40
- if (!entries) return;
41
- for(var i=0;i<entries.length;i++) {
42
- var nodes = entries[i].getElementsByTagName('a');
43
- for(var j=0;j<nodes.length;j++) {
44
- str = new String(nodes[j]);
45
- var myDomain = "http://"+document.domain;
46
- var flgExternal = str.search(myDomain);
47
- var flgFtp = str.search("ftp://");
48
- var flgMailto = str.search("mailto:");
49
- if( flgFtp==-1 && flgMailto==-1) {
50
- var flgNoFile = 1;
51
- if(str.substr(str.lastIndexOf(".")+1).match(/zip|exe|rar|swf|mp3|wav|mid|avi|mov|mpg|mpeg|wmv|pdf|doc|ppt|xls|jpeg|jpg|gif|png/)) flgNoFile = 0;
52
- if(flgNoFile) {
53
- if(window.addEventListener) {
54
- nodes[j].addEventListener("mouseover",attachBubble,false);
55
- nodes[j].addEventListener("mouseout",detachBubble,false);
56
- } else {
57
- nodes[j].attachEvent("onmouseover",attachBubble);
58
- nodes[j].attachEvent("onmouseout",detachBubble);
59
- }
60
- }
61
- }
62
- }
63
- }
64
- }
65
- function attachBubble(_b, url_image) {
66
- var _c;
67
- if(_b["srcElement"]) {
68
- _c=_b["srcElement"];
69
- } else {
70
- _c=_b["target"];
71
- }
72
- var _d=_c.href;
73
- var _e=findPos(_c)[0]+5;
74
- var _f=findPos(_c)[1]+17;
75
- var _10=document.createElement("div");
76
- _10.className="previewbubble";
77
- _10.setAttribute("style","text-align: left;z-index: 99999;position: absolute;top: "+_f+"px ;left: "+_e+"px ;background: url("+ bubbleImagePath +");width: 461px;height: 330px;padding-top: 40px;padding-left: 40px;padding-bottom: 0;padding-right: 0;margin: 0;");
78
- _10.style.width="441px";
79
- _10.style.position="absolute";
80
- _10.style.top=_f;
81
- _10.style.zIndex=99999;
82
- _10.style.left=_e;
83
- _10.style.textAlign="left";
84
- _10.style.height="320px";
85
- _10.style.paddingTop="55px";
86
- _10.style.paddingLeft="50px";
87
- _10.style.paddingBottom="0";
88
- _10.style.paddingRight="0";
89
- _10.style.marginTop="0";
90
- _10.style.marginLeft="0";
91
- _10.style.marginBottom="0";
92
- _10.style.marginRight="0";
93
- _10.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + bubbleImagePath + "',sizingMethod='scale')";
94
- var img=document.createElement("img");
95
- img.setAttribute("style","margin: 0;padding: 0;border: 0");
96
- img.style.paddingTop="0";
97
- img.style.paddingLeft="0";
98
- img.style.paddingBottom="0";
99
- img.style.paddingRight="0";
100
- img.style.marginTop="0";
101
- img.style.marginLeft="0";
102
- img.style.marginBottom="0";
103
- img.style.marginRight="0";
104
- img.style.borderTop="0";
105
- img.style.borderLeft="0";
106
- img.style.borderBottom="0";
107
- img.style.borderRight="0";
108
- img.setAttribute("src", url_image ? url_image :("http://images.websnapr.com/?size=m&key=42d1W6HhpB0B&url="+_d));
109
- img.setAttribute("width",400);
110
- img.setAttribute("height",300);
111
- img.setAttribute("alt","Snapshot");
112
- _10.appendChild(img);
113
- document.getElementsByTagName("body")[0].appendChild(_10);
114
- }
115
- function detachBubble(_12) {
116
- lbActions=WSR_getElementsByClassName(document,"div","previewbubble");
117
- for(i=0;i<lbActions.length;i++) {
118
- lbActions[i].parentNode.removeChild(lbActions[i]);
119
- }
120
- }
121
- if(window.addEventListener){
122
- addEventListener("load",bindBubbles,false);
123
- } else {
124
- attachEvent("onload",bindBubbles);
125
- }
126
- function findPos(obj) {
127
- var _14=curtop=0;
128
- if(obj.offsetParent) {
129
- _14=obj.offsetLeft;
130
- curtop=obj.offsetTop;
131
- while(obj=obj.offsetParent) {
132
- _14+=obj.offsetLeft;
133
- curtop+=obj.offsetTop;
134
- }
135
- }
136
- return [_14,curtop];
137
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
rate.png ADDED
Binary file
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: freediver
3
  Donate link: https://www.networkforgood.org/donation/MakeDonation.aspx?ORGID2=920155875
4
  Tags: theme, themes, admin, test
5
  Requires at least: 2.3
6
- Tested up to: 2.5.1
7
- Stable tag: 2.5
8
 
9
  Safely test drive any theme as an administrator, while visitors use the default one.
10
 
@@ -16,15 +16,16 @@ It happens completely transparent and they will not even notice you run a differ
16
 
17
  Best part is you can even set the testing theme options (if it has them) in the Admin panel while you are testing the theme.
18
 
19
- Since version 2.0 Theme Test Drive features instant theme preview using a website thumbnail service.
20
-
21
  You can also preview any theme by adding "?theme=xxx" to your blog URL. For example http://www.myblog.com/?theme=Default
22
 
23
- Changes v2.5:
 
 
 
24
  - Easy theme installation: Install your themes using a built in installer
25
  - Ability to use folder name as well as "?theme=xxx" paramter for instant preview (thanks Michael Stewart!)
26
 
27
- Changes v2.0:
28
  - Instant theme preview using a live thumbnail preview
29
  - Added ?theme=xxx to your URL's to preview the desired theme. Example http://www.myblog.com/?theme=Default
30
 
@@ -68,9 +69,7 @@ You should have received a copy of the GNU General Public License along with The
68
 
69
  == Screenshots ==
70
 
71
- 1. Instant theme preview and theme installation
72
- 2. Plugin in action
73
-
74
 
75
 
76
 
@@ -82,10 +81,6 @@ Go to Admin Panel, Design, Theme Test Drive. Select the theme you want to previe
82
 
83
  Additionally you may click on any of the instant preview links, or wait for a preview thumbnail to generate.
84
 
85
- = How does instant image preview work? =
86
-
87
- The image is fetched using a thumbnail webservice. It may need some time to generate the image so you may want to reload the page.
88
-
89
  = Can I suggest an feature for the plugin? =
90
 
91
  Of course, visit <a href="http://www.prelovac.com/vladimir/wordpress-plugins/theme-test-drive#comments">Theme Test Drive Home Page</a>
3
  Donate link: https://www.networkforgood.org/donation/MakeDonation.aspx?ORGID2=920155875
4
  Tags: theme, themes, admin, test
5
  Requires at least: 2.3
6
+ Tested up to: 2.6
7
+ Stable tag: trunk
8
 
9
  Safely test drive any theme as an administrator, while visitors use the default one.
10
 
16
 
17
  Best part is you can even set the testing theme options (if it has them) in the Admin panel while you are testing the theme.
18
 
 
 
19
  You can also preview any theme by adding "?theme=xxx" to your blog URL. For example http://www.myblog.com/?theme=Default
20
 
21
+ Changelog:
22
+ v2.5.2: removed the thumbnail preview
23
+
24
+ v2.5:
25
  - Easy theme installation: Install your themes using a built in installer
26
  - Ability to use folder name as well as "?theme=xxx" paramter for instant preview (thanks Michael Stewart!)
27
 
28
+ v2.0:
29
  - Instant theme preview using a live thumbnail preview
30
  - Added ?theme=xxx to your URL's to preview the desired theme. Example http://www.myblog.com/?theme=Default
31
 
69
 
70
  == Screenshots ==
71
 
72
+ 1. Admin panel for installing and previewing themes
 
 
73
 
74
 
75
 
81
 
82
  Additionally you may click on any of the instant preview links, or wait for a preview thumbnail to generate.
83
 
 
 
 
 
84
  = Can I suggest an feature for the plugin? =
85
 
86
  Of course, visit <a href="http://www.prelovac.com/vladimir/wordpress-plugins/theme-test-drive#comments">Theme Test Drive Home Page</a>
screenshot-1.png CHANGED
Binary file
screenshot-2.png DELETED
Binary file
themedrive.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Theme Test Drive
4
  Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/theme-test-drive
5
  Description: Safely test drive any theme while visitors are using the default one. Includes instant theme preview via thumbnail.
6
  Author: Vladimir Prelovac
7
- Version: 2.5
8
  Author URI: http://www.prelovac.com/vladimir/
9
 
10
  To-Do:
@@ -15,7 +15,7 @@ To-Do:
15
 
16
  // // // PLUGIN CODE // // //
17
 
18
- $themedrive_localversion="2.5";
19
 
20
  function themedrive_handle_theme($package)
21
  {
@@ -260,7 +260,7 @@ function themedrive_switcher()
260
  natcasesort($theme_names);
261
 
262
 
263
- $ts = '<br/><p><strong>Live Theme Preview</strong><br/><br/>Select a theme to preview live on the site. Only administrator will be able to see the selected theme. </strong></p> <select name="td_themes">'."\n" ;
264
  $tp = '<div id="theme_preview">
265
  <div class="theme_links"><strong>Instant Theme Preview</strong><br/><br/>Hover over the link, reload the page if needed.<br/><ul>';
266
 
@@ -283,11 +283,12 @@ function themedrive_switcher()
283
  ;
284
  }
285
  $tp.='<li><a href="'.trailingslashit(get_option('siteurl')).'?theme='.htmlspecialchars($theme_name).'">'.$theme_name.'</a></li>';
 
286
  }
287
  $ts .= ' </select>'."\n\n";
288
  $tp.='</ul></div></div>';
289
  }
290
- echo $tp;
291
 
292
  echo $ts;
293
  if (themedrive_is_enabled()) {
@@ -393,14 +394,15 @@ function themedrive_options_page()
393
  <h3 class="dbx-handle">Information</h3>
394
  <div id="dbx-content">
395
  <img src="'. trailingslashit(get_option('siteurl')). 'wp-content/plugins/theme-test-drive/home.png"><a href="http://www.prelovac.com/vladimir/wordpress-plugins/theme-test-drive"> Theme Test Drive Home</a><br /><br />
396
- <img src="'. trailingslashit(get_option('siteurl')). 'wp-content/plugins/theme-test-drive/idea.png"><a href="http://www.prelovac.com/vladimir/wordpress-plugins/theme-test-drive#comments"> Suggest a Feature</a><br /><br />
 
397
  <img src="'. trailingslashit(get_option('siteurl')). 'wp-content/plugins/theme-test-drive/more.png"><a href="http://www.prelovac.com/vladimir/wordpress-plugins"> My WordPress Plugins</a><br /><br />
398
  <br />
399
 
400
  <p align="center">
401
  <img src="'. trailingslashit(get_option('siteurl')). 'wp-content/plugins/theme-test-drive/p1.png"></p>
402
 
403
- <p> <img src="'. trailingslashit(get_option('siteurl')). 'wp-content/plugins/theme-test-drive/help.png"><a href="http://www.prelovac.com/vladimir/services"> Need a WordPress Expert?</a></p>
404
  </div>
405
  </div>
406
  </div>
@@ -447,30 +449,20 @@ _e('
447
  <input class="button" type="submit" name="theme_install" value="Install theme &raquo;" />
448
  <br><br><br>
449
  <div class="dbx-h-andle-wrapper">
450
- <h3 class="dbx-handle">Options</h3>
451
  </div>
452
  <div class="dbx-c-ontent-wrapper">
453
  <div class="dbx-content">
454
-
455
- <p>
456
- Theme Test Drive allows you to safely test any theme as an administrator, while your visitors still see the default theme.
457
- </p>
458
- <p>
459
- <strong>Usage:</strong> Select the theme you want to test drive below and press <em>Enable</em> button. Open your Blog home page. Additionally you may add "?theme=xxx" to your blog url, where xxx is the theme name you want to test.
460
  </p>
461
-
462
-
463
-
464
-
465
-
466
- <br />');
467
 
468
  themedrive_switcher();
469
 
470
 
471
  _e('
472
 
473
-
474
  <p>
475
  <strong>Disabling:</strong> If you wish to stop using Theme Test Drive, press <em>Disable</em> button.
476
  Alternatively, disabling this plug-in should also do the trick.
@@ -558,8 +550,8 @@ function themdrive_js() {
558
  echo '<script src="'.get_bloginfo('wpurl').'/wp-content/plugins/theme-test-drive/previewbubble.js" type="text/javascript"></script>';
559
  echo "\n";
560
  }
561
- add_action("admin_head","themdrive_js");
562
 
563
- // <p><img src="http://thumbnailspro.com/thumb.php?url='.trailingslashit(get_option('siteurl')).'?theme='.themedrive_get_theme().'&s=400" /><br /></p>
564
  //<p><img src="http://images.websnapr.com/?size=s&key=42d1W6HhpB0B&url='.trailingslashit(get_option('siteurl')).'?theme='.themedrive_get_theme().'" /><br /></p>
565
  ?>
4
  Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/theme-test-drive
5
  Description: Safely test drive any theme while visitors are using the default one. Includes instant theme preview via thumbnail.
6
  Author: Vladimir Prelovac
7
+ Version: 2.5.2
8
  Author URI: http://www.prelovac.com/vladimir/
9
 
10
  To-Do:
15
 
16
  // // // PLUGIN CODE // // //
17
 
18
+ $themedrive_localversion="2.5.2";
19
 
20
  function themedrive_handle_theme($package)
21
  {
260
  natcasesort($theme_names);
261
 
262
 
263
+ $ts = '<br /> <select name="td_themes">'."\n" ;
264
  $tp = '<div id="theme_preview">
265
  <div class="theme_links"><strong>Instant Theme Preview</strong><br/><br/>Hover over the link, reload the page if needed.<br/><ul>';
266
 
283
  ;
284
  }
285
  $tp.='<li><a href="'.trailingslashit(get_option('siteurl')).'?theme='.htmlspecialchars($theme_name).'">'.$theme_name.'</a></li>';
286
+
287
  }
288
  $ts .= ' </select>'."\n\n";
289
  $tp.='</ul></div></div>';
290
  }
291
+ // echo $tp;
292
 
293
  echo $ts;
294
  if (themedrive_is_enabled()) {
394
  <h3 class="dbx-handle">Information</h3>
395
  <div id="dbx-content">
396
  <img src="'. trailingslashit(get_option('siteurl')). 'wp-content/plugins/theme-test-drive/home.png"><a href="http://www.prelovac.com/vladimir/wordpress-plugins/theme-test-drive"> Theme Test Drive Home</a><br /><br />
397
+ <img src="'. trailingslashit(get_option('siteurl')). 'wp-content/plugins/theme-test-drive/help.png"><a href="http://www.prelovac.com/vladimir/wordpress-plugins/theme-test-drive#comments"> Suggest a Feature</a><br /><br />
398
+ <img src="'. trailingslashit(get_option('siteurl')). 'wp-content/plugins/theme-test-drive/rate.png"><a href="http://wordpress.org/extend/plugins/theme-test-drive/"> Rate this plugin</a><br /><br />
399
  <img src="'. trailingslashit(get_option('siteurl')). 'wp-content/plugins/theme-test-drive/more.png"><a href="http://www.prelovac.com/vladimir/wordpress-plugins"> My WordPress Plugins</a><br /><br />
400
  <br />
401
 
402
  <p align="center">
403
  <img src="'. trailingslashit(get_option('siteurl')). 'wp-content/plugins/theme-test-drive/p1.png"></p>
404
 
405
+ <p> <img src="'. trailingslashit(get_option('siteurl')). 'wp-content/plugins/theme-test-drive/idea.png"><a href="http://www.prelovac.com/vladimir/services"> Need a WordPress Expert?</a></p>
406
  </div>
407
  </div>
408
  </div>
449
  <input class="button" type="submit" name="theme_install" value="Install theme &raquo;" />
450
  <br><br><br>
451
  <div class="dbx-h-andle-wrapper">
452
+ <h3 class="dbx-handle">Usage</h3>
453
  </div>
454
  <div class="dbx-c-ontent-wrapper">
455
  <div class="dbx-content">
456
+ <p>Select a theme to preview live on the site. Only administrator will be able to see the selected theme. </p>
457
+ <p>Additionally you may add "?theme=xxx" to your blog url, where xxx is the theme name you want to test.
 
 
 
 
458
  </p>
459
+ ');
 
 
 
 
 
460
 
461
  themedrive_switcher();
462
 
463
 
464
  _e('
465
 
 
466
  <p>
467
  <strong>Disabling:</strong> If you wish to stop using Theme Test Drive, press <em>Disable</em> button.
468
  Alternatively, disabling this plug-in should also do the trick.
550
  echo '<script src="'.get_bloginfo('wpurl').'/wp-content/plugins/theme-test-drive/previewbubble.js" type="text/javascript"></script>';
551
  echo "\n";
552
  }
553
+ //add_action("admin_head","themdrive_js");
554
 
555
+ //$tp.= '<p><img src="http://thumbnailspro.com/thumb.php?url='.trailingslashit(get_option('siteurl')).'?theme='.htmlspecialchars($theme_name).'&s=400" /><br /></p>';
556
  //<p><img src="http://images.websnapr.com/?size=s&key=42d1W6HhpB0B&url='.trailingslashit(get_option('siteurl')).'?theme='.themedrive_get_theme().'" /><br /></p>
557
  ?>