Permalink
Browse files

Share link gets loading spinner - more versioning

  • Loading branch information...
1 parent f153e24 commit a7a5b259abf58e23f37e9fa676075fc4969d9a41 @tybenz tybenz committed May 9, 2012
View
@@ -1,5 +1,6 @@
.DS_Store
css/user_themes/*.css
+jqm/*/user_themes/*.css
zips/*.zip
.htaccess
build/*
View
@@ -115,6 +115,23 @@ h2{
font-size: 13px;
}
+#share .input-wrapper {
+ position: relative;
+}
+
+#share .input-wrapper .loading-text {
+ color: #000000;
+ font-size: 15px;
+ left: 13px;
+ position: absolute;
+ top: 10px;
+}
+
+#share .input-wrapper .loading-text img {
+ position: relative;
+ top: 2px;
+}
+
#welcome + .ui-dialog-buttonpane .separator{
width: 536px;
}
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
Deleted file not rendered
View
@@ -141,7 +141,13 @@
Use this link to share a copy of your theme. People can download
or edit a copy of the theme, but your version won’t be changed.
</p>
- <input type="text" value="" />
+ <div class="input-wrapper">
+ <input type="text" value="" />
+ <span class="loading-text">
+ <img src="images/ajax-load-black.gif" />
+ Loading...
+ </span>
+ </div>
<div class="buttonpane">
<div class="separator"></div>
<img src="images/target_big.png" alt=" "/>
@@ -180,7 +186,7 @@
<h3 id="importing">Importing themes <a href="#help-top" class="help-top">^ Top</a></h3>
<p>The import feature is primarily designed to make it easy to either edit a theme you've downloaded or to generate a updated version of a theme for a new release of the library. When you download a theme, be sure keep the uncompressed version of the theme CSS file because this is used in the import process. To import a theme, click the <strong>Import</strong> link and paste the entire contents of the uncompressed theme file (select all > copy > paste) into the text input in the dialog, and the system will parse the theme into an editable format for sharing and downloading.</p>
- <h3 id="Sharing">Sharing themes <a href="#help-top" class="help-top">^ Top</a></h3>
+ <h3 id="sharing">Sharing themes <a href="#help-top" class="help-top">^ Top</a></h3>
<p>To generate a theme URL that can be shared with others, click the <strong>Share</strong> link and copy the URL. Post it on Twitter and become a famous theme artist. Anyone that opens the shared URL can edit or download the theme, but theor activity won't affect your original theme. Note that due to the high volume of traffic, we can only store your theme on the server for 30 days so shared links have an expiration date. Be sure to download a copy of your theme for safekeeping.</p>
<h3 id="supported">Supported browsers <a href="#help-top" class="help-top">^ Top</a></h3>
@@ -383,7 +389,7 @@
//If the file exists we add the CSS here, if not, we leave it blank for the JS to find on load
$file_path = "jqm/" . $JQM_VERSION . "/jqm.starter.theme.css";
if( isset($style_id) ) {
- $file_path = "css/user_themes/" . $style_id . ".css";
+ $file_path = "jqm/" . $JQM_VERSION . "/user_themes/" . $style_id . ".css";
}
if( is_file($file_path) ) {
echo file_get_contents( $file_path );
File renamed without changes.
@@ -0,0 +1 @@
+This is where theme files are temporarily stored when a user "shares" a theme.
View
@@ -358,13 +358,16 @@ TR.correctNumberOfSwatches = function() {
//import default theme
$.ajax({
- url: "css/jqm.starter.theme.css",
+ url: "jqm/" + TR.version + "/jqm.starter.theme.css",
dataType: "text",
mimeType: "text/plain",
success: function( data ) {
$( "#upload textarea" ).val( data );
TR.styleBlock.text( data );
TR.correctNumberOfSwatches();
+ for ( var letter = TR.num[ "a" ]; letter < TR.num[ "c" ]; letter++ ) {
+ TR.addSwatch( true, "a" );
+ }
}
});
} else {
@@ -755,7 +758,7 @@ TR.initDialogs = function() {
$.ajax({
url: "./zip.php",
type: "POST",
- data: "theme_name=" + $( "input", this ).val() + "&file=" + encodeURIComponent(TR.styleBlock.text()),
+ data: "ver=" + TR.version + "&theme_name=" + $( "input", this ).val() + "&file=" + encodeURIComponent(TR.styleBlock.text()),
dataType: "text",
mimeType: "text/plain",
beforeSend: function() {
@@ -780,16 +783,18 @@ TR.initDialogs = function() {
$( "#share" ).dialog( "open" );
- var post_data = "file=" + TR.styleBlock.text();
+ var post_data = "ver=" + TR.version + "&file=" + TR.styleBlock.text();
$.ajax({
type: "post",
url: "share.php",
data: post_data,
beforeSend: function() {
- $( "#share" ).dialog("open" );
+ $( "#share .loading-text" ).show();
+ $( "#share" ).dialog( "open" );
},
success: function( data ) {
+ $( "#share .loading-text" ).hide();
$( "#share input" ).val( data );
}
});
View
@@ -55,7 +55,7 @@ Delorean.travelTo = function( version, importing ) {
}
Delorean.passTheme = function( version ) {
- var form = $( '<form style="display: none" action="index.php?\
+ var form = $( '<form style="display: none" action="?\
ver=' + version + '" method="post"><input name="style" value="' + encodeURI( TR.styleBlock.text() ) + '" /></form>' );
$( "body" ).append( form );
form.submit();
View
@@ -3,13 +3,13 @@
$original = $_POST["file"];
- $dir = scandir('css/user_themes');
+ $dir = scandir('jqm/' . $_POST['ver'] . '/user_themes');
$today = date('Ymd', strtotime('today'));
$last_file_num = 0;
foreach ( $dir as $file ) {
- if ( substr($file, 0, 1) !== '.' ) {
+ if ( substr($file, 0, 1) !== '.' ) {
$file_name = explode('.', $file);
- if ( isset($file_name[0]) ) {
+ if ( isset($file_name[0]) && $file != "README.md" ) {
$date = explode('-', $file_name[0]);
$file_num = $date[1];
$date = $date[0];
@@ -24,7 +24,7 @@
}
}
$new_file_id = $today . '-' . ($last_file_num + 1);
- $new_file_name = 'css/user_themes/' . $new_file_id . '.css';
+ $new_file_name = 'jqm/' . $_POST['ver'] . '/user_themes/' . $new_file_id . '.css';
$new_file = fopen($new_file_name, 'w');
fwrite($new_file, $original);
@@ -36,7 +36,7 @@ function getScriptURLDirectory() {
if($dir !== "/") {
$dir .= "/";
}
- if ($_SERVER["HTTPS"] == "on") {
+ if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
$pageURL .= "s";
}
$pageURL .= "://";
@@ -48,6 +48,6 @@ function getScriptURLDirectory() {
return $pageURL;
}
- echo getScriptURLDirectory() . 'index.php?style_id=' . $new_file_id;
+ echo getScriptURLDirectory() . '?ver=' . $_POST['ver'] . '&style_id=' . $new_file_id;
?>
View
@@ -2,6 +2,9 @@
require_once('version.php');
date_default_timezone_set('America/Los_Angeles');
+ $JQM_VERSION = $_POST["ver"];
+ $JQUERY_VERSION = $ALL_JQUERY_VERSIONS[ $JQM_VERSION ];
+
$theme_name = $_POST["theme_name"];
$uncompressed = $_POST["file"];

0 comments on commit a7a5b25

Please sign in to comment.