aboutsummaryrefslogtreecommitdiff
path: root/views/default
diff options
context:
space:
mode:
Diffstat (limited to 'views/default')
-rw-r--r--views/default/forms/photos/ajax_upload.php72
-rw-r--r--views/default/js/photos/uploading.php28
-rw-r--r--views/default/photos/css.php23
3 files changed, 51 insertions, 72 deletions
diff --git a/views/default/forms/photos/ajax_upload.php b/views/default/forms/photos/ajax_upload.php
index a1d13e80b..f0738994a 100644
--- a/views/default/forms/photos/ajax_upload.php
+++ b/views/default/forms/photos/ajax_upload.php
@@ -5,8 +5,6 @@
* @uses $vars['album']
*/
-elgg_extend_view('metatags', 'tidypics/js/uploader');
-
$album = $vars['album'];
$ts = time();
@@ -69,73 +67,3 @@ if ($quota) {
</li>
</ul>
</div>
-
-<script type="text/javascript">
-
-$("#uploadify").uploadify({
- 'uploader' : '<?php echo $vars['url']; ?>mod/tidypics/vendors/uploadify/uploadify.swf',
- 'script' : '<?php echo $upload_endpoint_url; ?>',
- 'scriptData' : {
- 'album_guid' : '<?php echo $album->guid; ?>',
- 'user_guid' : '<?php echo get_loggedin_userid(); ?>',
- '__elgg_token' : '<?php echo $token; ?>',
- '__elgg_ts' : '<?php echo $ts; ?>',
- 'Elgg' : '<?php echo session_id(); ?>',
- 'tidypics_token' : '<?php echo $tidypics_token; ?>',
- 'batch' : '<?php echo $batch; ?>'
- },
- 'fileDataName' : 'Image',
- 'cancelImg' : '<?php echo $vars['url']; ?>_graphics/icon_customise_remove.gif',
- 'multi' : true,
- 'auto' : false,
- 'wmode' : 'transparent',
- 'buttonImg' : " ",
- 'height' : 20,
- 'width' : 130,
- 'onEmbedFlash' : function(event) {
- $("#" + 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() {
- $("#tidypics_choose_button").addClass('tidypics_disable');
- $("#tidypics_upload_button").addClass('tidypics_disable');
- $("#tidypics_choose_button").attr("href", "javascript:void(0)");
- $("#tidypics_upload_button").attr("href", "javascript:void(0)");
-
- $("#tidypics_describe_button").removeClass('tidypics_disable');
- $.post(
- '<?php echo $upload_complete_url; ?>',
- {
- album_guid : '<?php echo $album->guid; ?>',
- __elgg_token : '<?php echo $token; ?>',
- __elgg_ts : '<?php echo $ts; ?>',
- batch : '<?php echo $batch; ?>'
- }
- );
- },
- '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');
- }
- }
-
-});
-</script>
diff --git a/views/default/js/photos/uploading.php b/views/default/js/photos/uploading.php
new file mode 100644
index 000000000..59448dd46
--- /dev/null
+++ b/views/default/js/photos/uploading.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ *
+ */
+
+$site_url = elgg_get_site_url();
+$upload_endpoint_url = "{$site_url}action/tidypics/ajax_upload/";
+$upload_complete_url = "{$site_url}action/tidypics/ajax_upload_complete/";
+
+?>
+
+elgg.provide('elgg.tidypics.uploading');
+
+elgg.tidypics.uploading.init = function() {
+ $("#uploadify").uploadify({
+ 'uploader' : '<?php echo $site_url; ?>mod/tidypics/vendors/uploadify/uploadify.swf',
+ 'script' : '<?php echo $upload_endpoint_url; ?>',
+ 'fileDataName' : 'Image',
+ 'multi' : true,
+ 'auto' : false,
+ 'wmode' : 'transparent',
+ 'buttonImg' : " ",
+ 'height' : 20,
+ 'width' : 130
+ });
+}
+
+elgg.register_hook_handler('init', 'system', elgg.tidypics.uploading.init); \ No newline at end of file
diff --git a/views/default/photos/css.php b/views/default/photos/css.php
index 4429ca0c7..3e448f27a 100644
--- a/views/default/photos/css.php
+++ b/views/default/photos/css.php
@@ -126,6 +126,29 @@
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;
+}
+
+#tidypics_flash_uploader {
+position:relative;
+z-index:100;
+}
+
<?php
return true;
?>