Skip to content

Commit

Permalink
Merge pull request #35 from wpovernight/2.0-rewrite
Browse files Browse the repository at this point in the history
2.0 rewrite
  • Loading branch information
Spreeuw authored Jul 18, 2017
2 parents 4a57492 + d7560bc commit 204ccdd
Show file tree
Hide file tree
Showing 630 changed files with 207,706 additions and 93,728 deletions.
File renamed without changes.
File renamed without changes.
57 changes: 57 additions & 0 deletions assets/css/order-styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/* Order list buttons: */
.type-shop_order .column-order_actions a.button.wpo_wcpdf img {
width: 16px;
}

.widefat .column-pdf_invoice_number {
width: 110px;
}

@media screen and (max-width: 782px) {
.wp-list-table .column-pdf_invoice_number, .wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-pdf_invoice_number:not(.check-column) {
display: none;
}
.wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-pdf_invoice_number {
padding: 3px 8px 3px 35%
}
}

#wpo_wcpdf-data-input-box h4 {
font-size: 14px;
line-height: 1.4;
margin: 1.5em 0 0 0;
}

#wpo_wcpdf-data-input-box p {
margin: 0.5em 0;
}

#wpo_wcpdf-data-input-box .form-field input {
width: auto;
}

.wcpdf-data-fields .read-only {
height:auto;
display:block;
}

.wcpdf-data-fields .editable {
height:auto;
display:none;
}

#set-invoice-date-number {
margin:15px 0px!important;
}

#edit-invoice-date-number {
margin-left:20px!important;
}

#edit-invoice-date-number {
opacity:0.5;
}
#edit-invoice-date-number:hover {
opacity:1;
cursor:pointer;
}
108 changes: 62 additions & 46 deletions css/style.css → assets/css/settings-styles.css
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,49 +1,3 @@
/* Order list buttons: */
.type-shop_order .column-order_actions a.button.wpo_wcpdf img {
width: 16px;
}

.widefat .column-pdf_invoice_number {
width: 110px;
}

@media screen and (max-width: 782px) {
.wp-list-table .column-pdf_invoice_number, .wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-pdf_invoice_number:not(.check-column) {
display: none;
}
.wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-pdf_invoice_number {
padding: 3px 8px 3px 35%
}
}

#wpo_wcpdf-data-input-box h4 {
font-size: 14px;
line-height: 1.4;
margin: 1.5em 0 0 0;
}

#wpo_wcpdf-data-input-box p {
margin: 0.5em 0;
}

#wpo_wcpdf-data-input-box .form-field input {
width: auto;
}

/* Settings page styles */
#wpo-wcpdf-settings {
margin-top: 40px;
}

.nav-tab-debug {
margin-left: 4px;
}

#img-header_logo {
max-height: 200px;
width: auto;
}

span.wpo-warning {
display: inline-block;
border: 1px solid red;
Expand Down Expand Up @@ -124,4 +78,66 @@ img.wpo-helper {
margin-bottom: -10px;
margin-top: -5px;
margin-right: 10px;
}

#img-header_logo {
max-height: 200px;
width: auto;
}

.multiple-text-input label {
min-width: 120px;
display: inline-block;
}

table.wcpdf_documents_settings_list {
width: 100%;
border-collapse: collapse;
border-spacing: 0;
background-color: white;
border-top: 2px solid black;
}
table.wcpdf_documents_settings_list tr.odd {
background-color: #EBF5FF;
}

table.wcpdf_documents_settings_list td {
padding: 5px;
}

table.wcpdf_documents_settings_list a {
text-decoration: none;
}

table.wcpdf_documents_settings_list td.settings-icon {
text-align: right;
}

table.wcpdf_documents_settings_list td.title {
font-weight: bold;
}

.wcpdf_document_settings_sections {
margin-top: 10px;
font-size: 120%;
}
.wcpdf_document_settings_sections li,
.wcpdf_document_settings_sections ul {
display: inline;
}
.wcpdf_document_settings_sections li + li:before {
content: " | ";
}
.wcpdf_document_settings_sections a.active {
text-decoration: none;
font-weight: bold;
color: black;
}

.edit-next-number {
opacity:0.5;
}
.edit-next-number:hover {
opacity:1;
cursor:pointer;
}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added assets/images/spinner.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
31 changes: 31 additions & 0 deletions assets/js/admin-script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
jQuery( function( $ ) {
$('.edit-next-number').click( function( event ) {
// enable input & show save button
$( this ).hide();
$( this ).siblings( 'input' ).prop('disabled', false);
$( this ).siblings( '.save-next-number.button').show();
});

$('.save-next-number').click( function( event ) {
$input = $( this ).siblings( 'input' );
$input.addClass('ajax-waiting');
var data = {
security: $input.data('nonce'),
action: "wpo_wcpdf_set_next_number",
store: $input.data('store'),
number: $input.val(),
};

xhr = $.ajax({
type: 'POST',
url: wpo_wcpdf_admin.ajaxurl,
data: data,
success: function( response ) {
$input.removeClass('ajax-waiting');
$input.siblings( '.edit-next-number' ).show();
$input.prop('disabled', 'disabled');
$input.siblings( '.save-next-number.button').hide();
}
});
});
});
File renamed without changes.
15 changes: 7 additions & 8 deletions js/script.js → assets/js/order-script.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jQuery(document).ready(function($) {
var order_ids=checked.join('x');

if (wpo_wcpdf_ajax.ajaxurl.indexOf("?") != -1) {
url = wpo_wcpdf_ajax.ajaxurl+'&action=generate_wpo_wcpdf&template_type='+template+'&order_ids='+order_ids+'&_wpnonce='+wpo_wcpdf_ajax.nonce;
url = wpo_wcpdf_ajax.ajaxurl+'&action=generate_wpo_wcpdf&document_type='+template+'&order_ids='+order_ids+'&_wpnonce='+wpo_wcpdf_ajax.nonce;
} else {
url = wpo_wcpdf_ajax.ajaxurl+'?action=generate_wpo_wcpdf&template_type='+template+'&order_ids='+order_ids+'&_wpnonce='+wpo_wcpdf_ajax.nonce;
url = wpo_wcpdf_ajax.ajaxurl+'?action=generate_wpo_wcpdf&document_type='+template+'&order_ids='+order_ids+'&_wpnonce='+wpo_wcpdf_ajax.nonce;
}

window.open(url,'_blank');
Expand All @@ -32,12 +32,11 @@ jQuery(document).ready(function($) {
$('#wpo_wcpdf-data-input-box').insertAfter('#woocommerce-order-data');

// enable invoice number edit if user initiated
$('#wpo_wcpdf-data-input-box label').click(function (event) {
input = $(this).attr('for');
$('#'+input).prop('disabled', false);
});
$( "#_wcpdf_invoice_number" ).on( "click", function() {
console.log( this );
$( "#set-invoice-date-number, #edit-invoice-date-number" ).click(function() {
$form = $(this).closest('.wcpdf-data-fields');
$form.find(".read-only").hide();
$form.find(".editable").show();
$form.find(':input').prop('disabled', false);
});
});

7 changes: 7 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"require": {
"php": ">=5.3.0",
"dompdf/dompdf": "*",
"phenx/php-svg-lib": "dev-master as 0.2"
}
}
Loading

0 comments on commit 204ccdd

Please sign in to comment.