Permalink
Browse files

dropbox touch each file with a permission update

  • Loading branch information...
1 parent 040ac09 commit 501e5d9e3c4f9096cbd3366f1d98dd7c26ac23dc @valendesigns committed Oct 14, 2011
Showing with 128 additions and 113 deletions.
  1. +3 −2 assets/css/style.css
  2. BIN assets/images/black_px.png
  3. BIN assets/images/header.png
  4. BIN assets/images/header_classic.png
  5. BIN assets/images/icon_add.png
  6. BIN assets/images/icon_classic.png
  7. BIN assets/images/icon_dark.png
  8. BIN assets/images/icon_delete.png
  9. BIN assets/images/icon_edit.png
  10. BIN assets/images/icon_error.png
  11. BIN assets/images/icon_header.png
  12. BIN assets/images/icon_off.png
  13. BIN assets/images/icon_on.png
  14. BIN assets/images/icon_up.png
  15. BIN assets/images/icon_up_down.png
  16. BIN assets/images/logo_classic.png
  17. BIN assets/images/logo_dark.png
  18. BIN assets/images/pre_bg.gif
  19. BIN assets/images/pre_classic_bg.gif
  20. BIN assets/images/select.png
  21. BIN assets/images/toggle_tabs.png
  22. 0 assets/js/jquery.color.picker.js
  23. +29 −15 assets/js/jquery.option.tree.js
  24. 0 classes/class.admin.php
  25. +38 −38 front-end/docs.php
  26. +1 −1 front-end/options.php
  27. +3 −1 functions/admin/background.php
  28. 0 functions/admin/category.php
  29. 0 functions/admin/checkbox.php
  30. 0 functions/admin/colorpicker.php
  31. +1 −2 functions/admin/css.php
  32. 0 functions/admin/custom-post.php
  33. 0 functions/admin/export.php
  34. 0 functions/admin/heading.php
  35. 0 functions/admin/input.php
  36. 0 functions/admin/measurement.php
  37. 0 functions/admin/page.php
  38. 0 functions/admin/post.php
  39. 0 functions/admin/radio.php
  40. 0 functions/admin/select.php
  41. +3 −4 functions/admin/slider.php
  42. 0 functions/admin/tag.php
  43. 0 functions/admin/textarea.php
  44. 0 functions/admin/textblock.php
  45. 0 functions/admin/typography.php
  46. +6 −9 functions/admin/upload.php
  47. +2 −2 functions/functions.load.php
  48. +27 −15 functions/functions.php
  49. +10 −21 functions/get-option-tree.php
  50. 0 license.txt
  51. +5 −3 readme.txt
  52. BIN screenshot-1.png
  53. BIN screenshot-2.png
  54. BIN screenshot-3.png
