Please enter your License Key or License ID to replace the free 360° player with a licensed version. License Key will be converted to License ID after submitting.';
+ $msg .= ' If you are already using a licensed player, entering the License Key here will make ';
+ $msg .= ' all 360° product rotations use the latest 360° player from the cloud.
';
+ echo $msg;
+ }
+
+ /**
+ * Print the Section text for shortcode options
+ */
+ public function print_section_info_advanced()
+ {
+ //$msg = 'Set default site-wide default shortcode values for embedding the 360° product rotation.';
+ $msg .= '
';
+ echo $msg;
+
+ }
+
+ /**
+ * Get the settings option array and print one of its values
+ */
+ public function licenseid_callback()
+ {
+ printf(
+ '' . 'Error communicating with server! ' . $error. '
';
+ return $msg;
+ }
+
+
+ if($response && isset($response['body']))
+ {
+ $body = $response['body'];
+ $data = explode('|',$body);
+
+ //sucess
+ if($data[0]=='ok')
+ {
+ $order_data = array();
+ $order_data['license_holder'] = $data[1];
+ $order_data['updatesend'] = $data[2];
+ $order_data['productid'] = $data[3];
+ $order_data['orderuid'] = $data[4];
+ return $order_data;
+ }
+ //error
+ else
+ {
+ return $body;
+ }
+ }
+
+ return null;
+ }
+
+}
Index: plugins/360-product-rotation/includes/yofla_3drt/themes/pure-white/styles.css
===================================================================
diff -u
--- plugins/360-product-rotation/includes/yofla_3drt/themes/pure-white/styles.css (revision 0)
+++ plugins/360-product-rotation/includes/yofla_3drt/themes/pure-white/styles.css (revision 1309)
@@ -0,0 +1,210 @@
+/**
+ * Rotate Tool Player Styles
+ *
+ * Author Matus Laco, http://www.yofla.com/3d-rotate/
+ *
+ * For player version 1.6.2 and above
+ *
+ * @updated 2015-06-01
+ * @version 2
+ *
+ */
+
+
+div.rotate-tool-instance{
+}
+
+div.rotate-tool-instance:fullscreen{
+ width: 100%;
+ height: 100%;
+}
+
+div.rotate-tool-instance:fullscreen::backdrop{
+}
+
+
+div.rotate-tool-button
+{
+ width: 25px;
+ height: 25px;
+ cursor: pointer;
+ background-repeat: no-repeat;
+ background-size: 50px 25px;
+}
+
+div.rotate-tool-button:hover
+{
+ background-position: -25px;
+}
+
+
+div.rotate-tool-button-start{
+ margin-left: 38%;
+ top: 40%;
+ width: 120px;
+ height: 60px;
+ cursor: pointer;
+ background-repeat: no-repeat;
+ background-size: 240px 60px;
+ background-image: url(button-start.png);
+}
+div.rotate-tool-button.rotate-tool-button-start:hover
+{
+ background-position: -120px;
+}
+
+
+
+div.rotate-tool-button-play{
+ left: 5px;
+ bottom: 5px;
+ background-image: url(button-play.png);
+}
+
+div.rotate-tool-button-left{
+ left: 35px;
+ bottom: 5px;
+ background-image: url(button-left.png);
+}
+
+div.rotate-tool-button-right{
+ left: 65px;
+ bottom: 5px;
+ background-image: url(button-right.png);
+}
+
+div.rotate-tool-button-up{
+ left: 95px;
+ bottom: 5px;
+ background-image: url(button-up.png);
+}
+
+div.rotate-tool-button-down{
+ left: 125px;
+ bottom: 5px;
+ background-image: url(button-down.png);
+}
+
+div.rotate-tool-button-zoom-in{
+ left: 130px;
+ bottom: 5px;
+ background-image: url(button-zoom-in.png);
+}
+
+div.rotate-tool-button-zoom-out{
+ left: 160px;
+ bottom: 5px;
+ background-image: url(button-zoom-out.png);
+}
+
+div.rotate-tool-button-fullscreen{
+ right: 5px;
+ bottom: 5px;
+ background-image: url(button-fullscreen.png);
+}
+
+div.rotate-tool-zoomslider{
+ width: 110px;
+ height: 25px;
+ left: 190px;
+ bottom: 5px;
+ background-image: url(zoomslider-bar.png);
+ background-repeat: no-repeat;
+}
+
+div.rotate-tool-zoomslider-handle{
+ width: 10px;
+ height: 25px;
+ left: 0px;
+ bottom: 0px;
+ background-image: url(zoomslider-handle.png);
+ background-repeat: no-repeat;
+ background-size: 20px 25px;
+}
+
+
+div.rotate-tool-button-toggle-rotate{
+ left: 304px;
+ bottom: 5px;
+ background-image: url(button-rotate.png);
+}
+
+div.rotate-tool-button-toggle-pan{
+ left: 333px;
+ bottom: 5px;
+ background-image: url(button-pan.png);
+}
+
+div.rotate-tool-zoomslider-handle:hover{
+ background-position: -10px;
+}
+
+div.rotate-tool-hotspot-default{
+ width: 22px;
+ height: 22px;
+ border-radius: 14px;
+ border: 2px solid white;
+ opacity: 0.75;
+ filter: Alpha(Opacity=75);
+ background-color: deepskyblue;
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAMElEQVRIx2NgGAWDAvz//3/mfwTYPWrwIDUYqDHtP+lg5qjBxBs8mtyGmcGjgCIAAG/Yc/D2udsVAAAAAElFTkSuQmCC);
+}
+
+
+div.rotate-tool-tooltip-wrapper{
+
+}
+
+/**
+ * The wrapper div for the Image Title for the Image Hotspot
+ */
+div.rotate-tool-image-hotspot-title{
+ background-color : #000000;
+ position: absolute;
+ left: 0px;
+ bottom: 0px;
+ padding : 10px;
+ opacity : 0.75;
+}
+
+/**
+ * The Title of the Image Hotspot is written inside of this div.
+ */
+div.rotate-tool-image-hotspot-title-inner{
+ font-family : sans-serif;
+ color : white;
+ font-size : 18px;
+ text-align : left;
+}
+
+@media screen and (max-width: 380px) {
+ div.rotate-tool-button-right{
+ left: 61px;
+ }
+
+ div.rotate-tool-button-zoom-in{
+ left: 91px;
+ }
+
+ div.rotate-tool-button-zoom-out{
+ left: 117px;
+ }
+
+ div.rotate-tool-zoomslider{
+ left: 145px;
+ }
+
+ div.rotate-tool-button-toggle-pan{
+ right: 5px;
+ bottom: 33px;
+ left: auto;
+ }
+
+ div.rotate-tool-button-toggle-rotate{
+ right: 5px;
+ bottom: 59px;
+ left: auto;
+ }
+}
+
+
Index: plugins/360-product-rotation/includes/yofla_3drt/themes/default/button-play.png
===================================================================
diff -u
Binary files differ
Index: plugins/360-product-rotation/images/ajax-loader.gif
===================================================================
diff -u
Binary files differ
Index: plugins/360-product-rotation/includes/yofla_3drt/templates/page_for_iframe.tpl
===================================================================
diff -u
--- plugins/360-product-rotation/includes/yofla_3drt/templates/page_for_iframe.tpl (revision 0)
+++ plugins/360-product-rotation/includes/yofla_3drt/templates/page_for_iframe.tpl (revision 1309)
@@ -0,0 +1,26 @@
+
+
+
+
+
+
{title}
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: plugins/360-product-rotation/includes/yofla_3drt/themes/pure-white/button-rotate.png
===================================================================
diff -u
Binary files differ
Index: plugins/360-product-rotation/includes/yofla_3drt/templates/iframe_tag.tpl
===================================================================
diff -u
--- plugins/360-product-rotation/includes/yofla_3drt/templates/iframe_tag.tpl (revision 0)
+++ plugins/360-product-rotation/includes/yofla_3drt/templates/iframe_tag.tpl (revision 1309)
@@ -0,0 +1,15 @@
+
+
+
\ No newline at end of file
Index: plugins/360-product-rotation/includes/yofla_3drt/themes/default-black/zoomslider-bar.png
===================================================================
diff -u
Binary files differ
Index: plugins/360-product-rotation/includes/yofla_3drt/themes/pure-white/button-fullscreen.png
===================================================================
diff -u
Binary files differ
Index: plugins/360-product-rotation/styles/add-media.css
===================================================================
diff -u
--- plugins/360-product-rotation/styles/add-media.css (revision 0)
+++ plugins/360-product-rotation/styles/add-media.css (revision 1309)
@@ -0,0 +1,120 @@
+/**
+ * Upload 360 view (add media) plugin page styles
+ */
+
+
+/**
+ * Wrapper for the elements on the page
+ */
+#yofla360_plugin_media_wrapper{
+ height: 100%;
+}
+
+/**
+ * Upload Section
+ */
+#yofla360_plugin_media_upload{
+
+}
+
+
+#upload-wrapper {
+ width: 90%;
+ background: #ddd;
+ border-radius: 10px;
+ padding: 10px;
+ margin-top: 5px;
+}
+
+#upload-wrapper input[type=file] {
+ padding: 6px;
+ background: #FFF;
+ border-radius: 5px;
+ line-height: 16px;
+ min-width: 300px;
+}
+#upload-wrapper #submit-btn {
+ border: none;
+ padding: 10px;
+ background: #61BAE4;
+ border-radius: 5px;
+ color: #FFF;
+ margin-left: 10px;
+}
+#output{
+ padding: 5px;
+ font-size: 12px;
+}
+
+/* prograss bar */
+#progressbox {
+ border: 1px solid #61BAE4;
+ padding: 1px;
+ position:relative;
+ width: 100%;
+ max-width: 365px;
+ border-radius: 3px;
+ margin-top: 5px;
+ display:none;
+ text-align:left;
+}
+
+#progressbar {
+ height:20px;
+ border-radius: 3px;
+ background-color: #0073aa;
+ width:1%;
+ color: white;
+
+}
+
+#statustxt {
+ top:3px;
+ left:50%;
+ position:absolute;
+ display:inline-block;
+ color: #FFFFFF;
+}
+
+/**
+ * List section
+ */
+#yofla360_plugin_media_list{
+
+}
+
+ul.products_list {
+ margin-left: 10px;
+}
+
+ul.products_list li{
+ list-style: disc;
+ margin-left: 10px;
+ font-size: 16px !important;
+ font-weight: bold;
+ line-height: 25px;
+}
+
+ul.products_list li.invalid{
+ list-style: square;
+ margin-left: 10px;
+ color: #444 !important;
+ font-weight: normal;
+}
+
+
+ul.products_list li span.action{
+ text-decoration: underline;
+ font-size: 13px;
+ font-weight: normal;
+ cursor: pointer;
+}
+
+
+ul.products_list li span.invalid{
+ font-size: 13px;
+ font-weight: normal;
+}
+
+
+
Index: plugins/360-product-rotation/includes/yofla_3drt/themes/pure-white/button-play.png
===================================================================
diff -u
Binary files differ
Index: plugins/360-product-rotation/includes/yofla_3drt/themes/default-white/button-down.png
===================================================================
diff -u
Binary files differ
Index: plugins/360-product-rotation/includes/yofla_3drt/themes/pure-white/button-pan.png
===================================================================
diff -u
Binary files differ
Index: plugins/360-product-rotation/includes/yofla_3drt/themes/default-black/button-up.png
===================================================================
diff -u
Binary files differ
Index: plugins/360-product-rotation/includes/yofla_3drt/themes/default/styles.css
===================================================================
diff -u
--- plugins/360-product-rotation/includes/yofla_3drt/themes/default/styles.css (revision 0)
+++ plugins/360-product-rotation/includes/yofla_3drt/themes/default/styles.css (revision 1309)
@@ -0,0 +1,202 @@
+/**
+ * Rotate Tool Player Styles
+ *
+ * Author Matus Laco, http://www.yofla.com/3d-rotate/
+ *
+ * For player version 1.6.2 and above
+ *
+ * @updated 2015-06-01
+ *
+ */
+
+div.rotate-tool-instance{
+}
+
+
+div.rotate-tool-button
+{
+ width: 22px;
+ height: 22px;
+ cursor: pointer;
+ background-repeat: no-repeat;
+ background-size: 44px 22px;
+}
+
+div.rotate-tool-button:hover
+{
+ background-position: -22px;
+}
+
+div.rotate-tool-button-start{
+ margin-left: 38%;
+ top: 40%;
+ width: 120px;
+ height: 60px;
+ cursor: pointer;
+ background-repeat: no-repeat;
+ background-size: 240px 60px;
+ background-image: url(button-start.png);
+}
+div.rotate-tool-button.rotate-tool-button-start:hover
+{
+ background-position: -120px;
+}
+
+
+div.rotate-tool-button-play{
+ left: 5px;
+ bottom: 5px;
+ background-image: url(button-play.png);
+}
+
+div.rotate-tool-button-left{
+ left: 32px;
+ bottom: 5px;
+ background-image: url(button-left.png);
+}
+
+div.rotate-tool-button-right{
+ left: 59px;
+ bottom: 5px;
+ background-image: url(button-right.png);
+}
+
+div.rotate-tool-button-up{
+ left: 86px;
+ bottom: 5px;
+ background-image: url(button-up.png);
+}
+
+div.rotate-tool-button-down{
+ left: 113px;
+ bottom: 5px;
+ background-image: url(button-down.png);
+}
+
+div.rotate-tool-button-zoom-in{
+ left: 143px;
+ bottom: 5px;
+ background-image: url(button-zoom-in.png);
+}
+
+div.rotate-tool-button-zoom-out{
+ left: 170px;
+ bottom: 5px;
+ background-image: url(button-zoom-out.png);
+}
+
+div.rotate-tool-button-fullscreen{
+ right: 5px;
+ bottom: 5px;
+ background-image: url(button-fullscreen.png);
+}
+
+
+div.rotate-tool-button-fullscreen{
+ right: 5px;
+ bottom: 5px;
+ background-image: url(button-fullscreen.png);
+}
+
+div.rotate-tool-zoomslider{
+ width: 110px;
+ height: 22px;
+ left: 197px;
+ bottom: 5px;
+ background-image: url(zoomslider-bar.png);
+ background-repeat: no-repeat;
+}
+
+div.rotate-tool-zoomslider-handle{
+ width: 13px;
+ height: 22px;
+ left: 0px;
+ bottom: 0px;
+ background-image: url(zoomslider-handle.png);
+ background-repeat: no-repeat;
+ background-size: 26px 22px;
+}
+
+div.rotate-tool-button-toggle-rotate{
+ left: 314px;
+ bottom: 5px;
+ background-image: url(button-rotate.png);
+}
+
+div.rotate-tool-button-toggle-pan{
+ left: 341px;
+ bottom: 5px;
+ background-image: url(button-pan.png);
+}
+
+
+div.rotate-tool-zoomslider-handle:hover{
+ background-position: -13px;
+}
+
+
+div.rotate-tool-hotspot-default{
+ width: 22px;
+ height: 22px;
+ border-radius: 14px;
+ border: 2px solid white;
+ opacity: 0.75;
+ filter: Alpha(Opacity=75);
+ background-color: deepskyblue;
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAMElEQVRIx2NgGAWDAvz//3/mfwTYPWrwIDUYqDHtP+lg5qjBxBs8mtyGmcGjgCIAAG/Yc/D2udsVAAAAAElFTkSuQmCC);
+}
+
+/**
+ * The wrapper div for the Image Title for the Image Hotspot
+ */
+div.rotate-tool-image-hotspot-title{
+ background-color : #000000;
+ position: absolute;
+ left: 0px;
+ bottom: 0px;
+ padding : 10px;
+ opacity : 0.75;
+}
+
+/**
+ * The Title of the Image Hotspot is written inside of this div.
+ */
+div.rotate-tool-image-hotspot-title-inner{
+ font-family : sans-serif;
+ color : white;
+ font-size : 18px;
+ text-align : left;
+}
+
+
+
+@media screen and (max-width: 380px) {
+ div.rotate-tool-button-right{
+ left: 53px;
+ }
+
+ div.rotate-tool-button-zoom-in{
+ left: 80px;
+ }
+
+ div.rotate-tool-button-zoom-out{
+ left: 101px;
+ }
+
+ div.rotate-tool-zoomslider{
+ left: 130px;
+ }
+
+ div.rotate-tool-button-toggle-rotate{
+ right: 5px;
+ bottom: 54px;
+ left: auto;
+ }
+
+ div.rotate-tool-button-toggle-pan{
+ right: 5px;
+ bottom: 33px;
+ left: auto;
+ }
+}
+
Index: plugins/360-product-rotation/includes/yofla_3drt/themes/default-white/button-up.png
===================================================================
diff -u
Binary files differ
Index: plugins/360-product-rotation/includes/yofla_3drt/themes/default-black/button-zoom-in.png
===================================================================
diff -u
Binary files differ
Index: plugins/360-product-rotation/360-product-rotation.php
===================================================================
diff -u
--- plugins/360-product-rotation/360-product-rotation.php (revision 0)
+++ plugins/360-product-rotation/360-product-rotation.php (revision 1309)
@@ -0,0 +1,166 @@
+_errors = array();
+
+ if (in_array("woocommerce/woocommerce.php", apply_filters("active_plugins", get_option("active_plugins"))))
+ {
+ include_once YOFLA_360_PLUGIN_PATH.'includes/class-yofla360-woocommerce.php';
+ new YoFLA360Woocommerce();
+ }
+
+ //includes
+ include_once YOFLA_360_PLUGIN_PATH.'includes/class-yofla360-utils.php';
+
+ //in wordpress admin area
+ if (is_admin())
+ {
+ include_once YOFLA_360_PLUGIN_PATH.'includes/class-yofla360-activation.php';
+ include_once YOFLA_360_PLUGIN_PATH.'includes/class-yofla360-settings.php';
+ include_once YOFLA_360_PLUGIN_PATH.'includes/class-yofla360-addmedia.php';
+
+ new YoFLA360Activation();
+ new YoFLA360Settings();
+ new YoFLA360Addmedia();
+
+ $this->checkUpgrading();
+
+ }
+ //in wordpress frontend
+ else
+ {
+ include_once YOFLA_360_PLUGIN_PATH.'includes/class-yofla360-shortcodes.php';
+ include_once YOFLA_360_PLUGIN_PATH.'includes/class-yofla360-frontend.php';
+ include_once YOFLA_360_PLUGIN_PATH.'includes/class-yofla360-viewdata.php';
+
+ //init shortcodes
+ new YoFLA360Shortcodes();
+ }
+
+ //in wordpress admin or on wordpress frontend
+
+ }
+
+ private function checkUpgrading()
+ {
+ //check if upgrading...
+ if (get_option(YOFLA_360_VERSION_KEY) != YOFLA_360_VERSION_NUM) {
+ // Execute your upgrade logic here
+ // no action
+ // Update version
+ update_option(YOFLA_360_VERSION_KEY, YOFLA_360_VERSION_NUM);
+ }
+ }
+
+ /**
+ * Adds an error
+ *
+ * @param $msg
+ */
+ public function add_error($msg)
+ {
+ $this->_errors[] = $msg;
+ }
+
+
+ /**
+ * Return errors, if any
+ */
+ public function get_errors()
+ {
+ if( sizeof($this->_errors) > 0)
+ {
+ return YoFLA360()->Frontend()->format_error( implode('
'.PHP_EOL, $this->_errors) );
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+
+ /**
+ * Handle for Utils functions
+ *
+ * @return YoFLA360Frontend
+ */
+ public function Utils()
+ {
+ return YoFLA360Utils::instance();
+ }
+
+ /**
+ * Handle for Frontend functions
+ *
+ * @return YoFLA360Frontend
+ */
+ public function Frontend()
+ {
+ return YoFLA360Frontend::instance();
+ }
+}
+
+/**
+ * Returns main instance of YoFLA360 class
+ *
+ * @return YoFLA360
+ */
+function YoFLA360(){
+ return YoFLA360::instance();
+}
+
+//initialize
+YoFLA360();
+
+
Index: plugins/360-product-rotation/js/add-media.js
===================================================================
diff -u
--- plugins/360-product-rotation/js/add-media.js (revision 0)
+++ plugins/360-product-rotation/js/add-media.js (revision 1309)
@@ -0,0 +1,232 @@
+/**
+ * Javascript for managing the add 360 view media page
+ *
+ */
+
+
+/**
+ * Namespace for yofla upload related functions
+ *
+ */
+var yupload = {};
+
+//reference to jQuery
+yupload.$ = $ || jQuery;
+
+/**
+ *
+ *
+ * Based on: http://www.sanwebe.com/2012/06/ajax-file-upload-with-php-and-jquery
+ *
+ * @returns {boolean}
+ */
+yupload.beforeSubmit = function(){
+ //check whether client browser fully supports all File API
+ if (window.File && window.FileReader && window.FileList && window.Blob) {
+
+ if(!yupload.$('#FileInput')[0].files[0]){
+ yupload.$("#output").html("Please select a file!");
+ return false;
+ }
+
+ var ftype = yupload.$('#FileInput')[0].files[0].type; // get file type
+ var fsize = yupload.$('#FileInput')[0].files[0].size; //get file size
+
+ //allow file types
+ /* not working reliable... check disabled
+ switch(ftype) {
+ case 'application/x-zip-compressed':
+ case 'application/zip':
+ //all ok
+ break;
+ default:
+ yupload.$("#output").html("
"+ftype+" Unsupported file type!");
+ return false
+ }
+ */
+
+ maxAllowedUploadSize = maxAllowedUploadSize || (10*1048576); //defined variable from php script or fallback
+
+ //Allowed file size is less than 5 MB (1048576)
+ if(fsize > maxAllowedUploadSize )
+ {
+ yupload.$("#output").html("
"+bytesToSize(fsize) +" Too big file!
File is too big, it should be less than " + bytesToSize(maxAllowedUploadSize) +".");
+ return false
+ }
+
+ yupload.$('#submit-btn').hide(); //hide submit button
+ yupload.$('#loading-img').show(); //hide submit button
+ yupload.$("#output").html("");
+ }
+ else {
+ alert("Please upgrade your browser, because your current browser lacks some new features needed for this file upload!");
+ }
+};
+
+yupload.afterSuccess = function(){
+ yupload.$('#submit-btn').show(); //show submit button
+ yupload.$('#loading-img').hide(); //hide submit button
+ yupload.$('#progressbox').delay( 1000 ).fadeOut(); //hide progress bar
+ yupload.$('#statustxt').text('Upload successful.'); //update status text
+ yupload.load360ViewsList();
+};
+
+yupload.onProgress = function(event, position, total, percentComplete){
+ //Progress bar
+ yupload.$('#progressbox').show();
+ yupload.$('#progressbar').width(percentComplete + '%') //update progressbar percent complete
+ yupload.$('#statustxt').html(percentComplete + '%'); //update status text
+ if(percentComplete>50)
+ {
+ yupload.$('#statustxt').css('color','#000'); //change status text to white after 50%
+ }
+};
+
+
+yupload.initUploader = function(){
+ var options = {
+ target: '#output', // target element(s) to be updated with server response
+ beforeSubmit: yupload.beforeSubmit, // pre-submit callback
+ success: yupload.afterSuccess, // post-submit callback
+ uploadProgress: yupload.onProgress, //upload progress callback
+ resetForm: true // reset the form after successful submit
+ };
+
+ yupload.$('#MyUploadForm').submit(function() {
+ yupload.$(this).ajaxSubmit(options);
+ return false;
+ });
+
+ yupload.$('#FileInput').on("change", function(){
+ yupload.$('#MyUploadForm').ajaxSubmit(options);
+ });
+
+};
+
+
+/**
+ * Listeners lists the files in the 360 folder
+ */
+yupload.load360ViewsList = function(){
+
+ yupload.$('ul.products_list').text('Loading...');
+
+ var rnd = Math.round(Math.random()*1000);
+
+ var utilsUrl = yofla360PluginUrl + "includes/ajax-controller.php?action=y360list&rnd="+rnd ;
+
+ var jqxhr = yupload.$.ajax(utilsUrl)
+ .done(function(data) {
+ data = JSON.parse(data);
+ if( data && data.length > 0 ){
+ yupload.display360ViewsList(data);
+ yupload.addCopyEmbedCodeActions();
+ }
+ else{
+ yupload.$('ul.products_list').html('No 360° views were uploaded yet.');
+ }
+ })
+ .fail(function() {
+ yupload.$('ul.products_list').text( "Failed loading the list of 360 views!" );
+ })
+ .always(function() {
+
+ });
+};
+
+/**
+ * Renders the html code that lists the 360 views and updates the
+ * HTML of the page
+ *
+ * @param data
+ */
+yupload.display360ViewsList = function(data) {
+ var output = '', cssClass, action, name, valid, dataPath, item, invalid_text, action_text;
+
+ for(var i=0; i
0);
+ dataPath = name;
+
+ invalid_text = '(not a 360° view folder)';
+ action_text = 'embed it, trash it';
+
+ cssClass += (valid) ? 'valid' : 'invalid';
+ action += (valid) ? action_text : invalid_text;
+ output += ""+name+" "+action+"\n";
+ }
+
+ yupload.$('ul.products_list').html(output);
+}
+
+yupload.addCopyEmbedCodeActions = function(){
+ yupload.$('span.action_embed').click(function(){
+ var data = yupload.$(this).data();
+ var path = 'yofla360/'+data.path;
+
+ var text = '[360 width="100%" height="400px" src="'+path+'"]';
+
+ //copy to clipboard
+ var msg = "Copy the shortcode to clipboard and then paste into any page.\n";
+ msg += "(you can modify the width/height parameter as you like)";
+ window.prompt(msg, text);
+
+ });
+
+ yupload.$('span.action_trash').click(function(){
+ var data = yupload.$(this).data();
+ var path = data.path;
+
+ var doTrash = confirm("Move \""+path+"\" to trash?\n\nYou can recover it from trash or delete permanently using FTP.")
+ if(doTrash){
+ yupload.moveToTrash(path);
+ }
+ });
+}
+
+/**
+ * Moves 360 view folder to trash
+ *
+ * @param path
+ */
+yupload.moveToTrash = function(path){
+
+ var url = yofla360PluginUrl + "includes/ajax-controller.php?action=trash&path="+encodeURIComponent(path);
+
+ yupload.$('ul.products_list').text('Processing...');
+
+ var jqxhr = yupload.$.ajax(url)
+ .done(function(data) {
+ })
+ .fail(function() {
+ })
+ .always(function() {
+ yupload.load360ViewsList();
+ });
+}
+
+
+/**
+ * function to format bites bit.ly/19yoIPO
+ *
+ * @param bytes
+ * @returns {string}
+ */
+function bytesToSize(bytes) {
+ var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
+ if (bytes == 0) return '0 Bytes';
+ var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
+ return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i];
+}
+
+/**
+ * Entry point
+ */
+yupload.$(document).ready(function() {
+ yupload.initUploader();
+ yupload.load360ViewsList();
+});
+
Index: plugins/360-product-rotation/includes/yofla_3drt/themes/default-black/button-right.png
===================================================================
diff -u
Binary files differ