From a97007a8c9aa8b7f9713db5d190917eec82ac017 Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Fri, 30 Aug 2013 22:49:35 +0100 Subject: [PATCH] Adding zeroClipboard support --- .gitignore | 7 ++ README.md | 0 index.php | 270 +++++++++++++++++++++++++++++++++++++++++++++- public/config.php | 5 + public/style.css | 20 ++++ 5 files changed, 300 insertions(+), 2 deletions(-) create mode 100644 .gitignore mode change 100644 => 100755 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6277bc3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +# Ignore everything +* + +# Except Infinity Squared +!public/ +!index.php +!.gitignore diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/index.php b/index.php index 1685691..f6b5dbb 100755 --- a/index.php +++ b/index.php @@ -1,3 +1,268 @@ +<<<<<<< HEAD + +' . yourls__( 'An error has occured :(', 'isq_translation') . ''; + +if ( $message = $url. yourls__( 'added to database', 'isq_translation') ) { + $error = '

' . yourls__( 'URL shortened successfully', 'isq_translation') . '

' . yourls__( 'View the details of your short URL below.', 'isq_translation') . '

'; + } elseif ( $message = $url. yourls__( 'already exists in database', 'isq_translation') ) { + $error = $genericerror . '

' . yourls__( 'This URL already exists in this database. This website does not allow a single URL to have multiple short links.', 'isq_translation') . '

'; + } elseif ( $message = yourls__( 'Short URL', 'isq_translation') . $url . yourls__( 'already exists in database or is reserved', 'isq_translation') ) { + $error = $genericerror . '

' . yourls__( 'This short URL already exists in this database or is reserved. This website does not allow a single URL to have multiple short links. It could\'ve also been reserved by the admin.', 'isq_translation') . '

'; + } elseif ( $message = yourls__( 'Missing URL input', 'isq_translation') ) { + $error = $genericerror . '

' . yourls__( 'You did not enter the URL you want to shorten or the server lost it. Please try again.', 'isq_translation') . '

'; + } elseif ( $message = yourls__( 'This URL is a short URL', 'isq_translation') ) { + $error = $genericerror . '

' . yourls__( 'You cannot shorten a short URL!', 'isq_translation') . '

'; + } +?> + + + +<?php echo $ISQtitle; ?> + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

+ +
+
+ Facebook'; } + if (!empty(ISQ::$social['twitter'])) { $ISQtwitter = ''; } + if (!empty(ISQ::$social['plus'])) { $ISQplus = '
'; } + if (!empty(ISQ::$social['linkedin'])) { $ISQlinkedin = ''; } + if (!empty(ISQ::$general['qr'])) { $ISQqr = '

' . yourls__( 'QR code', 'isq-translation' ) . '

' . yourls__( 'Share your code with external devices', 'isq-translation' ) . '

QR'; } + if (!empty(ISQ::$general['clipboard'])) { $ISQlongcopy = ''; } + if (!empty(ISQ::$general['clipboard'])) { $ISQshortcopy = ''; } + if (!empty(ISQ::$general['clipboard'])) { $ISQstatscopy = ''; } + + $output_original = yourls__( 'Original URL:', 'isq_translation'); + $output_short = yourls__( 'Short URL:', 'isq_translation'); + /* translators: This is short for statistics */ + $output_stats = yourls__( 'Stats:', 'isq_translation'); + $output_copy = yourls__( 'Click on a link and press Ctrl+C to quickly copy it.', 'isq_translation'); + $output_share_h2 = yourls__( 'Share', 'isq_translation'); + $output_share_p = yourls__( 'Share your short URL', 'isq_translation'); + + echo << +

$ISQlongcopy

+

$ISQshortcopy

+

$ISQstatscopy

+

$output_copy

+
+ + $ISQqr + +

$output_share_h2

+

$output_share_p

+ $ISQfacebook + $ISQtwitter + $ISQplus + $ISQlinkedin +RESULT; + + // Part to be executed when no form has been submitted + } else { + + $site = YOURLS_SITE; + + $site_enter = yourls__( 'Enter a new URL to shorten', 'isq_translation'); + $site_hover = yourls__( 'Hover over the labels to see more information', 'isq_translation'); + $site_long = yourls__( 'Long URL (required):', 'isq_translation'); + $site_long_hover = yourls__( 'Paste the long URL here', 'isq_translation'); + $site_keyword = yourls__( 'Custom keyword:', 'isq_translation'); + $site_keyword_hover = yourls__( 'A keyword replaces the default short string', 'isq_translation'); + $site_title = yourls__( 'Optional title:', 'isq_translation'); + $site_title_hover = yourls__( 'Optional title used when sharing a link from YOURLS', 'isq_translation'); + $site_submit = yourls__( 'Shorten', 'isq_translation'); + + echo <<$site_enter +

$site_hover

+
+

+

+

+

+
+HTML; + + } + ?> +
+ +
+

+

+ + + + + +
+ + + + + +======= +>>>>>>> 656a0c985880d87881d8ab157da0e848527f4c49 diff --git a/public/config.php b/public/config.php index 92f39d5..47c9767 100755 --- a/public/config.php +++ b/public/config.php @@ -4,7 +4,12 @@ ISQ::$general = array( 'name' => 'kwl.me', // The name of your URL shortener 'qr' => 1, // Do you want to display a QR code? +<<<<<<< HEAD + 'mobile' => 0, // Do you want to enable the mobile version? + 'clipboard' => 1 // Do you want to enable zeroClipboard? (uses flash) +======= 'mobile' => 0 // Do you want to enable the mobile version? +>>>>>>> 656a0c985880d87881d8ab157da0e848527f4c49 ); // Menu- The width of ∞² menu allows you to have about 10 links diff --git a/public/style.css b/public/style.css index ab4911c..4bf8625 100755 --- a/public/style.css +++ b/public/style.css @@ -122,6 +122,7 @@ h1 a:hover { /* Main style */ .paragraph { padding: 0 2.5% 0 2.5%; +<<<<<<< HEAD:public/style.css } h2 { @@ -129,6 +130,15 @@ h2 { margin-bottom: -8px; } +======= +} + +h2 { + color: black; + margin-bottom: -8px; +} + +>>>>>>> 656a0c985880d87881d8ab157da0e848527f4c49:public/style.css .right { width: 60%; float: right; @@ -169,6 +179,15 @@ a.bookmarklet { /* Output */ .output label { width: 30%; +<<<<<<< HEAD:public/style.css + float:left; +} + +.output input { + width: 70% +} + +======= float: left; } @@ -176,6 +195,7 @@ a.bookmarklet { width: 70% } +>>>>>>> 656a0c985880d87881d8ab157da0e848527f4c49:public/style.css .error { color: red; }