├── .clasp.json ├── .eslintrc.js ├── .gitignore ├── LICENSE ├── PRIVACY.md ├── README.md ├── SUPPORT.md ├── TERMS.md ├── package-lock.json ├── package.json └── src ├── appsscript.json └── code.js /.clasp.json: -------------------------------------------------------------------------------- 1 | { 2 | "scriptId":"1sSNUaI91CM0x09voVAJZUijTmuEqSBjFE-r4pHPsRkq3idSrZ0k1n7_9", 3 | "rootDir": "src" 4 | } 5 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": "google", 3 | "parserOptions": { 4 | "ecmaVersion": 6, 5 | }, 6 | "rules": { 7 | "comma-dangle": "off", 8 | "no-var": "off", 9 | "generator-star-spacing": ["error", {"anonymous": "neither"}], 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | credentials/ 3 | build/ 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /PRIVACY.md: -------------------------------------------------------------------------------- 1 | # Privacy Policy 2 | 3 | Last updated: April 27, 2022 4 | 5 | This Privacy Policy describes Our policies and procedures on the collection, use and disclosure of Your information when You use the Service and tells You about Your privacy rights and how the law protects You. 6 | 7 | We use Your Personal data to provide and improve the Service. By using the Service, You agree to the collection and use of information in accordance with this Privacy Policy. This Privacy Policy has been created with the help of the [Privacy Policy Generator](https://www.termsfeed.com/privacy-policy-generator/). 8 | 9 | # Interpretation and Definitions 10 | 11 | ## Interpretation 12 | 13 | The words of which the initial letter is capitalized have meanings defined under the following conditions. The following definitions shall have the same meaning regardless of whether they appear in singular or in plural. 14 | 15 | ## Definitions 16 | 17 | For the purposes of this Privacy Policy: 18 | 19 | - __Account__ means a unique account created for You to access our Service or parts of our Service. 20 | 21 | - __Affiliate__ means an entity that controls, is controlled by or is under common control with a party, where "control" means ownership of 50% or more of the shares, equity interest or other securities entitled to vote for election of directors or other managing authority. 22 | - __Application__ means the software program provided by the Company downloaded by You on any electronic device, named Crop Sheet 23 | 24 | 25 | - __Company__ (referred to as either "the Company", "We", "Us" or "Our" in this Agreement) refers to Crop Sheet. 26 | 27 | 28 | 29 | - __Country__ refers to: New York, United States 30 | 31 | - __Device__ means any device that can access the Service such as a computer, a cellphone or a digital tablet. 32 | 33 | 34 | - __Personal Data__ is any information that relates to an identified or identifiable individual. 35 | 36 | 37 | 38 | 39 | - __Service__ refers to the Application. 40 | 41 | - __Service Provider__ means any natural or legal person who processes the data on behalf of the Company. It refers to third-party companies or individuals employed by the Company to facilitate the Service, to provide the Service on behalf of the Company, to perform services related to the Service or to assist the Company in analyzing how the Service is used. 42 | 43 | 44 | - __Usage Data__ refers to data collected automatically, either generated by the use of the Service or from the Service infrastructure itself (for example, the duration of a page visit). 45 | 46 | - __You__ means the individual accessing or using the Service, or the company, or other legal entity on behalf of which such individual is accessing or using the Service, as applicable. 47 | 48 | 49 | 50 | # Collecting and Using Your Personal Data 51 | 52 | ## Types of Data Collected 53 | 54 | ### Personal Data 55 | 56 | While using Our Service, We may ask You to provide Us with certain personally identifiable information that can be used to contact or identify You. Personally identifiable information may include, but is not limited to: 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | - Usage Data 65 | 66 | 67 | 68 | ### Usage Data 69 | 70 | Usage Data is collected automatically when using the Service. 71 | 72 | Usage Data may include information such as Your Device's Internet Protocol address (e.g. IP address), browser type, browser version, the pages of our Service that You visit, the time and date of Your visit, the time spent on those pages, unique device identifiers and other diagnostic data. 73 | 74 | When You access the Service by or through a mobile device, We may collect certain information automatically, including, but not limited to, the type of mobile device You use, Your mobile device unique ID, the IP address of Your mobile device, Your mobile operating system, the type of mobile Internet browser You use, unique device identifiers and other diagnostic data. 75 | 76 | We may also collect information that Your browser sends whenever You visit our Service or when You access the Service by or through a mobile device. 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | ## Use of Your Personal Data 87 | 88 | The Company may use Personal Data for the following purposes: 89 | 90 | - __To provide and maintain our Service__, including to monitor the usage of our Service. 91 | - __To manage Your Account:__ to manage Your registration as a user of the Service. The Personal Data You provide can give You access to different functionalities of the Service that are available to You as a registered user. 92 | - __For the performance of a contract:__ the development, compliance and undertaking of the purchase contract for the products, items or services You have purchased or of any other contract with Us through the Service. 93 | - __To contact You:__ To contact You by email, telephone calls, SMS, or other equivalent forms of electronic communication, such as a mobile application's push notifications regarding updates or informative communications related to the functionalities, products or contracted services, including the security updates, when necessary or reasonable for their implementation. 94 | - __To provide You__ with news, special offers and general information about other goods, services and events which we offer that are similar to those that you have already purchased or enquired about unless You have opted not to receive such information. 95 | - __To manage Your requests:__ To attend and manage Your requests to Us. 96 | 97 | - __For business transfers:__ We may use Your information to evaluate or conduct a merger, divestiture, restructuring, reorganization, dissolution, or other sale or transfer of some or all of Our assets, whether as a going concern or as part of bankruptcy, liquidation, or similar proceeding, in which Personal Data held by Us about our Service users is among the assets transferred. 98 | - __For other purposes__: We may use Your information for other purposes, such as data analysis, identifying usage trends, determining the effectiveness of our promotional campaigns and to evaluate and improve our Service, products, services, marketing and your experience. 99 | 100 | We may share Your personal information in the following situations: 101 | 102 | - __With Service Providers:__ We may share Your personal information with Service Providers to monitor and analyze the use of our Service, to contact You. 103 | - __For business transfers:__ We may share or transfer Your personal information in connection with, or during negotiations of, any merger, sale of Company assets, financing, or acquisition of all or a portion of Our business to another company. 104 | - __With Affiliates:__ We may share Your information with Our affiliates, in which case we will require those affiliates to honor this Privacy Policy. Affiliates include Our parent company and any other subsidiaries, joint venture partners or other companies that We control or that are under common control with Us. 105 | - __With business partners:__ We may share Your information with Our business partners to offer You certain products, services or promotions. 106 | - __With other users:__ when You share personal information or otherwise interact in the public areas with other users, such information may be viewed by all users and may be publicly distributed outside. 107 | - __With Your consent__: We may disclose Your personal information for any other purpose with Your consent. 108 | 109 | ## Retention of Your Personal Data 110 | 111 | The Company will retain Your Personal Data only for as long as is necessary for the purposes set out in this Privacy Policy. We will retain and use Your Personal Data to the extent necessary to comply with our legal obligations (for example, if we are required to retain your data to comply with applicable laws), resolve disputes, and enforce our legal agreements and policies. 112 | 113 | The Company will also retain Usage Data for internal analysis purposes. Usage Data is generally retained for a shorter period of time, except when this data is used to strengthen the security or to improve the functionality of Our Service, or We are legally obligated to retain this data for longer time periods. 114 | 115 | ## Transfer of Your Personal Data 116 | 117 | Your information, including Personal Data, is processed at the Company's operating offices and in any other places where the parties involved in the processing are located. It means that this information may be transferred to — and maintained on — computers located outside of Your state, province, country or other governmental jurisdiction where the data protection laws may differ than those from Your jurisdiction. 118 | 119 | Your consent to this Privacy Policy followed by Your submission of such information represents Your agreement to that transfer. 120 | 121 | The Company will take all steps reasonably necessary to ensure that Your data is treated securely and in accordance with this Privacy Policy and no transfer of Your Personal Data will take place to an organization or a country unless there are adequate controls in place including the security of Your data and other personal information. 122 | 123 | ## Disclosure of Your Personal Data 124 | 125 | ### Business Transactions 126 | 127 | If the Company is involved in a merger, acquisition or asset sale, Your Personal Data may be transferred. We will provide notice before Your Personal Data is transferred and becomes subject to a different Privacy Policy. 128 | 129 | ### Law enforcement 130 | 131 | Under certain circumstances, the Company may be required to disclose Your Personal Data if required to do so by law or in response to valid requests by public authorities (e.g. a court or a government agency). 132 | 133 | ### Other legal requirements 134 | 135 | The Company may disclose Your Personal Data in the good faith belief that such action is necessary to: 136 | 137 | - Comply with a legal obligation 138 | - Protect and defend the rights or property of the Company 139 | - Prevent or investigate possible wrongdoing in connection with the Service 140 | - Protect the personal safety of Users of the Service or the public 141 | - Protect against legal liability 142 | 143 | ## Security of Your Personal Data 144 | 145 | The security of Your Personal Data is important to Us, but remember that no method of transmission over the Internet, or method of electronic storage is 100% secure. While We strive to use commercially acceptable means to protect Your Personal Data, We cannot guarantee its absolute security. 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | # Children's Privacy 159 | 160 | Our Service does not address anyone under the age of 13. We do not knowingly collect personally identifiable information from anyone under the age of 13. If You are a parent or guardian and You are aware that Your child has provided Us with Personal Data, please contact Us. If We become aware that We have collected Personal Data from anyone under the age of 13 without verification of parental consent, We take steps to remove that information from Our servers. 161 | 162 | If We need to rely on consent as a legal basis for processing Your information and Your country requires consent from a parent, We may require Your parent's consent before We collect and use that information. 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | # Links to Other Websites 171 | 172 | Our Service may contain links to other websites that are not operated by Us. If You click on a third party link, You will be directed to that third party's site. We strongly advise You to review the Privacy Policy of every site You visit. 173 | 174 | We have no control over and assume no responsibility for the content, privacy policies or practices of any third party sites or services. 175 | 176 | # Changes to this Privacy Policy 177 | 178 | We may update Our Privacy Policy from time to time. We will notify You of any changes by posting the new Privacy Policy on this page. 179 | 180 | We will let You know via email and/or a prominent notice on Our Service, prior to the change becoming effective and update the "Last updated" date at the top of this Privacy Policy. 181 | 182 | You are advised to review this Privacy Policy periodically for any changes. Changes to this Privacy Policy are effective when they are posted on this page. 183 | 184 | # Contact Us 185 | 186 | If you have any questions about this Privacy Policy, You can contact us: 187 | 188 | 189 | - By email: add-ons@erickoleda.com 190 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Crop Sheet 2 | 3 | An add-on for Google Sheets that allows you to easily remove extra rows and columns. Created using Google Apps Script. Install the published version [here](https://workspace.google.com/u/0/marketplace/app/crop_sheet/42816466715). 4 | 5 | [![Link to video](https://yagisanatode.com/wp-content/uploads/2022/05/Featured-On-GWAOw-logo-with-byline.jpg)](https://youtu.be/Gja5QseHbPM/?utm_source=client&utm_medium=referral&utm_id=3-crop-sheet) 6 | -------------------------------------------------------------------------------- /SUPPORT.md: -------------------------------------------------------------------------------- 1 | # Support 2 | 3 | This add-on is supported on a best-effort basis. If you disover an issue or bug please file it on the issue tracker: 4 | 5 | https://github.com/erickoledadevrel/crop-sheet/issues 6 | 7 | Alternatively, you can email questions to: 8 | 9 | add-ons@erickoleda.com 10 | -------------------------------------------------------------------------------- /TERMS.md: -------------------------------------------------------------------------------- 1 | # Terms and Conditions 2 | 3 | Last updated: April 27, 2022 4 | 5 | Please read these terms and conditions carefully before using Our Service. 6 | 7 | # Interpretation and Definitions 8 | 9 | ## Interpretation 10 | 11 | The words of which the initial letter is capitalized have meanings defined under the following conditions. The following definitions shall have the same meaning regardless of whether they appear in singular or in plural. 12 | 13 | ## Definitions 14 | 15 | For the purposes of these Terms and Conditions: 16 | 17 | - __Application__ means the software program provided by the Company downloaded by You on any electronic device, named Crop Sheet 18 | - __Application Store__ means the digital distribution service operated and developed by Apple Inc. (Apple App Store) or Google Inc. (Google Play Store) in which the Application has been downloaded. 19 | - __Affiliate__ means an entity that controls, is controlled by or is under common control with a party, where "control" means ownership of 50% or more of the shares, equity interest or other securities entitled to vote for election of directors or other managing authority. 20 | 21 | - __Country__ refers to: New York, United States 22 | - __Company__ (referred to as either "the Company", "We", "Us" or "Our" in this Agreement) refers to Crop Sheet. 23 | 24 | - __Device__ means any device that can access the Service such as a computer, a cellphone or a digital tablet. 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | - __Service__ refers to the Application. 33 | 34 | 35 | - __Terms and Conditions__ (also referred as "Terms") mean these Terms and Conditions that form the entire agreement between You and the Company regarding the use of the Service. This Terms and Conditions agreement has been created with the help of the [Terms and Conditions Generator](https://www.termsfeed.com/terms-conditions-generator/). 36 | - __Third-party Social Media Service__ means any services or content (including data, information, products or services) provided by a third-party that may be displayed, included or made available by the Service. 37 | 38 | - __You__ means the individual accessing or using the Service, or the company, or other legal entity on behalf of which such individual is accessing or using the Service, as applicable. 39 | 40 | # Acknowledgment 41 | 42 | These are the Terms and Conditions governing the use of this Service and the agreement that operates between You and the Company. These Terms and Conditions set out the rights and obligations of all users regarding the use of the Service. 43 | 44 | Your access to and use of the Service is conditioned on Your acceptance of and compliance with these Terms and Conditions. These Terms and Conditions apply to all visitors, users and others who access or use the Service. 45 | 46 | By accessing or using the Service You agree to be bound by these Terms and Conditions. If You disagree with any part of these Terms and Conditions then You may not access the Service. 47 | 48 | 49 | You represent that you are over the age of 18. The Company does not permit those under 18 to use the Service. 50 | 51 | 52 | Your access to and use of the Service is also conditioned on Your acceptance of and compliance with the Privacy Policy of the Company. Our Privacy Policy describes Our policies and procedures on the collection, use and disclosure of Your personal information when You use the Application or the Website and tells You about Your privacy rights and how the law protects You. Please read Our Privacy Policy carefully before using Our Service. 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | # Links to Other Websites 73 | 74 | Our Service may contain links to third-party web sites or services that are not owned or controlled by the Company. 75 | 76 | The Company has no control over, and assumes no responsibility for, the content, privacy policies, or practices of any third party web sites or services. You further acknowledge and agree that the Company shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with the use of or reliance on any such content, goods or services available on or through any such web sites or services. 77 | 78 | We strongly advise You to read the terms and conditions and privacy policies of any third-party web sites or services that You visit. 79 | 80 | # Termination 81 | 82 | We may terminate or suspend Your access immediately, without prior notice or liability, for any reason whatsoever, including without limitation if You breach these Terms and Conditions. 83 | 84 | Upon termination, Your right to use the Service will cease immediately. 85 | 86 | 87 | # Limitation of Liability 88 | 89 | Notwithstanding any damages that You might incur, the entire liability of the Company and any of its suppliers under any provision of this Terms and Your exclusive remedy for all of the foregoing shall be limited to the amount actually paid by You through the Service or 100 USD if You haven't purchased anything through the Service. 90 | 91 | To the maximum extent permitted by applicable law, in no event shall the Company or its suppliers be liable for any special, incidental, indirect, or consequential damages whatsoever (including, but not limited to, damages for loss of profits, loss of data or other information, for business interruption, for personal injury, loss of privacy arising out of or in any way related to the use of or inability to use the Service, third-party software and/or third-party hardware used with the Service, or otherwise in connection with any provision of this Terms), even if the Company or any supplier has been advised of the possibility of such damages and even if the remedy fails of its essential purpose. 92 | 93 | Some states do not allow the exclusion of implied warranties or limitation of liability for incidental or consequential damages, which means that some of the above limitations may not apply. In these states, each party's liability will be limited to the greatest extent permitted by law. 94 | 95 | # "AS IS" and "AS AVAILABLE" Disclaimer 96 | 97 | The Service is provided to You "AS IS" and "AS AVAILABLE" and with all faults and defects without warranty of any kind. To the maximum extent permitted under applicable law, the Company, on its own behalf and on behalf of its Affiliates and its and their respective licensors and service providers, expressly disclaims all warranties, whether express, implied, statutory or otherwise, with respect to the Service, including all implied warranties of merchantability, fitness for a particular purpose, title and non-infringement, and warranties that may arise out of course of dealing, course of performance, usage or trade practice. Without limitation to the foregoing, the Company provides no warranty or undertaking, and makes no representation of any kind that the Service will meet Your requirements, achieve any intended results, be compatible or work with any other software, applications, systems or services, operate without interruption, meet any performance or reliability standards or be error free or that any errors or defects can or will be corrected. 98 | 99 | Without limiting the foregoing, neither the Company nor any of the company's provider makes any representation or warranty of any kind, express or implied: (i) as to the operation or availability of the Service, or the information, content, and materials or products included thereon; (ii) that the Service will be uninterrupted or error-free; (iii) as to the accuracy, reliability, or currency of any information or content provided through the Service; or (iv) that the Service, its servers, the content, or e-mails sent from or on behalf of the Company are free of viruses, scripts, trojan horses, worms, malware, timebombs or other harmful components. 100 | 101 | Some jurisdictions do not allow the exclusion of certain types of warranties or limitations on applicable statutory rights of a consumer, so some or all of the above exclusions and limitations may not apply to You. But in such a case the exclusions and limitations set forth in this section shall be applied to the greatest extent enforceable under applicable law. 102 | 103 | # Governing Law 104 | 105 | The laws of the Country, excluding its conflicts of law rules, shall govern this Terms and Your use of the Service. Your use of the Application may also be subject to other local, state, national, or international laws. 106 | 107 | # Disputes Resolution 108 | 109 | If You have any concern or dispute about the Service, You agree to first try to resolve the dispute informally by contacting the Company. 110 | 111 | 112 | # For European Union (EU) Users 113 | 114 | If You are a European Union consumer, you will benefit from any mandatory provisions of the law of the country in which you are resident in. 115 | 116 | 117 | 118 | 119 | 120 | # United States Legal Compliance 121 | 122 | You represent and warrant that (i) You are not located in a country that is subject to the United States government embargo, or that has been designated by the United States government as a "terrorist supporting" country, and (ii) You are not listed on any United States government list of prohibited or restricted parties. 123 | 124 | 125 | # Severability and Waiver 126 | 127 | ## Severability 128 | 129 | If any provision of these Terms is held to be unenforceable or invalid, such provision will be changed and interpreted to accomplish the objectives of such provision to the greatest extent possible under applicable law and the remaining provisions will continue in full force and effect. 130 | 131 | ## Waiver 132 | 133 | Except as provided herein, the failure to exercise a right or to require performance of an obligation under these Terms shall not effect a party's ability to exercise such right or require such performance at any time thereafter nor shall the waiver of a breach constitute a waiver of any subsequent breach. 134 | 135 | # Translation Interpretation 136 | 137 | These Terms and Conditions may have been translated if We have made them available to You on our Service. 138 | You agree that the original English text shall prevail in the case of a dispute. 139 | 140 | # Changes to These Terms and Conditions 141 | 142 | We reserve the right, at Our sole discretion, to modify or replace these Terms at any time. If a revision is material We will make reasonable efforts to provide at least 30 days' notice prior to any new terms taking effect. What constitutes a material change will be determined at Our sole discretion. 143 | 144 | By continuing to access or use Our Service after those revisions become effective, You agree to be bound by the revised terms. If You do not agree to the new terms, in whole or in part, please stop using the website and the Service. 145 | 146 | # Contact Us 147 | 148 | If you have any questions about these Terms and Conditions, You can contact us: 149 | 150 | 151 | - By email: add-ons@erickoleda.com 152 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "crop-sheet", 3 | "version": "1.0.0", 4 | "description": "An add-on for Google Sheets that allows you to easily remove extra rows and columns.", 5 | "main": "src/code.js", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/erickoledadevrel/crop-sheet.git" 9 | }, 10 | "keywords": [ 11 | "apps-script", 12 | "add-on", 13 | "sheets" 14 | ], 15 | "author": "Eric Koleda ", 16 | "license": "Apache-2.0", 17 | "bugs": { 18 | "url": "https://github.com/erickoledadevrel/crop-sheet/issues" 19 | }, 20 | "homepage": "https://github.com/erickoledadevrel/crop-sheet", 21 | "devDependencies": { 22 | "@google/clasp": "^1.3.0", 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/appsscript.json: -------------------------------------------------------------------------------- 1 | { 2 | "timeZone": "America/New_York", 3 | "dependencies": { 4 | }, 5 | "exceptionLogging": "STACKDRIVER", 6 | "runtimeVersion": "V8" 7 | } 8 | -------------------------------------------------------------------------------- /src/code.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Crop Sheet add-on for Google Sheets. Allows users to remove excess rows and 3 | * columns from their spreadsheet based on the current selection or the cells 4 | * that have data. 5 | * @OnlyCurrentDoc 6 | */ 7 | 8 | // ESLint config. 9 | /* exported onOpen, onInstall, cropToSelection, cropToData */ 10 | 11 | /** 12 | * Adds a menu when the spreadsheet is opened. 13 | */ 14 | function onOpen() { 15 | SpreadsheetApp.getUi().createAddonMenu() 16 | .addItem('Crop to data', 'cropToData') 17 | .addItem('Crop to selection', 'cropToSelection') 18 | .addToUi(); 19 | } 20 | 21 | /** 22 | * Adds a menu after the add-on is installed. 23 | */ 24 | function onInstall() { 25 | onOpen(); 26 | } 27 | 28 | /** 29 | * Crops the current sheet to the user's selection. 30 | */ 31 | function cropToSelection() { 32 | console.log('Cropping to selection'); 33 | var range = SpreadsheetApp.getActiveSheet().getActiveRange(); 34 | cropToRange(range); 35 | } 36 | 37 | /** 38 | * Crops the current sheet to the data. 39 | */ 40 | function cropToData() { 41 | console.log('Cropping to data'); 42 | var range = SpreadsheetApp.getActiveSheet().getDataRange(); 43 | cropToRange(range); 44 | } 45 | 46 | /** 47 | * Crops the sheet such that it only contains the given range. 48 | * @param {SpreadsheetApp.Range} range The range to crop to. 49 | */ 50 | function cropToRange(range) { 51 | var sheet = range.getSheet(); 52 | var spreadsheet = sheet.getParent(); 53 | var firstRow = range.getRow(); 54 | var lastRow = firstRow + range.getNumRows() - 1; 55 | var firstColumn = range.getColumn(); 56 | var lastColumn = firstColumn + range.getNumColumns() - 1; 57 | var maxRows = sheet.getMaxRows(); 58 | var maxColumns = sheet.getMaxColumns(); 59 | 60 | if (lastRow < maxRows) { 61 | sheet.deleteRows(lastRow + 1, maxRows - lastRow); 62 | } 63 | if (firstRow > 1) { 64 | sheet.deleteRows(1, firstRow - 1); 65 | } 66 | if (lastColumn < maxColumns) { 67 | sheet.deleteColumns(lastColumn + 1, maxColumns - lastColumn); 68 | } 69 | if (firstColumn > 1) { 70 | sheet.deleteColumns(1, firstColumn - 1); 71 | } 72 | sheet.getRange(1, 1, sheet.getMaxRows(), sheet.getMaxColumns()).activate(); 73 | } 74 | --------------------------------------------------------------------------------