diff options
Diffstat (limited to 'views')
22 files changed, 130 insertions, 678 deletions
diff --git a/views/default/admin/settings/photos/help.php b/views/default/admin/settings/photos/help.php index c3ac2477e..1e5bdd254 100644 --- a/views/default/admin/settings/photos/help.php +++ b/views/default/admin/settings/photos/help.php @@ -6,7 +6,7 @@ elgg_load_library('elgg:markdown'); -$faq = elgg_get_plugins_path() . 'tidypics/FAQ.txt'; +$faq = elgg_get_plugins_path() . 'lightpics/FAQ.txt'; $text = Markdown(file_get_contents($faq)); $content = "<div class=\"elgg-markdown\">$text</div>"; diff --git a/views/default/admin/settings/photos/server_config.php b/views/default/admin/settings/photos/server_config.php index 8268b646a..b4fe552ec 100644 --- a/views/default/admin/settings/photos/server_config.php +++ b/views/default/admin/settings/photos/server_config.php @@ -6,7 +6,7 @@ elgg_load_library('elgg:markdown'); -$faq = elgg_get_plugins_path() . 'tidypics/CONFIG.txt'; +$faq = elgg_get_plugins_path() . 'lightpics/CONFIG.txt'; $text = Markdown(file_get_contents($faq)); $content = "<div class=\"elgg-markdown\">$text</div>"; diff --git a/views/default/forms/photos/admin/settings.php b/views/default/forms/photos/admin/settings.php index 403203f69..e0b8a9880 100644 --- a/views/default/forms/photos/admin/settings.php +++ b/views/default/forms/photos/admin/settings.php @@ -5,7 +5,7 @@ * @todo remove original image, group only upload not delete */ -$plugin = elgg_get_plugin_from_id('tidypics'); +$plugin = elgg_get_plugin_from_id('lightpics'); $title = elgg_echo('tidypics:settings:main'); $content = elgg_view('forms/photos/admin/settings/main', array('plugin' => $plugin)); diff --git a/views/default/forms/photos/admin/settings/main.php b/views/default/forms/photos/admin/settings/main.php index e893efc81..a35c9ab59 100644 --- a/views/default/forms/photos/admin/settings/main.php +++ b/views/default/forms/photos/admin/settings/main.php @@ -5,7 +5,7 @@ $plugin = $vars['plugin']; -$checkboxes = array('tagging', 'view_count', 'uploader', 'exif', 'download_link'); +$checkboxes = array('view_count', 'exif', 'download_link'); foreach ($checkboxes as $checkbox) { echo '<div>'; echo elgg_view('input/checkbox', array( @@ -26,14 +26,6 @@ echo elgg_view('input/text', array( )); echo '</div>'; -// Watermark Text -echo '<div>' . elgg_echo('tidypics:settings:watermark'); -echo elgg_view("input/text", array( - 'name' => 'params[watermark_text]', - 'value' => $plugin->watermark_text, -)); -echo '</div>'; - // Quota Size $quota = $plugin->quota; if (!$quota) { diff --git a/views/default/forms/photos/ajax_upload.php b/views/default/forms/photos/ajax_upload.php deleted file mode 100644 index 3ab578a38..000000000 --- a/views/default/forms/photos/ajax_upload.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -/** - * Tidypics ajax upload form body - * - * @uses $vars['entity'] - */ - -$album = $vars['entity']; - -$ts = time(); -$batch = time(); -$tidypics_token = md5(session_id() . get_site_secret() . $ts . elgg_get_logged_in_user_entity()->salt); -$basic_uploader_url = current_page_url() . '/basic'; - -$maxfilesize = (float) elgg_get_plugin_setting('maxfilesize', 'tidypics'); -if (!$maxfilesize) { - $maxfilesize = 5; -} - -?> - -<p> -<?php - echo elgg_echo('tidypics:uploader:instructs', array($maxfilesize, $basic_uploader_url)); -?> -</p> - -<ul id="tidypics-uploader-steps"> - <li class="mbm"> - <div id="tidypics-uploader"> - <a id="tidypics-choose-button" href="<?php echo $basic_uploader_url; ?>"> - 1. <?php echo elgg_echo('tidypics:uploader:choose'); ?> - </a> - <div id="tidypics-flash-uploader"> - <input type="file" id="uploadify" name="uploadify" class="hidden" /> - <input type="hidden" name="album_guid" value="<?php echo $album->getGUID(); ?>" /> - <input type="hidden" name="batch" value="<?php echo $batch; ?>" /> - <input type="hidden" name="tidypics_token" value="<?php echo $tidypics_token; ?>" /> - <input type="hidden" name="user_guid" value="<?php echo elgg_get_logged_in_user_guid(); ?>" /> - <input type="hidden" name="Elgg" value="<?php echo session_id(); ?>" /> - </div> - </div> - </li> - <li class="mbm"> - <a id="tidypics-upload-button" class="tidypics-disable" href="#"> - 2. <?php echo elgg_echo('tidypics:uploader:upload'); ?> - </a> - </li> - <li class="mbm"> - <a id="tidypics-describe-button" class="tidypics-disable" href="#"> - 3. <?php echo elgg_echo('tidypics:uploader:describe'); ?> - </a> - </li> -</ul> diff --git a/views/default/forms/photos/basic_upload.php b/views/default/forms/photos/basic_upload.php index ba849d1b4..9e71cf59e 100644 --- a/views/default/forms/photos/basic_upload.php +++ b/views/default/forms/photos/basic_upload.php @@ -1,48 +1,63 @@ <?php -/** - * Basic uploader form - * - * This only handled uploading the images. Editing the titles and descriptions - * are handled with the edit forms. - * - * @uses $vars['entity'] - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - $album = $vars['entity']; -$access_id = $album->access_id; +$help = elgg_echo('tidypics:uploader:help'); -$maxfilesize = (float) elgg_get_plugin_setting('maxfilesize', 'tidypics'); +$input = elgg_view('input/file', array( + 'name' => 'images[]', + 'multiple' => 'multiple', + 'class' => 'hidden-js', +)); -$instructions = elgg_echo("tidypics:uploader:upload"); -$max = elgg_echo('tidypics:uploader:basic', array($maxfilesize)); +$button = elgg_view('output/url', array( + 'text' => elgg_echo('tidypics:uploader:upload') . $input, + 'class' => 'elgg-button elgg-button-action fileinput-button', +)); -$list = ''; -for ($x = 0; $x < 10; $x++) { - $list .= '<li>' . elgg_view('input/file', array('name' => 'images[]')) . '</li>'; -} +$reset = elgg_view('input/reset', array( + 'value' => elgg_echo('cancel'), + 'class' => 'hidden', +)); $foot = elgg_view('input/hidden', array('name' => 'guid', 'value' => $album->getGUID())); $foot .= elgg_view('input/submit', array('value' => elgg_echo("save"))); -$form_body = <<<HTML +echo <<<HTML <div> $max </div> -<div> - <ol> - $list - </ol> +<div class="fileinput-container"> + $button + $reset + <p class="elgg-text-help">$help</p> +</div> +<div class="mtm"><!-- The table listing the files available for upload/download --> + <table role="presentation" class="elgg-table-alt clearfloat mtm"> + <tbody class="files"></tbody> + </table> </div> <div class='elgg-foot'> $foot </div> HTML; -echo elgg_view('input/form', array( - 'body' => $form_body, - 'action' => 'action/photos/image/upload', - 'enctype' => 'multipart/form-data', -)); +?> + +<noscript><style type="text/css">hidden-nojs {display: hidden}</style></noscript> + +<!-- The template to display files available for upload --> +<script id="template-upload" type="text/x-tmpl"> +{% for (var i=0, file; file=o.files[i]; i++) { %} + <tr class="template-upload fade"> + {% if (file.error) { %} + <td class="error"><span class="elgg-message elgg-state-error">{%=locale.fileupload.error%} {%=locale.fileupload.errors[file.error] || file.error%}</span></td> + {% } else { %} + <td class="preview"><span class="fade"></span></td> + {% } %} + <td class="name"><span>{%=file.name%}</span></td> + <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td> + + </tr> +{% } %} +</script> +<!-- The template to display files available for download --> +<script id="template-download" type="text/x-tmpl" /> diff --git a/views/default/forms/photos/image/tag.php b/views/default/forms/photos/image/tag.php deleted file mode 100644 index 31869be9e..000000000 --- a/views/default/forms/photos/image/tag.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -/** - * Tag select form body - * - * @uses $vars['entity'] - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -echo '<div class="elgg-col elgg-col-4of5">'; - -echo elgg_view('input/autocomplete', array( - 'name' => 'username', - 'match_on' => 'friends', -)); - -echo elgg_view('input/hidden', array( - 'name' => 'guid', - 'value' => $vars['entity']->getGUID(), -)); - -echo elgg_view('input/hidden', array( - 'name' => 'coordinates', -)); - -echo '</div>'; - -echo '<div class="elgg-col elgg-col-1of5 center">'; -echo elgg_view('input/submit', array( - 'value' => elgg_echo('tidypics:actiontag'), -)); -echo '</div>'; diff --git a/views/default/js/photos/tagging.php b/views/default/js/photos/tagging.php deleted file mode 100644 index f444aa44c..000000000 --- a/views/default/js/photos/tagging.php +++ /dev/null @@ -1,159 +0,0 @@ -<?php -/** - * Photo tagging JavaScript - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -?> -//<script> -elgg.provide('elgg.tidypics.tagging'); - -elgg.tidypics.tagging.init = function() { - elgg.tidypics.tagging.active = false; - $('[rel=photo-tagging]').click(elgg.tidypics.tagging.start); - - $('#tidypics-tagging-quit').click(elgg.tidypics.tagging.stop); - - $('.tidypics-tag').each(elgg.tidypics.tagging.position); - - elgg.tidypics.tagging.tag_hover = false; - elgg.tidypics.tagging.toggleTagHover(); -}; - -/** - * Start a tagging session - */ -elgg.tidypics.tagging.start = function(event) { - - if (elgg.tidypics.tagging.active) { - elgg.tidypics.tagging.stop(event); - return; - } - - $('.tidypics-photo').imgAreaSelect({ - disable : false, - hide : false, - classPrefix : 'tidypics-tagging', - onSelectEnd : elgg.tidypics.tagging.startSelect, - onSelectStart: function() { - $('#tidypics-tagging-select').hide(); - } - }); - - elgg.tidypics.tagging.toggleTagHover(); - - $('.tidypics-photo').css({"cursor" : "crosshair"}); - - $('#tidypics-tagging-help').toggle(); - - elgg.tidypics.tagging.active = true; - - event.preventDefault(); -}; - -/** - * Stop tagging - * - * A tagging session could be completed or the user could have quit. - */ -elgg.tidypics.tagging.stop = function(event) { - $('#tidypics-tagging-help').toggle(); - $('#tidypics-tagging-select').hide(); - - $('.tidypics-photo').imgAreaSelect({hide: true, disable: true}); - $('.tidypics-photo').css({"cursor" : "pointer"}); - - elgg.tidypics.tagging.active = false; - elgg.tidypics.tagging.toggleTagHover(); - - event.preventDefault(); -}; - -/** - * Start the selection stage of tagging - */ -elgg.tidypics.tagging.startSelect = function(img, selection) { - - var coords = '"x1":"' + selection.x1 + '",'; - coords += '"y1":"' + selection.y1 + '",'; - coords += '"width":"' + selection.width + '",'; - coords += '"height":"' + selection.height + '"'; - $("input[name=coordinates]").val(coords); - - $('#tidypics-tagging-select').show() - .css({ - 'top' : selection.y2 + 10, - 'left' : selection.x2 - }) - .find('input[type=text]').focus(); - -}; - -/** - * Position the tags over the image - */ -elgg.tidypics.tagging.position = function() { - var tag_left = parseInt($(this).data('x1')); - var tag_top = parseInt($(this).data('y1')); - var tag_width = parseInt($(this).data('width')); - var tag_height = parseInt($(this).data('height')); - - // add image offset - var image_pos = $('.tidypics-photo').position(); - tag_left += image_pos.left; - tag_top += image_pos.top; - - $(this).parent().css({ - left: tag_left + 'px', - top: tag_top + 'px' /* - width: tag_width + 'px', - height: tag_height + 'px' */ - }); - - $(this).css({ - width: tag_width + 'px', - height: tag_height + 'px' - }); -}; - -/** - * Toggle whether tags are shown on hover over the image - */ -elgg.tidypics.tagging.toggleTagHover = function() { - if (elgg.tidypics.tagging.tag_hover == false) { - $('.tidypics-photo').hover( - function() { - $('.tidypics-tag-wrapper').show(); - }, - function(event) { - // this check handles the tags appearing over the image - var mouseX = event.pageX; - var mouseY = event.pageY; - var offset = $('.tidypics-photo').offset(); - var width = $('.tidypics-photo').outerWidth() - 1; - var height = $('.tidypics-photo').outerHeight() - 1; - - mouseX -= offset.left; - mouseY -= offset.top; - - if (mouseX < 0 || mouseX > width || mouseY < 0 || mouseY > height) { - $('.tidypics-tag-wrapper').hide(); - } - } - ); - } else { - $('.tidypics-photo').hover( - function() { - $('.tidypics-tag-wrapper').hide(); - }, - function() { - $('.tidypics-tag-wrapper').hide(); - } - ); - } - elgg.tidypics.tagging.tag_hover = !elgg.tidypics.tagging.tag_hover; -}; - -elgg.register_hook_handler('init', 'system', elgg.tidypics.tagging.init); diff --git a/views/default/js/photos/tidypics.php b/views/default/js/photos/tidypics.php index c97a1eadb..1ff7b2c40 100644 --- a/views/default/js/photos/tidypics.php +++ b/views/default/js/photos/tidypics.php @@ -9,8 +9,20 @@ elgg.provide('elgg.tidypics'); elgg.tidypics.init = function() { - if ($(".tidypics-lightbox").length) { - $(".tidypics-lightbox").fancybox({'type': 'image'}); + if (elgg.ui.lightbox) { + $('.elgg-lightbox, .elgg-lightbox-photo').colorbox({ + href: function() { + if ((new RegExp("photos/image/[0-9]+", 'i')).test($(this).attr('href'))) { + var guid = (new RegExp("photos/image/[0-9]+", 'i')).exec($(this).attr('href')).toString().substr("photos/image/".length); + return elgg.config.wwwroot + "photos/thumbnail/" + guid + "/large"; + } else { + return $(this).attr('href'); + } + }, + title: function() { + return '<h3 style="display: inline">'+ $(this).find('img').attr('title') +'</h3> - <a href="'+ $(this).attr('href') +'">'+ elgg.echo('comments') +'</a>'; + } + }); } $("#tidypics-sort").sortable({ diff --git a/views/default/js/photos/uploading.php b/views/default/js/photos/uploading.php deleted file mode 100644 index 465f937ab..000000000 --- a/views/default/js/photos/uploading.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php -/** - * AJAX uploading - */ -?> - -//<script> -elgg.provide('elgg.tidypics.uploading'); - -elgg.tidypics.uploading.init = function() { - - var fields = ['Elgg', 'user_guid', 'album_guid', 'batch', 'tidypics_token']; - var data = elgg.security.token; - - $(fields).each(function(i, name) { - var value = $('input[name=' + name + ']').val(); - if (value) { - data[name] = value; - } - }); - - $("#uploadify").uploadify({ - 'uploader' : elgg.config.wwwroot + 'mod/tidypics/vendors/uploadify/uploadify.swf', - 'script' : elgg.config.wwwroot + 'action/photos/image/ajax_upload', - 'cancelImg' : elgg.config.wwwroot + 'mod/tidypics/vendors/uploadify/cancel.png', - 'fileDataName' : 'Image', - 'multi' : true, - 'auto' : false, - 'wmode' : 'transparent', - 'buttonImg' : " ", - 'height' : $('#tidypics-choose-button').height(), - 'width' : $('#tidypics-choose-button').width(), - 'scriptData' : data, - 'onEmbedFlash' : function(event) { - // @todo This is supposed to mimick hovering over the link. - // hover events aren't firing for the object. - $("#" + event.id).hover( - function(){ - $("#tidypics-choose-button").addClass('tidypics-choose-button-hover'); - }, - function(){ - $("#tidypics-choose-button").removeClass('tidypics-choose-button-hover'); - } - ); - }, - 'onSelectOnce' : function() { - $("#tidypics-upload-button").removeClass('tidypics-disable'); - }, - 'onAllComplete' : function() { - // @todo they can keep adding pics if they want. no need to disable this. - $("#tidypics-choose-button").addClass('tidypics-disable'); - $("#tidypics-upload-button").addClass('tidypics-disable').die(); - $("#tidypics-describe-button").removeClass('tidypics-disable'); - - elgg.action('photos/image/ajax_upload_complete', { - data: { - album_guid: data.album_guid, - batch: data.batch - }, - success: function(json) { - var url = elgg.normalize_url('photos/edit/' + json.batch_guid) - $('#tidypics-describe-button').attr('href', url); - } - }); - }, - 'onComplete' : function(event, queueID, fileObj, response) { - // check for errors here - if (response != 'success') { - $("#uploadify" + queueID + " .percentage").text(" - " + response); - $("#uploadify" + queueID).addClass('uploadifyError'); - } - $("#uploadify" + queueID + " > .cancel").remove(); - return false; - }, - 'onCancel' : function(event, queueID, fileObj, data) { - if (data.fileCount == 0) { - $("#tidypics-upload-button").addClass('tidypics-disable'); - } - }, - 'onError' : function (event, ID, fileObj, errorObj) { - // @todo do something useful with the limited information in the errorObj. - } - - }); - - // bind to upload button - $('#tidypics-upload-button').live('click', function(e) { - var $uploadify = $('#uploadify'); - $uploadify.uploadifyUpload(); - e.preventDefault(); - }); -} - -elgg.register_hook_handler('init', 'system', elgg.tidypics.uploading.init);
\ No newline at end of file diff --git a/views/default/object/image.php b/views/default/object/image.php index 2aa76d48f..fc8ea827e 100644 --- a/views/default/object/image.php +++ b/views/default/object/image.php @@ -175,26 +175,6 @@ if (get_context() == "search") { <div class="clearfloat"></div> </div> <?php - // image menu (start tagging, download, etc.) - - echo '<div id="tidypics_controls"><ul>'; - echo elgg_view('tidypics/image_menu', array( - 'image_guid' => $image_guid, - 'viewer' => $viewer, - 'owner' => $owner, - 'anytags' => $image->isPhotoTagged(), - 'album' => $album, ) ); - echo '</ul></div>'; - - // tagging code - photo tags on images, photo tag listing and hidden divs used in tagging - if (get_plugin_setting('tagging', 'tidypics') != "disabled") { - echo elgg_view('tidypics/tagging', array( - 'image' => $image, - 'viewer' => $viewer, - 'owner' => $owner, ) ); - } - - if (get_plugin_setting('exif', 'tidypics') == "enabled") { echo elgg_view('tidypics/exif', array('guid'=> $image_guid)); } diff --git a/views/default/object/image/full.php b/views/default/object/image/full.php index 175519c16..74436f500 100644 --- a/views/default/object/image/full.php +++ b/views/default/object/image/full.php @@ -13,10 +13,8 @@ $image = $photo = $vars['entity']; $img = elgg_view_entity_icon($image, 'large', array( 'href' => $image->getIconURL('master'), 'img_class' => 'tidypics-photo', - 'link_class' => 'tidypics-lightbox', + 'link_class' => 'tidypics-lightbox elgg-lightbox-photo', )); -elgg_load_js('lightbox'); -elgg_load_css('lightbox'); $owner_link = elgg_view('output/url', array( 'href' => "photos/owner/" . $photo->getOwnerEntity()->username, @@ -51,10 +49,7 @@ echo $summary; echo '<div class="tidypics-photo-wrapper center">'; echo elgg_view('object/image/navigation', $vars); -echo elgg_view('photos/tagging/help', $vars); -echo elgg_view('photos/tagging/select', $vars); echo $img; -echo elgg_view('photos/tagging/tags', $vars); echo '</div>'; if ($photo->description) { diff --git a/views/default/object/image/summary.php b/views/default/object/image/summary.php index ed8ceff38..0fa03cbe8 100644 --- a/views/default/object/image/summary.php +++ b/views/default/object/image/summary.php @@ -10,7 +10,6 @@ $image = elgg_extract('entity', $vars); -$img = elgg_view_entity_icon($image, 'small'); $header = elgg_view('output/url', array( 'text' => $image->getTitle(), @@ -19,11 +18,12 @@ $header = elgg_view('output/url', array( 'class' => 'tidypics-heading', )); -$body = elgg_view('output/url', array( - 'text' => $img, +$body = elgg_view_entity_icon($image, 'small', array( 'href' => $image->getURL(), + 'img_class' => 'tidypics-photo', 'encode_text' => false, 'is_trusted' => true, + 'link_class' => 'tidypics-lightbox elgg-lightbox-photo', )); /* diff --git a/views/default/photos/css.php b/views/default/photos/css.php index 2290e1f9a..8fd64fd0f 100644 --- a/views/default/photos/css.php +++ b/views/default/photos/css.php @@ -18,6 +18,7 @@ } .elgg-module-tidypics-image { margin: 5px auto; + height: 80%; } .tidypics-gallery-widget > li { @@ -42,6 +43,7 @@ #tidypics-sort li { width:153px; height:153px; + cursor: move; } .tidypics-river-list > li { @@ -71,161 +73,65 @@ } /* *************************************** - Tagging + UPLOADER *************************************** */ -.tidypics-tagging-border1 { - border: solid 2px white; -} - -.tidypics-tagging-border1, .tidypics-tagging-border2, -.tidypics-tagging-border3, .tidypics-tagging-border4 { - filter: alpha(opacity=50); - opacity: 0.5; -} -.tidypics-tagging-handle { - background-color: #fff; - border: solid 1px #000; - filter: alpha(opacity=50); - opacity: 0.5; -} - -.tidypics-tagging-outer { - background-color: #000; - filter: alpha(opacity=50); - opacity: 0.5; -} - -.tidypics-tagging-help { - position: absolute; - left: 50%; - top: -25px; - width: 250px; - margin-left: -125px; +.fileinput-container { text-align: center; } - -.tidypics-tagging-select { - position: absolute; - max-width: 300px; +.fileinput-button { + cursor: pointer; } - -.tidypics-tag-wrapper { - display: none; +.fileinput-button input { position: absolute; -} - -.tidypics-tag { - border: 2px solid white; - clear: both; -} - -.tidypics-tag-label { - float: left; - margin-top: 5px; - color: #666; -} - -/* *************************************** - Tagging -*************************************** */ -#tidypics_uploader { - position:relative; - width:400px; - min-height:20px; -} - -#tidypics_choose_button { - position:absolute; - top:0; - left:0; - z-index:0; - display:block; - float:left; -} + top: 0; + right: 0; + margin: 0; + opacity: 0; + filter: alpha(opacity=0); -#tidypics_flash_uploader { - position:relative; - z-index:100; } - -/* *************************************** - AJAX UPLOADER -*************************************** */ -#tidypics-uploader-steps { - list-style: none; -} - -#tidypics-uploader-steps li a { - font-weight:bold; -} - -.tidypics-choose-button-hover { - color:#0054a7; - text-decoration:underline; -} - -.tidypics-disable { - color:#cccccc; -} - -.tidypics-disable:hover { -color:#cccccc; -text-decoration:none; +.files .fade { + display: none; } - - -.uploadifyQueueItem { -background-color:#F5F5F5; -border:2px solid #E5E5E5; -font-size:11px; -margin-top:5px; -padding:10px; -width:350px; +/* Fix for IE 6: */ +*html .fileinput-button { + margin-right: -2px; } - -.uploadifyProgress { -background-color:#FFFFFF; -border-color:#808080 #C5C5C5 #C5C5C5 #808080; -border-style:solid; -border-width:1px; -margin-top:10px; -width:100%; +*html .fileinput-button .elgg-button { + line-height: 24px; } - -.uploadifyProgressBar { -background-color: #0054a7; -width: 1px; -height: 3px; +*html .fileupload-buttonbar .elgg-button { + margin-left: 3px; } -#tidypics-uploader { - position:relative; - width:400px; - min-height:20px; +/* Fix for IE 7: */ +*+html .fileinput-button { + margin-right: 1px; } - -#tidypics-choose-button { -position:absolute; -top:0; -left:0; -z-index:0; -display:block; -float:left; +*+html .fileinput-button .elgg-button { + line-height: 24px; } - -#tidypics-flash-uploader { -position:relative; -z-index:100; +*+html .fileupload-buttonbar .elgg-button { + margin-left: 3px; } -.uploadifyQueueItem .cancel { - float: right; +@media (max-width: 480px) { + .files .preview * { + width: 40px; + } + .files .name * { + width: 80px; + display: inline-block; + word-wrap: break-word; + } } -.uploadifyError { -border: 2px solid #FBCBBC; -background-color: #FDE5DD; +/* Fix for Webkit (Safari, Chrome) */ +@media screen and (-webkit-min-device-pixel-ratio:0) { + .fileinput-button { + margin-top: 2px; + } } <?php diff --git a/views/default/photos/tagging/help.php b/views/default/photos/tagging/help.php deleted file mode 100644 index a7f437e51..000000000 --- a/views/default/photos/tagging/help.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/** - * Instructions on how to peform photo tagging - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -$button = elgg_view('output/url', array( - 'text' => elgg_echo('quit'), - 'href' => '#', - 'id' => 'tidypics-tagging-quit', -)); - -$instructions = elgg_echo('tidypics:taginstruct', array($button)); -?> -<div id="tidypics-tagging-help" class="elgg-module elgg-module-popup tidypics-tagging-help pam hidden"> - <?php echo $instructions; ?> -</div> diff --git a/views/default/photos/tagging/select.php b/views/default/photos/tagging/select.php deleted file mode 100644 index 8894af63a..000000000 --- a/views/default/photos/tagging/select.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -/** - * Tag select view - * - * @uses $vars['entity'] - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -$body = elgg_view_form('photos/image/tag', array(), $vars); - -echo elgg_view_module('popup', elgg_echo('tidypics:tagthisphoto'), $body, array( - 'class' => 'tidypics-tagging-select pam hidden', - 'id' => 'tidypics-tagging-select', -)); diff --git a/views/default/photos/tagging/tag.php b/views/default/photos/tagging/tag.php deleted file mode 100644 index 6bdc0db02..000000000 --- a/views/default/photos/tagging/tag.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php -/** - * Photo tag view - * - * @uses $vars['tag'] Tag object - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -$coords = json_decode('{' . $vars['tag']->coords . '}'); - -$attributes = elgg_format_attributes(array( - 'class' => 'tidypics-tag', - 'data-x1' => $coords->x1, - 'data-y1' => $coords->y1, - 'data-width' => $coords->width, - 'data-height' => $coords->height, -)); - -if ($vars['tag']->type == 'user') { - $user = get_entity($vars['tag']->value); - $label = elgg_view('output/url', array( - 'text' => $user->name, - 'href' => $user->getURL(), - )); -} else { - $label = $vars['tag']->value; -} - -$delete = ''; -$annotation = elgg_get_annotation_from_id($vars['tag']->annotation_id); - -if ($annotation->canEdit()) { - $url = elgg_http_add_url_query_elements('action/photos/image/untag', array( - 'annotation_id' => $vars['tag']->annotation_id - )); - $delete = elgg_view('output/confirmlink', array( - 'href' => $url, - 'text' => elgg_view_icon('delete', 'float mas'), - 'confirm' => elgg_echo('tidypics:phototagging:delete:confirm') - )); -} - -echo <<<HTML -<div class="tidypics-tag-wrapper"> - <div $attributes>$delete</div> - <div class="elgg-module-popup tidypics-tag-label">$label</div> -</div> -HTML; diff --git a/views/default/photos/tagging/tags.php b/views/default/photos/tagging/tags.php deleted file mode 100644 index 29c9d0efb..000000000 --- a/views/default/photos/tagging/tags.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php -/** - * View the tags for this image - * - * @uses $vars['entity'] - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -$tags = $vars['entity']->getPhotoTags(); -foreach ($tags as $tag) { - echo elgg_view('photos/tagging/tag', array('tag' => $tag)); -} diff --git a/views/default/river/object/album/create.php b/views/default/river/object/album/create.php index c8c79f406..29620041f 100644 --- a/views/default/river/object/album/create.php +++ b/views/default/river/object/album/create.php @@ -6,6 +6,10 @@ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 */ +elgg_load_css('lightbox'); +elgg_load_js('lightbox'); +elgg_load_js('tidypics'); + $album = $vars['item']->getObjectEntity(); $album_river_view = elgg_get_plugin_setting('album_river_view', 'tidypics'); @@ -18,10 +22,12 @@ if ($album_river_view == "cover") { $images = $album->getImages(7); if (count($images)) { - $attachments = '<ul class="tidypics-river-list">'; + $attachments = '<ul class="tidypics-river-list elgg-lightbox-gallery">'; foreach($images as $image) { $attachments .= '<li class="tidypics-photo-item">'; - $attachments .= elgg_view_entity_icon($image, 'tiny'); + $attachments .= elgg_view_entity_icon($image, 'tiny', array( + 'link_class' => 'tidypics-lightbox elgg-lightbox-photo', + )); $attachments .= '</li>'; } $attachments .= '</ul>'; diff --git a/views/default/river/object/image/create.php b/views/default/river/object/image/create.php index 08cfdc550..6b68b4d68 100644 --- a/views/default/river/object/image/create.php +++ b/views/default/river/object/image/create.php @@ -6,6 +6,10 @@ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 */ +elgg_load_css('lightbox'); +elgg_load_js('lightbox'); +elgg_load_js('tidypics'); + $subject = $vars['item']->getSubjectEntity(); $subject_link = elgg_view('output/url', array( 'href' => $subject->getURL(), @@ -21,6 +25,7 @@ $image_link = elgg_view('output/url', array( 'href' => $image->getURL(), 'text' => $image->getTitle(), 'is_trusted' => true, + 'class' => 'elgg-lightbox-photo', )); $album_link = elgg_view('output/url', array( diff --git a/views/default/river/object/image/tag.php b/views/default/river/object/image/tag.php deleted file mode 100644 index 7e6f0313d..000000000 --- a/views/default/river/object/image/tag.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -$tagger = get_entity($vars['item']->subject_guid); -$tagged = get_entity($vars['item']->object_guid); -$annotation = get_annotation($vars['item']->annotation_id); -if ($annotation) { - $image = get_entity($annotation->entity_guid); - - // viewer may not have permission to view image - if (!$image) { - return; - } - - $image_title = $image->getTitle(); -} - -$tagger_link = "<a href=\"{$tagger->getURL()}\">$tagger->name</a>"; -$tagged_link = "<a href=\"{$tagged->getURL()}\">$tagged->name</a>"; -if (!empty($image_title)) { - $image_link = "<a href=\"{$image->getURL()}\">$image_title</a>"; - $string = sprintf(elgg_echo('image:river:tagged'), $tagger_link, $tagged_link, $image_link); -} else { - $string = sprintf(elgg_echo('image:river:tagged:unknown'), $tagger_link, $tagged_link); -} - -echo $string; diff --git a/views/default/river/object/tidypics_batch/create.php b/views/default/river/object/tidypics_batch/create.php index dc47284d2..b97c853a3 100644 --- a/views/default/river/object/tidypics_batch/create.php +++ b/views/default/river/object/tidypics_batch/create.php @@ -6,6 +6,10 @@ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 */ +elgg_load_css('lightbox'); +elgg_load_js('lightbox'); +elgg_load_js('tidypics'); + $batch = $vars['item']->getObjectEntity(); // Get images related to this batch @@ -38,10 +42,12 @@ $subject_link = elgg_view('output/url', array( )); if (count($images)) { - $attachments = '<ul class="tidypics-river-list">'; + $attachments = '<ul class="tidypics-river-list elgg-lightbox-gallery">'; foreach($images as $image) { $attachments .= '<li class="tidypics-photo-item">'; - $attachments .= elgg_view_entity_icon($image, 'tiny'); + $attachments .= elgg_view_entity_icon($image, 'tiny', array( + 'link_class' => 'tidypics-lightbox elgg-lightbox-photo', + )); $attachments .= '</li>'; } $attachments .= '</ul>'; |