View
@@ -109,8 +109,9 @@ a:hover strong {
}
#save_theme_layout {
margin: 5px 10px 0 0;
- padding: 3px 3px 4px 3px;
+ padding: 5px 3px 4px 3px;
width: 140px;
+ float: left;
}
#active_theme_layout {
float: right;
@@ -649,7 +650,7 @@ a:hover strong {
padding-top: 15px;
}
#framework_wrap .select-layout,
- #framework_wrap .save-layout {
+ #framework_wrap .save-layout-wrap {
height: 34px;
float: right;
}
View
0 assets/images/black_px.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/images/header.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/images/header_classic.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/images/icon_add.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/images/icon_classic.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/images/icon_dark.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/images/icon_delete.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/images/icon_edit.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/images/icon_error.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/images/icon_header.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/images/icon_off.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/images/icon_on.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/images/icon_up.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/images/icon_up_down.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/images/logo_classic.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/images/logo_dark.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/images/pre_bg.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/images/pre_classic_bg.gif 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/images/select.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/images/toggle_tabs.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 assets/js/jquery.color.picker.js 100644 → 100755
No changes.
@@ -141,7 +141,7 @@
init: function () {
var formfield,
formID,
- btnContent = true,
+ btnContent = '',
tbframe_interval;
// On Click
$('.upload_button').live("click", function () {
@@ -160,13 +160,17 @@
var document = /(^.*\.pdf|doc|docx|ppt|pptx|odt*)/gi;
var audio = /(^.*\.mp3|m4a|ogg|wav*)/gi;
var video = /(^.*\.mp4|m4v|mov|wmv|avi|mpg|ogv|3gp|3g2*)/gi;
- if (itemurl.match(image)) {
- btnContent = '<img src="'+itemurl+'" alt="" /><a href="" class="remove">Remove Image</a>';
- } else {
- btnContent = '<div class="no_image">'+html+'<a href="" class="remove">Remove</a></div>';
+ if ( UrlExists(itemurl) ) {
+ if (itemurl.match(image)) {
+ btnContent = '<img src="'+itemurl+'" alt="" /><a href="" class="remove">Remove Image</a>';
+ } else {
+ btnContent = '<div class="no_image">'+html+'<a href="" class="remove">Remove</a></div>';
+ }
}
$('#' + formfield).val(itemurl);
- $('#' + formfield).next().next('div').slideDown().html(btnContent);
+ $('#' + formfield + '_image').remove();
+ $('#' + formfield).parent('div').append('<div class="screenshot" id="'+formfield+'_image" />');
+ $('#' + formfield + '_image').append(btnContent).slideDown();
tb_remove();
} else {
window.original_send_to_editor(html);
@@ -179,6 +183,13 @@
})
})(jQuery);
+function UrlExists(url) {
+ var http = new XMLHttpRequest();
+ http.open('HEAD', url, false);
+ http.send();
+ return http.status!=404;
+}
+
/**
*
* Inline Edit Options
@@ -369,21 +380,24 @@
img.attr('src', val);
}
// no image to change add it
- if ( val !== '' && ( typeof src == 'undefined' || src == false ) ) {
+ if ( val !== '' && ( typeof src == 'undefined' || src == false ) && UrlExists(val) ) {
btnContent = '<img src="'+val+'" alt="" /><a href="" class="remove">Remove Image</a>';
- $(this).parent().find('.screenshot').append(btnContent);
- } else if ( val == '' ) {
+ $(this).parent('div').append('<div class="screenshot" id="'+id+'_image" />');
+ $('#' + id + '_image').append(btnContent).slideDown();
+ } else if ( val == '' || ! UrlExists(val) ) {
img.remove();
btn.remove();
}
});
- // add a # to color
+ // add # to hex if missing
$('.cp_input').live('blur', function() {
- var val = $(this).val();
- var reg = /^[A-Fa-f0-9]{6}$/;
- if( reg.test( val) && val != '' ) {
- $(this).attr('value', '#'+val )
- }
+ $('.cp_input').each( function(index, domEle) {
+ var val = $(domEle).val();
+ var reg = /^[A-Fa-f0-9]{6}$/;
+ if( reg.test(val) && val != '' ) {
+ $(domEle).attr('value', '#'+val )
+ }
+ });
});
},
save_options: function (e) {
View
0 classes/class.admin.php 100644 → 100755
No changes.
View
76 front-end/docs.php 100644 → 100755
@@ -306,8 +306,7 @@
<pre><code>add_filter( 'measurement_unit_types', 'custom_unit_types' );
-function custom_unit_types()
-{
+function custom_unit_types() {
$array = array(
'in' => 'inches',
'ft' => 'feet'
@@ -322,8 +321,7 @@ function custom_unit_types()
<pre><code>add_filter( 'measurement_unit_types', 'custom_unit_types' );
-function custom_unit_types($array)
-{
+function custom_unit_types($array) {
$array['in'] = 'inches';
$array['ft'] = 'feet';
return $array;
@@ -337,48 +335,50 @@ function custom_unit_types($array)
<strong>Filter to completely change the input fields in the Slider option type</strong><br />
Added to functions.php
</p>
- <pre><code>add_filter( 'image_slider_fields', 'new_slider_fields' );
+ <pre><code>add_filter( 'image_slider_fields', 'new_slider_fields', 10, 2 );
-function new_slider_fields()
-{
- $array = array(
- array(
- 'name' => 'image',
- 'type' => 'text',
- 'label' => 'Post Image URL',
- 'class' => ''
- ),
- array(
- 'name' => 'link',
- 'type' => 'text',
- 'label' => 'Post URL',
- 'class' => ''
- ),
- array(
- 'name' => 'description',
- 'type' => 'textarea',
- 'label' => 'Post Description',
- 'class' => ''
- )
- );
- return $array;
+function new_slider_fields( $image_slider_fields, $id ) {
+ if ( $id == 'my_slider_id' ) {
+ $image_slider_fields = array(
+ array(
+ 'name' => 'image',
+ 'type' => 'text',
+ 'label' => 'Post Image URL',
+ 'class' => ''
+ ),
+ array(
+ 'name' => 'link',
+ 'type' => 'text',
+ 'label' => 'Post URL',
+ 'class' => ''
+ ),
+ array(
+ 'name' => 'description',
+ 'type' => 'textarea',
+ 'label' => 'Post Description',
+ 'class' => ''
+ )
+ );
+ }
+ return $image_slider_fields;
}</code></pre>
<p>
<strong>Filter to add a new field to the Slider option type</strong><br />
Added to functions.php
</p>
- <pre><code>add_filter( 'image_slider_fields', 'new_slider_fields' );
+ <pre><code>add_filter( 'image_slider_fields', 'new_slider_fields', 10, 2 );
-function new_slider_fields($array)
-{
- $array[] =
- array(
- 'name' => 'awesome_field',
- 'type' => 'text',
- 'label' => 'Write Something Awesome',
- 'class' => ''
- );
+function new_slider_fields( $image_slider_fields, $id ) {
+ if ( $id == 'my_slider_id' ) {
+ $image_slider_fields[] =
+ array(
+ 'name' => 'awesome_field',
+ 'type' => 'text',
+ 'label' => 'Write Something Awesome',
+ 'class' => ''
+ );
+ }
return $array;
}</code></pre>
View
@@ -19,7 +19,7 @@
<div class="top-layout-bar">
- <div class="save-layout">
+ <div class="save-layout-wrap">
<input type="text" name="options_name" value="" id="save_theme_layout" />
<input type="submit" value="<?php _e('New Layout') ?>" class="button-framework user-save-layout" name="user-save-layout" />
</div>
View
4 functions/admin/background.php 100644 → 100755
@@ -73,9 +73,10 @@ function option_tree_background( $value, $settings, $int ) { ?>
</div>
<input type="text" name="<?php echo $value->item_id; ?>[background-image]" id="<?php echo $value->item_id; ?>" value="<?php if ( isset( $settings[$value->item_id]['background-image'] ) ) { echo $settings[$value->item_id]['background-image']; } ?>" class="upload<?php if ( isset( $settings[$value->item_id]['background-image'] ) ) { echo ' has-file'; } ?>" />
<input id="upload_<?php echo $value->item_id; ?>" class="upload_button" type="button" value="Upload" rel="<?php echo $int; ?>" />
+ <?php if ( is_array( @getimagesize( $settings[$value->item_id]['background-image'] ) ) ) { ?>
<div class="screenshot" id="<?php echo $value->item_id; ?>_image">
<?php
- if ( isset( $settings[$value->item_id]['background-image'] ) && $settings[$value->item_id]['background-image'] != '' ) {
+ if ( isset( $settings[$value->item_id]['background-image'] ) && $settings[$value->item_id]['background-image'] != '' ) {
$remove = '<a href="javascript:(void);" class="remove">Remove</a>';
$image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $settings[$value->item_id]['background-image'] );
if ( $image ) {
@@ -84,6 +85,7 @@ function option_tree_background( $value, $settings, $int ) { ?>
}
?>
</div>
+ <?php } ?>
</div>
<div class="description">
<?php echo htmlspecialchars_decode( $value->item_desc ); ?>
View
0 functions/admin/category.php 100644 → 100755
No changes.
View
0 functions/admin/checkbox.php 100644 → 100755
No changes.
View
0 functions/admin/colorpicker.php 100644 → 100755
No changes.
View
3 functions/admin/css.php 100644 → 100755
@@ -11,8 +11,7 @@
*
* @return string
*/
-function option_tree_css( $value, $settings, $int )
-{
+function option_tree_css( $value, $settings, $int ) {
?>
<div class="option option-css">
<h3><?php echo htmlspecialchars_decode( $value->item_title ); ?></h3>
View
0 functions/admin/custom-post.php 100644 → 100755
No changes.
View
0 functions/admin/export.php 100644 → 100755
No changes.
View
0 functions/admin/heading.php 100644 → 100755
No changes.
View
0 functions/admin/input.php 100644 → 100755
No changes.
View
0 functions/admin/measurement.php 100644 → 100755
No changes.
View
0 functions/admin/page.php 100644 → 100755
No changes.
View
0 functions/admin/post.php 100644 → 100755
No changes.
View
0 functions/admin/radio.php 100644 → 100755
No changes.
View
0 functions/admin/select.php 100644 → 100755
No changes.
View
7 functions/admin/slider.php 100644 → 100755
@@ -51,8 +51,7 @@ function option_tree_slider( $value, $settings, $int )
*
* @return string
*/
-function option_tree_slider_view( $id, $image, $int, $count )
-{
+function option_tree_slider_view( $id, $image, $int, $count ) {
// required fileds
$requred_fields = array(
array(
@@ -92,9 +91,9 @@ function option_tree_slider_view( $id, $image, $int, $count )
);
// filter the optional fields
- $image_slider_fields = apply_filters( 'image_slider_fields', $image_slider_fields );
+ $image_slider_fields = apply_filters( 'image_slider_fields', $image_slider_fields, $id );
- // merge required & optional arrays
+ // merge required & optional arrays
$image_slider_fields = array_merge( $requred_fields, $image_slider_fields );
?>
<div id="option-tree-slider-editor_<?php echo $count; ?>" class="option-tree-slider">
View
0 functions/admin/tag.php 100644 → 100755
No changes.
View
0 functions/admin/textarea.php 100644 → 100755
No changes.
View
0 functions/admin/textblock.php 100644 → 100755
No changes.
View
0 functions/admin/typography.php 100644 → 100755
No changes.
View
15 functions/admin/upload.php 100644 → 100755
@@ -18,28 +18,25 @@ function option_tree_upload( $value, $settings, $int ) { ?>
<div class="element">
<input type="text" name="<?php echo $value->item_id; ?>" id="<?php echo $value->item_id; ?>" value="<?php if ( isset( $settings[$value->item_id] ) ) { echo $settings[$value->item_id]; } ?>" class="upload<?php if ( isset( $settings[$value->item_id] ) ) { echo ' has-file'; } ?>" />
<input id="upload_<?php echo $value->item_id; ?>" class="upload_button" type="button" value="Upload" rel="<?php echo $int; ?>" />
+ <?php if ( is_array( @getimagesize( $settings[$value->item_id] ) ) ) { ?>
<div class="screenshot" id="<?php echo $value->item_id; ?>_image">
<?php
- if ( isset( $settings[$value->item_id] ) && $settings[$value->item_id] != '' )
- {
+ if ( isset( $settings[$value->item_id] ) && $settings[$value->item_id] != '' ) {
$remove = '<a href="javascript:(void);" class="remove">Remove</a>';
$image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $settings[$value->item_id] );
- if ( $image )
- {
+ if ( $image ) {
echo '<img src="'.$settings[$value->item_id].'" alt="" />'.$remove.'';
- }
- else
- {
+ } else {
$parts = explode( "/", $settings[$value->item_id] );
- for( $i = 0; $i < sizeof($parts); ++$i )
- {
+ for( $i = 0; $i < sizeof($parts); ++$i ) {
$title = $parts[$i];
}
echo '<div class="no_image"><a href="'.$settings[$value->item_id].'">'.$title.'</a>'.$remove.'</div>';
}
}
?>
</div>
+ <?php } ?>
</div>
<div class="description">
<?php echo htmlspecialchars_decode( $value->item_desc ); ?>
@@ -9,7 +9,7 @@
*/
include( OT_PLUGIN_DIR . '/functions/functions.php' );
-if ( is_admin() && isset( $_GET['page'] ) && strpos('_'.$_GET['page'], 'option_tree') ) {
+if ( is_admin() && isset( $_GET['page'] ) && strpos( '_' . $_GET['page'], 'option_tree' ) ) {
include( OT_PLUGIN_DIR . '/functions/admin/export.php' );
include( OT_PLUGIN_DIR . '/functions/admin/heading.php' );
include( OT_PLUGIN_DIR . '/functions/admin/input.php' );
@@ -30,7 +30,7 @@
include( OT_PLUGIN_DIR . '/functions/admin/background.php' );
include( OT_PLUGIN_DIR . '/functions/admin/typography.php' );
include( OT_PLUGIN_DIR . '/functions/admin/css.php' );
-} else if ( !is_admin() ) {
+} else if ( ! is_admin() ) {
include( OT_PLUGIN_DIR . '/functions/get-option-tree.php' );
}
Oops, something went wrong.

0 comments on commit 501e5d9

Please sign in to comment.