Commit Graph

164 Commits

Author SHA1 Message Date
Ralf Becker
6d226a7921 split constructor function and place of instanciation for app.js objects: app[appname] = new app.classes[appname](); 2013-11-04 20:54:23 +00:00
Ralf Becker
064baf926a et2.submit(button,async) button can now be widget-id too, new optional async parameter to send request asynchronious (default synchronious), eg. to show an otherwise frozen animation 2013-10-30 14:07:29 +00:00
Nathan Gray
388b2cbceb - Fix etemplate2 assign json plugin so it's on the right egw object
- Add a console debug group (when supported) to make it easier to work with console log
2013-10-28 20:16:49 +00:00
Nathan Gray
4002907c05 Use jQuery's Deferred to solve the deferred loading problem instead of load events. 2013-10-16 20:48:05 +00:00
Ralf Becker
c6a97da311 fixed changes in get_rows method were not send back to client, if PHP mcrypt is available / eTemplate request stored on client 2013-10-11 11:20:21 +00:00
Nathan Gray
26f75a241b Make sure context is the widget when calling setters 2013-10-09 17:15:44 +00:00
Nathan Gray
fde83c834e Register an AJAX handler for assign response type. Needs exec_id, widget ID, attribute name and value. Widget must support setting that attribute. 2013-10-09 12:56:49 +00:00
Ralf Becker
bafcc80e35 fixed translations not loaded on very first request, as postponing ready for waiting on translations did not work, now using a direct callback instead 2013-10-08 08:55:15 +00:00
Ralf Becker
0bb8093426 fixed translations on client-side: server sends now currentapp and langRequire to client, which uses that to translate phrases, langRequire is only stored in egw object for matching app-name and window! 2013-10-07 17:00:03 +00:00
Nathan Gray
7cda6a630b Add a toolbar widget that displays its actions as a toolbar 2013-10-04 07:29:38 +00:00
Ralf Becker
5778c9d964 fixed egw_framework::message($msg, $msg_type) was not displayed on ajax-load, eg. regular et2 submit 2013-10-03 09:09:24 +00:00
Nathan Gray
8f91781933 Change nextmatch actions to use ajax submit, not post 2013-09-16 15:20:22 +00:00
Nathan Gray
02c6f3b108 Remove some more references to phpgwapi/js/egw_json.js 2013-09-10 18:56:50 +00:00
Ralf Becker
1590d02816 new egw_framework::message($msg, $msg_type="success") method and fixing nextmatch filter-change to return app-header 2013-09-05 11:53:25 +00:00
Ralf Becker
1f8e0e9e41 global method egw_message(_msg, _type) to display success-, warning- or error-messages in app-header 2013-09-04 19:02:34 +00:00
Nathan Gray
4fa0370ce4 Avoid error if div has no ID (eg: dialog) 2013-08-26 19:08:02 +00:00
Ralf Becker
aa8a848871 optional parameter for egw_framework::window_close() to specify an alert message, which get shown/alerted, before closing the window 2013-08-26 10:24:11 +00:00
Ralf Becker
d8984be747 isDirty() method for whole template / etemplate2 object, thought it needs more work in widgets, not setting this._oldValue in their set_value() method 2013-08-23 15:15:30 +00:00
Nathan Gray
f9ee897544 Prevent errors if refresh message is undefined 2013-08-20 15:59:16 +00:00
Ralf Becker
73aa652c41 missing egw.js from last commit and egw_framework::window_focus() method 2013-08-20 13:25:36 +00:00
Ralf Becker
1c4f65120c new egw_framework methods refresh_opener and window_close to call egw_refresh on opener or close popup window in a content security save way 2013-08-20 12:06:41 +00:00
Nathan Gray
656560c376 Make sure et2 apps don't get passed back to old etemplate 2013-08-19 19:53:45 +00:00
Nathan Gray
eec6791213 Silence some missing attribute settings warnings and fix warning about not loading app.js when it was already loaded 2013-08-14 18:01:22 +00:00
Ralf Becker
a293de8614 fix not working full submits if etemplate is etemplate_old and app uses etemplate_new 2013-07-30 12:21:19 +00:00
Nathan Gray
bd63529096 Rework etemplate2 loading to use JSON plugin when loading from regular request & AJAX. instead of inline script tag 2013-07-20 13:57:53 +00:00
Nathan Gray
4ae6094d8d New tag list widget, supports ajax & static options 2013-07-18 15:27:39 +00:00
Nathan Gray
b3bf5b734f Make unique ID deterministic - use template name 2013-07-18 09:21:07 +00:00
Nathan Gray
524f2b0f03 Use an etemplate / top template level prefix to avoid DOM ID collisions 2013-07-18 09:13:15 +00:00
Nathan Gray
0c6f70005a Implement some basic client-side validation (required) 2013-06-26 20:50:10 +00:00
Nathan Gray
8c449cae82 Trigger a load event on the template container when the etemplate is fully loaded, so other (non-app) scripts can hook in with ease. The etemplate2 object will be the second parameter to the callback. 2013-06-17 14:44:55 +00:00
Nathan Gray
e8a21565ab First run at a new home app. Just structure so far, more to come. 2013-05-22 20:13:12 +00:00
Nathan Gray
5555edcb98 Add dialog widget 2013-04-16 18:50:43 +00:00
Nathan Gray
a4395a8000 If a specific template name is not provided, use the last template in the file 2013-04-16 18:42:53 +00:00
Ralf Becker
e64c4fbd04 add some JSDoc so Eclipse shows an outline: @memberOf and @augments (not yet understood by Eclipse), also fixed many warnings (mostly missing semicolons) 2013-04-13 19:00:13 +00:00
Nathan Gray
978a90852c Add a base object for application javascript code to contain it, and solve initialization timing issues 2013-04-09 08:45:59 +00:00
Nathan Gray
bdb148d167 Make sure widgetContainer is initialized before loading, prevents timing problems 2013-04-01 18:35:49 +00:00
Nathan Gray
a46fff9bbd Add implementation for xajax_eT_wrapper() to avoid having to replace them all right now 2013-03-25 16:56:10 +00:00
Nathan Gray
873c3301d4 Get selected IDs if action function did not pass them 2013-03-20 22:20:05 +00:00
Nathan Gray
dee286e2e0 Move favorites js into its own widget, add support for favorites in sidebox when there is no nextmatch on the page 2013-03-12 22:57:42 +00:00
Nathan Gray
643b120195 - Make nextmatch refresh more intelligently
- Call nextmatch refresh() from etemplate2.refresh()
- Add autorefresh preference (in column selection)
2013-02-25 20:35:17 +00:00
Nathan Gray
a0c0ddbfbe Dropdown / split button 2013-02-25 18:51:57 +00:00
Nathan Gray
03c9c0804f Split panel widget. Mostly working, needs some more special case for working with nm - they both want full page 2013-02-22 00:25:41 +00:00
Nathan Gray
c46777826f Add iframe widget 2013-02-20 20:53:15 +00:00
Nathan Gray
298309074e Implement updating just the affected nm row with egw_refresh() 2013-02-14 11:25:24 +00:00
Nathan Gray
54b1fb9ce4 Fix set_Value() -> set_value() 2013-02-13 09:23:33 +00:00
Nathan Gray
1f86de58c8 Get message update working 2013-02-13 09:03:28 +00:00
Nathan Gray
f2fc558e19 - Add static methods to get into etemplate2 widget context from outside. Call etemplate2.getByApplication(app) or etemplate2.getByTemplate(name) for a list of etemplate2 objects
- Add register_app_refresh() function to allow applications to specify a more intelligent way to refresh them
- Change egw_refresh() to call registered refresh function, or if etemplate2 is available try that over reloading the whole page
2013-02-12 15:46:14 +00:00
Nathan Gray
dc5fabfcb4 Keep type of value as Object, fixes missing nextmatch data 2013-02-05 09:53:06 +00:00
Christian Binder
b3a4ad5240 very first attempt for et2_widget_itempicker implementation 2012-07-14 15:38:02 +00:00
Nathan Gray
9a6e3d59a8 If two widgets have the same ID, and they both return objects as values (eg: link widgets) then merge the values instead of replacing 2012-07-04 22:41:51 +00:00
Nathan Gray
5385055eb9 Fix bug breaking array values (name ends in []) 2012-07-02 22:58:02 +00:00
Nathan Gray
86e72a105e Debug validation errors to console 2012-06-18 22:56:20 +00:00
Nathan Gray
1f2ee8faf2 Add ckeditor as htmlarea widget 2012-06-06 04:13:19 +00:00
Nathan Gray
5647df9636 Historylog widget for et2 2012-05-24 15:45:29 +00:00
Nathan Gray
03dfd56d3e Hide exec_id field too 2012-05-22 20:16:33 +00:00
Nathan Gray
014fdee8bc When posting, use hidden input 2012-05-14 16:55:38 +00:00
Nathan Gray
1049474cd9 Get customfield-type working again 2012-05-07 17:40:59 +00:00
Nathan Gray
0e2864e79a Need to add color widget before it works 2012-05-02 19:12:45 +00:00
Nathan Gray
d4aed5cf03 More work on nm actions that need real submit (POST) 2012-04-24 19:47:23 +00:00
Nathan Gray
39c133fe2e Try to get form submit (POST) working in FF 2012-04-23 20:25:21 +00:00
Nathan Gray
ea838035b6 Get submit actions (like Insert in document) working 2012-04-17 22:56:04 +00:00
Nathan Gray
d9275d53d0 Avoid sending back empty sub-arrays - apps that check for their presence, not contents, have trouble with them 2012-03-30 19:42:01 +00:00
Ralf Becker
d52ab179a7 classname in callback need to be renamed too 2012-03-28 16:30:17 +00:00
Nathan Gray
e330a7bfdc Start of vfs widget 2012-03-26 19:46:51 +00:00
Nathan Gray
1dc6376ed4 Handle inputs with names ending in [] as arrays 2012-03-23 18:17:15 +00:00
Nathan Gray
56070c43c5 Add start of ajax select widget, get submits working again 2012-03-22 23:31:31 +00:00
Nathan Gray
11fe571e65 Instanciate the instance for the app based on template name when loading 2012-03-20 21:42:25 +00:00
Nathan Gray
ccaa65b0e4 Implement groupbox/caption with fieldset/legend 2012-03-19 21:06:02 +00:00
Nathan Gray
0aa4c66803 Don't proxy template, just don't load it until asked for 2012-03-14 21:27:23 +00:00
Nathan Gray
e5b4bcfe7f Add selectAccount_ro to handle ajax user names 2012-03-14 19:02:28 +00:00
Andreas Stöckel
dc017ed889 Now again using a local etemplate2 instance on the client 2012-03-12 12:05:14 +00:00
Nathan Gray
e1f8411253 Add tree to list 2012-03-08 16:55:12 +00:00
Andreas Stöckel
c0db2e36a9 Fixed a lot of problems regarding centralized JavaScript code; et2_dataview_view_resizeable is current WIP; now building etemplate2 DOM-Tree to a DocumentFragment first, which brings a significant performance gain 2012-03-07 15:33:21 +00:00
Andreas Stöckel
e4ed4399cf Attempt of fixing legacy JavaScript functions, only tested for simple cases 2012-03-06 15:26:11 +00:00
Andreas Stöckel
049cbd88dc Now using the etemplate code from the root instance (etemplate2.js acts as a egw api plugin); fixed egw.json plugins; fixed problem with 'instanceof Object', which does not work when sharing code over multiple windows 2012-03-06 13:22:01 +00:00
Andreas Stöckel
65ca8b0c1b Using new egw json api for sending submits 2012-03-05 15:02:32 +00:00
Andreas Stöckel
d310b14ecf Client side API now supports modules which are instanciated per application or per window; removed et2_debug function from et2_core_common, now using corresponding API function. 2012-03-05 13:07:38 +00:00
Nathan Gray
8d523cad93 Fix [popup] submission in et2 2012-03-02 18:35:49 +00:00
Andreas Stöckel
14e6ceecb6 Integrated application specifig egw api into etemplate2 code 2012-03-02 10:44:56 +00:00
Nathan Gray
26c888ccd4 Encode square brackets and split names at ][, not just [ 2011-11-14 22:57:06 +00:00
Nathan Gray
43c6d95a25 Get simple submit buttons (legacy actions) working in datagrid 2011-11-09 21:34:02 +00:00
Nathan Gray
c9e4d6801d Add getPath() to core widget so widgets can override it 2011-10-06 16:33:55 +00:00
Ralf Becker
395f4a804d added progress-widget 2011-09-09 12:39:27 +00:00
Andreas Stöckel
65a90eabb8 Defaulting 'null' entries in the content-arrays to {} 2011-09-09 09:28:48 +00:00
Nathan Gray
d9f321a413 Start of a link-to widget using jQuery-UI's autocomplete 2011-09-07 23:32:24 +00:00
Nathan Gray
990e1701f5 Work in progress on file upload 2011-08-31 23:37:30 +00:00
Nathan Gray
8a632c723a - Add image widget
- Add missing dependency on et2_core_common
2011-08-30 20:56:01 +00:00
Andreas Stöckel
5c4c175ce2 Checked IE compatibility; dataview columns now resizes correctly; removed event code from etemplate2.js, use interfaces instead (as done with the 'resize' event) 2011-08-26 09:58:25 +00:00
Nathan Gray
e551dc3895 URL widget
- Still needs to get telephony link from server, felamimail not tested because egw.link_registry not populated
2011-08-25 22:42:07 +00:00
Andreas Stöckel
4114068cb3 Added et2_extension_nextmatch_dynheight.js which cares about resizing a div to the maximum possible height - this is needed because the new grid has to be explicitily sized to a given width and height 2011-08-25 15:54:15 +00:00
Andreas Stöckel
ec5b162bfa Moved et2 core interfaces to own file; implemented Class.free which cares about calling 'destroy', removing all references the object may hold and rendering the object unusable after 'free' has been called; added 'getMem_freeMem_trace' which helps hunting down memory leaks with objects derriving from Class; added first implementation of the nextmatch widget - currently does nothing else but rendering the header and clicking on the nextmatch_sortheader labels 2011-08-25 13:35:53 +00:00
Andreas Stöckel
53f4064cdc Added some naming scheme to the js files 2011-08-24 10:18:07 +00:00
Andreas Stöckel
f00d5aba60 Parsing the 'modifications' array 2011-08-23 15:27:34 +00:00
Andreas Stöckel
86414e7daa Moved 'getValues' function to etemplate2 class, added 'et2_surroundingsMgr' class, which is capable of managing DOM-Nodes which are inserted around an widget (see set_label function in et2_input and showMessage function in et2_baseWidget as an example of how to use it), added parsing server side validation errors 2011-08-23 14:59:49 +00:00
Nathan Gray
e8e5a3066a Simple date/time, still needs to know user format 2011-08-22 18:18:29 +00:00
Andreas Stöckel
09bc77426c Selectbox now allows 'option'-widgets inside of it, added hrule widget, added support for 'buttononly' 2011-08-21 13:24:20 +00:00
Andreas Stöckel
7c7a8230cf Added basic approach to have selectbox widget running again (probably not fully working yet) 2011-08-20 18:34:14 +00:00
Andreas Stöckel
5af5594f60 Major update of the et2_widget internal structure. The following changes were made:
- All attributes of the widgets are now parsed from XML before the widget itself is created.
These attributes plus all default values are then added to an associative array. The associative array is passed as second parameter to the init function of et2_widget, but is also available as this.options *after* the constructor of the et2_widget baseclass has been called.
The et2_widget constructor also calls a function parseArrayMgrAttrs(_attrs) - in this function widget implementations can read the values from e.g. the content and validation_errors array and merge it into the given _attrs associative array.
After the complete internal widgettree is completely loaded and created the "loadingFinished" function gets called and invokes all given setter functions. After that it "glues" the DOM tree together. This should also (I didn't measure it) be a bit faster than before, when the DOM-Tree was created on the fly. 

Please have a look at the changes of the et2_textbox widget to see how this affects writing widgets.

Note: The "id" property is copied to the object scope on the top of the et2_widget constructor.

- When widgets are cloned the "options" array gets passed along to the newly created widget. This means that changes made on the widgets during runtime are not automatically copied to the clone - as this didn't happen anyhow it is not a really disadvantage.
On the other side there should be no difference between widgets directly inside the "overlay" xet tag and widgets which are inside instanciated templates.

- The selbox widget doesn't work anymore - it relied on the loadAttributes function which isn't available anymore. et2_selbox should use the parseArrayMgrAttrs function to access

- I've commented out some of the "validator"-code in etemplate2.js as it created some error messages when destroying the widget tree.
2011-08-19 16:00:44 +00:00
Nathan Gray
5e54d6b12b Add basic radio, readonly version of checkbox/radio 2011-08-18 17:34:01 +00:00
Nathan Gray
03d549bab9 Add validation (basic client & server side) 2011-08-17 21:36:08 +00:00