Changeset 839285
- Timestamp:
- 01/15/2014 09:32:22 PM (12 years ago)
- Location:
- jazzy-forms/trunk
- Files:
-
- 8 edited
-
back/elements.js (modified) (1 diff)
-
back/gui.js (modified) (7 diffs)
-
back/smartid.js (modified) (1 diff)
-
core/Parser.php (modified) (4 diffs)
-
core/Tokenizer.php (modified) (1 diff)
-
front/jazzy-forms.js (modified) (2 diffs)
-
jazzy-forms.php (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
jazzy-forms/trunk/back/elements.js
r830488 r839285 102 102 element.delegate('.jzzf_option_delete', 'click', self.delete_option); 103 103 var smartid_element = element.find('.jzzf_element_name, .jzzf_element_title'); 104 smartid_element.bind('blur', 'change', name_update_listener);104 smartid_element.bind('blur', null, name_update_listener); 105 105 var smartid = new jzzf_smartid(id_helper, element); 106 106 smartid.bind(); -
jazzy-forms/trunk/back/gui.js
r830488 r839285 21 21 var obj = { 22 22 'title': title, 23 'name': name,23 'name': '', 24 24 'type': type, 25 25 'decimals': 9, … … 40 40 var gui = jzzf_element.create(type, element_id_helper, adjust_email_tab, update_element_names); 41 41 gui.add(obj, remove ? item : null, false); 42 update_element_names(); 42 43 adjust_email_tab(); 43 44 } … … 106 107 var name = id_helper.suggest_name(title); 107 108 data.title = title; 108 data.name = name;109 data.name = '';//name; 109 110 jzzf_element.reset_ids(data); 110 111 element.add(data, placeholder, false); … … 147 148 148 149 $('#jzzf_new_form_title').bind('change keyup', function() { 149 $('#jzzf_title').val($('#jzzf_new_form_title').val()).change(); 150 return true; 150 $('#jzzf_title').val($('#jzzf_new_form_title').val()); 151 $('#jzzf_title').trigger('jzzf_smartid_change'); 152 return false; 151 153 }); 152 154 $('#jzzf_title').bind('change keyup', function() { 153 155 $('#jzzf_new_form_title').val($('#jzzf_title').val()); 154 return true;156 return false; 155 157 }); 156 158 … … 265 267 } 266 268 269 function default_email_parameters() { 270 return { 271 'sending': 'Sending...', 272 'ok': "Message sent", 273 'fail': "Can't send the message" 274 }; 275 } 276 267 277 function add_form() { 268 278 switch_head(true); … … 277 287 'theme': 1, 278 288 'realtime': true, 279 'email': { 280 'sending': 'Sending...', 281 'ok': "Message sent", 282 'fail': "Can't send the message" 283 } 289 'email': default_email_parameters() 284 290 }; 285 291 elements = []; … … 299 305 form = jzzf_forms[idx]; 300 306 form_index = idx; 307 if(!form.email) { 308 form.email = default_email_parameters(); 309 } 301 310 set_form(form); 302 311 } -
jazzy-forms/trunk/back/smartid.js
r830488 r839285 35 35 this.bind = function() { 36 36 container.find('.jzzf_smartid').bind('change keyup', handle_id_change); 37 container.find('.jzzf_smartid_source').bind("keyup change ", handle_source_change);37 container.find('.jzzf_smartid_source').bind("keyup change jzzf_smartid_change", handle_source_change); 38 38 container.find('.jzzf_smartid, .jzzf_smartid_source').bind("focus", handle_focus); 39 39 } -
jazzy-forms/trunk/core/Parser.php
r587992 r839285 7 7 concatenation = sum, [ "&", concatenation ]; 8 8 sum = product, [("+" | "-"), sum]; 9 product = exponentiation, [("*" | "/"), term];9 product = exponentiation, [("*" | "/"), product]; 10 10 exponentiation = negation, ["^", exponentiation]; 11 negation = ["-"], term 12 term = negation | number | string | function | identifier | association; 11 negation = ["-"], percentage 12 percentage = term ["%"] 13 term = number | string | function | identifier | association; 13 14 14 15 arguments = comparison, { ",", comparison }; … … 171 172 return $num; 172 173 } else { 173 $positive = $this-> term();174 $positive = $this->percentage(); 174 175 if(!$positive) { 175 176 throw new Exception('missing negation operand'); … … 179 180 } 180 181 } else { 181 return $this->term(); 182 } 182 return $this->percentage(); 183 } 184 } 185 186 private function percentage() { 187 $value = $this->term(); 188 if($this->ahead('%')) { 189 if(!$value) { 190 throw new Exception("Unexpected percentage sign"); 191 } 192 $this->consume(); 193 if($value[0] == 'n') { 194 $value[1] /= 100; 195 return $value; 196 } else { 197 return array("o", "/", $value, array("n", 100)); 198 } 199 } 200 return $value; 183 201 } 184 202 185 203 private function term() { 204 //$this->dump(); 186 205 if($this->complete()) { 187 206 return array(); … … 201 220 return null; 202 221 } 222 223 // for debugging only 224 private function dump() { 225 print json_encode($this->rest) . "\n"; 226 } 203 227 } -
jazzy-forms/trunk/core/Tokenizer.php
r581482 r839285 35 35 36 36 private function operator() { 37 return $this->match('<=|>=|<>|[\-\+\*\/\^\,<>=& ]');37 return $this->match('<=|>=|<>|[\-\+\*\/\^\,<>=&%]'); 38 38 } 39 39 -
jazzy-forms/trunk/front/jazzy-forms.js
r830488 r839285 330 330 case "r": 331 331 return element(id).find('input:checked').siblings("label").text(); 332 case "c": 333 var box = element(id); 334 return box.is(':checked') ? box.siblings("label").text() : ""; 332 335 default: 333 336 types.raise_ref(); 334 337 } 338 } 339 340 this.selected = function(id) { 341 var type = graph.types[id]; 342 switch(type) { 343 case "d": 344 return element(id).find('option:selected').index() + 1; 345 case "r": 346 return element(id).find('input:checked').parent().index() + 1; 347 case "c": 348 return types.value(element(id).is(':checked')) ? 1 : 0; 349 default: 350 types.raise_ref(); 351 } 352 } 353 354 this.checked = function(id) { 355 if(graph.types[id] != 'c') { 356 types.raise_ref(); 357 } 358 return element(id).is(':checked'); 335 359 } 336 360 … … 522 546 var id = _id(args); 523 547 return engine.label(id); 524 } 525 548 }, 549 'selected': function(args) { 550 var id = _id(args); 551 return engine.selected(id); 552 }, 553 'checked': function(args) { 554 var id = _id(args); 555 return engine.checked(id); 556 } 526 557 }; 527 558 -
jazzy-forms/trunk/jazzy-forms.php
r830488 r839285 4 4 Plugin URI: http://www.jazzyforms.com/ 5 5 Description: Online form builder with an emphasis on calculation 6 Version: 1. 06 Version: 1.1 7 7 Author: Igor Prochazka 8 8 Author URI: http://www.jazzyforms.com/ … … 10 10 --------------------------------------------------------------------- 11 11 This file is part of the WordPress plugin "Jazzy Forms" 12 Copyright (C) 2012 , 2013by Igor Prochazka12 Copyright (C) 2012-2014 by Igor Prochazka 13 13 14 14 This program is free software: you can redistribute it and/or modify … … 28 28 */ 29 29 30 define(JZZF_VERSION, 1.0 000);31 define(JZZF_VERSION_STRING, "1.0 000");30 define(JZZF_VERSION, 1.0100); 31 define(JZZF_VERSION_STRING, "1.0100"); 32 32 define(JZZF_OPTION_VERSION, 'jzzf_version'); 33 33 -
jazzy-forms/trunk/readme.txt
r830488 r839285 5 5 Requires at least: 3.2.1 6 6 Tested up to: 3.8 7 Stable tag: 1. 07 Stable tag: 1.1 8 8 9 9 Online form builder, ideal for cost-estimates and calculations … … 36 36 * Text/Heading/HTML 37 37 38 Features like input validation, anti-spam measures or data collection are coming soon.39 40 38 [Official web site](http://www.jazzyforms.com/?utm_source=wordpress&utm_medium=plugin_directory&utm_term=&utm_content=&utm_campaign=official) 41 39 … … 120 118 121 119 == Changelog == 120 121 = 1.1 = 122 * Support for percentage notation 123 * Extend LABEL function to checkboxes 124 * SELECTED and CHECKED functions 125 * Several backend fixes 122 126 123 127 = 1.0 =
Note: See TracChangeset
for help on using the changeset viewer.