From 66bfa6802a2fd2812e09f1891314905b9b22346b Mon Sep 17 00:00:00 2001 From: Vladimir Anokhin Date: Wed, 4 Dec 2013 04:13:27 +0300 Subject: [PATCH] Version 6 --- README.md | 20 +- assets/css/sunrise.css | 154 ------ assets/images/code.png | Bin 966 -> 0 bytes assets/images/success.png | Bin 634 -> 0 bytes assets/js/form.js | 815 ------------------------------- assets/js/sunrise.js | 211 -------- classes/sunrise.class.php | 324 ------------ extra-fields.png | Bin 0 -> 140635 bytes inc/options.php | 125 ----- inc/views/about.php | 9 - inc/views/checkbox-group.php | 15 - inc/views/checkbox.php | 11 - inc/views/closetab.php | 10 - inc/views/code.php | 8 - inc/views/color.php | 11 - inc/views/hidden.php | 1 - inc/views/html.php | 4 - inc/views/notifications.php | 40 -- inc/views/number.php | 7 - inc/views/opentab.php | 2 - inc/views/radio.php | 20 - inc/views/select.php | 20 - inc/views/settings.php | 26 - inc/views/size.php | 17 - inc/views/text.php | 8 - inc/views/textarea.php | 8 - inc/views/title.php | 4 - inc/views/upload.php | 11 - lang/plugin-example-lang_LANG.po | 17 - plugin-example.php | 318 +++++++++++- readme.txt | 73 --- regular-fields.png | Bin 0 -> 59505 bytes screenshot-1.png | Bin 29545 -> 0 bytes screenshot-2.png | Bin 35286 -> 0 bytes screenshot-3.png | Bin 6170 -> 0 bytes screenshot-4.png | Bin 32823 -> 0 bytes sunrise.css | 218 +++++++++ sunrise.js | 155 ++++++ sunrise.php | 595 ++++++++++++++++++++++ 39 files changed, 1265 insertions(+), 1992 deletions(-) delete mode 100644 assets/css/sunrise.css delete mode 100644 assets/images/code.png delete mode 100644 assets/images/success.png delete mode 100644 assets/js/form.js delete mode 100644 assets/js/sunrise.js delete mode 100644 classes/sunrise.class.php create mode 100644 extra-fields.png delete mode 100644 inc/options.php delete mode 100644 inc/views/about.php delete mode 100644 inc/views/checkbox-group.php delete mode 100644 inc/views/checkbox.php delete mode 100644 inc/views/closetab.php delete mode 100644 inc/views/code.php delete mode 100644 inc/views/color.php delete mode 100644 inc/views/hidden.php delete mode 100644 inc/views/html.php delete mode 100644 inc/views/notifications.php delete mode 100644 inc/views/number.php delete mode 100644 inc/views/opentab.php delete mode 100644 inc/views/radio.php delete mode 100644 inc/views/select.php delete mode 100644 inc/views/settings.php delete mode 100644 inc/views/size.php delete mode 100644 inc/views/text.php delete mode 100644 inc/views/textarea.php delete mode 100644 inc/views/title.php delete mode 100644 inc/views/upload.php delete mode 100644 lang/plugin-example-lang_LANG.po delete mode 100644 readme.txt create mode 100644 regular-fields.png delete mode 100644 screenshot-1.png delete mode 100644 screenshot-2.png delete mode 100644 screenshot-3.png delete mode 100644 screenshot-4.png create mode 100644 sunrise.css create mode 100644 sunrise.js create mode 100644 sunrise.php diff --git a/README.md b/README.md index 200b4d3..9807f38 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,11 @@ -Sunrise - WordPress Plugin Framework -==================================== +Sunrise - Options Pages Framework for WordPress Plugins and themes +------------------------------------------------------------------ -Sunrise is an opensource and OOP-based WordPress plugin framework. -It was designed to speed up plugin deployment and development, together with sufficient +Sunrise is an open-source and OOP-based plugin framework. It can help you to make unlimited number of fast and powerful options pages with native look in your WordPress plugins or themes. It was designed to speed up plugin deployment and development, together with sufficient functionality. -#### Features out of the box - -* Powerful options, e.g. ajax upload fields, color pickers, checkbox groups and much more -* Translation support -* OOP-based and easily extensible - #### Useful links -* [Documentation](https://github.com/gndev/sunrise/wiki) -* [Page at wordpress.org](http://wordpress.org/plugins/sunrise/) -* [Support forum](http://wordpress.org/support/plugin/sunrise/) -* [My Twitter](http://twitter.com/gndevinfo) and [homepage](http://gndev.info/) \ No newline at end of file +* [Documentation](https://gndev.info/kb/) - __not available yet__ - read the code for more info +* [My Twitter](http://twitter.com/gndevinfo) and [homepage](http://gndev.info/) +* [Page at wordpress.org](http://wordpress.org/plugins/sunrise/) \ No newline at end of file diff --git a/assets/css/sunrise.css b/assets/css/sunrise.css deleted file mode 100644 index e979629..0000000 --- a/assets/css/sunrise.css +++ /dev/null @@ -1,154 +0,0 @@ -/*********************************** - Common styles -***********************************/ - -.sunrise-plugin-onehalf { - float: left; - width: 46%; - margin: 0 4% 1em 0; -} -.sunrise-plugin-onethird { - float: left; - width: 31%; - margin: 0 2% 1em 0; -} -.sunrise-plugin-clear { - display: block; - height: 0; - overflow: hidden; - clear: both; -} -.sunrise-plugin-hidden { display: none } - - - -/*********************************** - Nav tabs -***********************************/ - -#sunrise-plugin-tabs {} -#sunrise-plugin-tabs span { cursor: pointer } -#sunrise-plugin-tabs .nav-tab-active, -#sunrise-plugin-tabs span:hover { color: #464646 } - - - -/*********************************** - Panes -***********************************/ - -.sunrise-plugin-pane { - margin: 20px 0; - padding-bottom: 20px; - border-bottom: 3px solid #f0f0f0; -} -.js .sunrise-plugin-pane { - padding-bottom: 0; - border: none; -} - - - -/*********************************** - Fields -***********************************/ - -#sunrise-plugin-settings .form-table td, -#sunrise-plugin-settings .form-table th { padding-bottom: 20px } - -#sunrise-plugin-settings .description { - display: block; - margin-top: 5px; -} - -.sunrise-plugin-textarea { - width: 80%; - min-width: 25em; - max-width: 50em; -} - -.sunrise-plugin-code { - width: 80%; - min-width: 25em; - max-width: 50em; - padding: 4px; - font-size: 13px; - font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; - line-height: 21px !important; - background: scroll url('../images/code.png'); -} - -.sunrise-plugin-select { - width: 40%; - min-width: 25em; - max-width: 50em; -} - -.sunrise-plugin-checkbox-group label { - display: inline-block; - margin: 0 0 5px 0; -} - - -/*********************************** - Color picker -***********************************/ - -.sunrise-plugin-color-picker { - position: relative; - width: 300px; -} -.sunrise-plugin-color-picker-preview { - position: absolute; - right: 0; - top: 0; - display: none; - background: #fff; - border: 1px solid #eee; - z-index: 4; -} - - - -/*********************************** - Notifications -***********************************/ - -#sunrise-plugin-settings .sunrise-plugin-notification { - position: relative; - margin: 20px 0; -} -#sunrise-plugin-settings .sunrise-plugin-notification small { - float: right; - display: none; - color: #555; -} -.js #sunrise-plugin-settings .sunrise-plugin-notification:hover small { display: inline } - - - -/*********************************** - Actions bar -***********************************/ - -.sunrise-plugin-actions-bar { - margin-top: 20px; - padding: 10px; - background: #f5f5f5; - border-top: 1px solid #eee; - -webkit-border-bottom-right-radius: 5px; - -webkit-border-bottom-left-radius: 5px; - -moz-border-radius-bottomright: 5px; - -moz-border-radius-bottomleft: 5px; - border-bottom-right-radius: 5px; - border-bottom-left-radius: 5px; -} - -.sunrise-plugin-spin, -.sunrise-plugin-success-tip { - display: none; - margin-left: 10px; -} -.sunrise-plugin-success-tip { color: #0b0 } -.sunrise-plugin-spin img, -.sunrise-plugin-success-tip img { margin: 0 5px -3px 0 } \ No newline at end of file diff --git a/assets/images/code.png b/assets/images/code.png deleted file mode 100644 index e946c23671ef0c604907497758fb0a0cf0ba1c06..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 966 zcmaJ=O=}ZD7+w^l7IP3h_<=A^J&DBUbF^deFeJc$>bO_S7vabb2oc%J8d-gn-)Td!TojGrD? z6eVNM8x1+1kmJJGA^D$vu(vIzQ=-xm3w%X%?T9HQmoGD5`gWT&nC))fc*&*}BQiuDhonq9)4<%d5%p{@htTF+XS=$SA`2Fb)1fHwI#k_^Bu*^E%{8q#kwrWjh zYt<>baON_YPN)>{nXp0PuLUtpblB6Sa-AL{2zn5)s>6L#EvpX7JYpcP;;e%U1Qc>A z$>CzIcoArrU_>;8r?Ldo{1n9m^gk%0MeYi17}b6(xzk}sh>#-G?RM4fq{^c1%t&-P`FiBYi(8pULxr>)FvP@FUbK;1B+a1o zV*k46!IA8qbUAEWxfwP-3uL!PvaNq-f{*e^P}3+ilXrWs9%Yo-u^06x58vFZo&T|Y zcJ})2ulCn#>^+=({qyZPeDc_{&tJafH_Q)5?mXZ5bbLv1ejhz^>;Apn^ktcqn(=sU G>GmI`mop~- diff --git a/assets/images/success.png b/assets/images/success.png deleted file mode 100644 index 2414885b8576481fb6350ed9ce01ab033169fd75..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 634 zcmV-=0)_pFP)tYd4K$mX5uyr2F@fdffp{&DSHtl4|Bn9=ukpCx`#%PTUr-D(@b7;C zhJXJjrnw{;1KBM=6&|E`fsNrGL!Y6%zUh}QUl`(@V)PmQFtotEKmafTHP0uP}7&%m4pcKQ#X)BiAJ2y+PrtBI>9eEIt2-_c7)?*Lsf z5vX5*Af@m-wBJRV%#Fiz=BdPr0!2^a2d-yv7gSU);Z6{`~Oy?E5qSnHUln4*Y%!){F!Y1~5WXoC44g zb7l_)X~q^V6MmWR7e3wj|L|Wb!|^}Y86N$^h+kv_Kw-fP!~#If$6(B4$)LlK#&G6; zC&ShMSAb$5tA9Xg5dOsg@-z^@3;;QS9f&!gG&3|;{Da~@Q2ZB({s%XJ5&#fj0J|In U+D>(nEdT%j07*qoM6N<$g0@&8X#fBK diff --git a/assets/js/form.js b/assets/js/form.js deleted file mode 100644 index 3ad71f8..0000000 --- a/assets/js/form.js +++ /dev/null @@ -1,815 +0,0 @@ -/*! - * jQuery Form Plugin - * version: 2.69 (06-APR-2011) - * @requires jQuery v1.3.2 or later - * - * Examples and documentation at: http://malsup.com/jquery/form/ - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ -;(function($) { - -/* - Usage Note: - ----------- - Do not use both ajaxSubmit and ajaxForm on the same form. These - functions are intended to be exclusive. Use ajaxSubmit if you want - to bind your own submit handler to the form. For example, - - $(document).ready(function() { - $('#myForm').bind('submit', function(e) { - e.preventDefault(); // <-- important - $(this).ajaxSubmit({ - target: '#output' - }); - }); - }); - - Use ajaxForm when you want the plugin to manage all the event binding - for you. For example, - - $(document).ready(function() { - $('#myForm').ajaxForm({ - target: '#output' - }); - }); - - When using ajaxForm, the ajaxSubmit function will be invoked for you - at the appropriate time. -*/ - -/** - * ajaxSubmit() provides a mechanism for immediately submitting - * an HTML form using AJAX. - */ -$.fn.ajaxSubmit = function(options) { - // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) - if (!this.length) { - log('ajaxSubmit: skipping submit process - no element selected'); - return this; - } - - if (typeof options == 'function') { - options = { success: options }; - } - - var action = this.attr('action'); - var url = (typeof action === 'string') ? $.trim(action) : ''; - if (url) { - // clean url (don't include hash vaue) - url = (url.match(/^([^#]+)/)||[])[1]; - } - url = url || window.location.href || ''; - - options = $.extend(true, { - url: url, - success: $.ajaxSettings.success, - type: this[0].getAttribute('method') || 'GET', // IE7 massage (see issue 57) - iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' - }, options); - - // hook for manipulating the form data before it is extracted; - // convenient for use with rich editors like tinyMCE or FCKEditor - var veto = {}; - this.trigger('form-pre-serialize', [this, options, veto]); - if (veto.veto) { - log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); - return this; - } - - // provide opportunity to alter form data before it is serialized - if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { - log('ajaxSubmit: submit aborted via beforeSerialize callback'); - return this; - } - - var n,v,a = this.formToArray(options.semantic); - if (options.data) { - options.extraData = options.data; - for (n in options.data) { - if(options.data[n] instanceof Array) { - for (var k in options.data[n]) { - a.push( { name: n, value: options.data[n][k] } ); - } - } - else { - v = options.data[n]; - v = $.isFunction(v) ? v() : v; // if value is fn, invoke it - a.push( { name: n, value: v } ); - } - } - } - - // give pre-submit callback an opportunity to abort the submit - if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { - log('ajaxSubmit: submit aborted via beforeSubmit callback'); - return this; - } - - // fire vetoable 'validate' event - this.trigger('form-submit-validate', [a, this, options, veto]); - if (veto.veto) { - log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); - return this; - } - - var q = $.param(a); - - if (options.type.toUpperCase() == 'GET') { - options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; - options.data = null; // data is null for 'get' - } - else { - options.data = q; // data is the query string for 'post' - } - - var $form = this, callbacks = []; - if (options.resetForm) { - callbacks.push(function() { $form.resetForm(); }); - } - if (options.clearForm) { - callbacks.push(function() { $form.clearForm(); }); - } - - // perform a load on the target only if dataType is not provided - if (!options.dataType && options.target) { - var oldSuccess = options.success || function(){}; - callbacks.push(function(data) { - var fn = options.replaceTarget ? 'replaceWith' : 'html'; - $(options.target)[fn](data).each(oldSuccess, arguments); - }); - } - else if (options.success) { - callbacks.push(options.success); - } - - options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg - var context = options.context || options; // jQuery 1.4+ supports scope context - for (var i=0, max=callbacks.length; i < max; i++) { - callbacks[i].apply(context, [data, status, xhr || $form, $form]); - } - }; - - // are there files to upload? - var fileInputs = $('input:file', this).length > 0; - var mp = 'multipart/form-data'; - var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp); - - // options.iframe allows user to force iframe mode - // 06-NOV-09: now defaulting to iframe mode if file input is detected - if (options.iframe !== false && (fileInputs || options.iframe || multipart)) { - // hack to fix Safari hang (thanks to Tim Molendijk for this) - // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d - if (options.closeKeepAlive) { - $.get(options.closeKeepAlive, fileUpload); - } - else { - fileUpload(); - } - } - else { - $.ajax(options); - } - - // fire 'notify' event - this.trigger('form-submit-notify', [this, options]); - return this; - - - // private function for handling file uploads (hat tip to YAHOO!) - function fileUpload() { - var form = $form[0]; - - if ($(':input[name=submit],:input[id=submit]', form).length) { - // if there is an input with a name or id of 'submit' then we won't be - // able to invoke the submit fn on the form (at least not x-browser) - alert('Error: Form elements must not have name or id of "submit".'); - return; - } - - var s = $.extend(true, {}, $.ajaxSettings, options); - s.context = s.context || s; - var id = 'jqFormIO' + (new Date().getTime()), fn = '_'+id; - var $io = $('