Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Dubiniuk <victor.dubiniuk@gmail.com>2014-10-08 03:51:05 +0400
committerVictor Dubiniuk <victor.dubiniuk@gmail.com>2014-10-08 03:51:05 +0400
commitcabf831bc994797d448cc08338b898acf7b41e24 (patch)
treea011d04df53ef0795a81aa89d830dd4a1e85d377
parentd5861b8bc49427d7f0391c0a09b516bd91c4d3f8 (diff)
Zooming with combobox
-rwxr-xr-xcss/style.css4
-rw-r--r--js/3rdparty/resources/dijit/form/ComboBox.js4
-rw-r--r--js/3rdparty/resources/dijit/form/ComboBoxMixin.js59
-rw-r--r--js/3rdparty/resources/dijit/form/DataList.js20
-rw-r--r--js/3rdparty/resources/dijit/form/_AutoCompleterMixin.js273
-rw-r--r--js/3rdparty/resources/dijit/form/_ComboBoxMenu.js65
-rw-r--r--js/3rdparty/resources/dijit/form/_ComboBoxMenuMixin.js98
-rw-r--r--js/3rdparty/resources/dijit/form/_ListBase.js71
-rw-r--r--js/3rdparty/resources/dijit/form/_ListMouseMixin.js64
-rw-r--r--js/3rdparty/resources/dijit/form/_SearchMixin.js130
-rw-r--r--js/3rdparty/resources/dojo/store/Memory.js56
-rw-r--r--js/3rdparty/resources/dojo/store/util/SimpleQueryEngine.js66
-rw-r--r--js/3rdparty/webodf/editor/Tools.js12
-rw-r--r--js/widgets/zoomCombo.js123
14 files changed, 1039 insertions, 6 deletions
diff --git a/css/style.css b/css/style.css
index 1792e896..6f273cf4 100755
--- a/css/style.css
+++ b/css/style.css
@@ -333,6 +333,10 @@ editinfo > div.editInfoMarker:hover {
margin-top: -1px;
}
+.claro .dijitComboBox .dijitInputInner{
+ padding:0 1px !important;
+}
+
.claro .dijitTextBox .dijitInputInner,
.claro .dijitSpinner .dijitSpinnerButtonInner {
margin: 0;
diff --git a/js/3rdparty/resources/dijit/form/ComboBox.js b/js/3rdparty/resources/dijit/form/ComboBox.js
new file mode 100644
index 00000000..3d8e6dc5
--- /dev/null
+++ b/js/3rdparty/resources/dijit/form/ComboBox.js
@@ -0,0 +1,4 @@
+//>>built
+define("dijit/form/ComboBox",["dojo/_base/declare","./ValidationTextBox","./ComboBoxMixin"],function(_1,_2,_3){
+return _1("dijit.form.ComboBox",[_2,_3],{});
+});
diff --git a/js/3rdparty/resources/dijit/form/ComboBoxMixin.js b/js/3rdparty/resources/dijit/form/ComboBoxMixin.js
new file mode 100644
index 00000000..d166f3d3
--- /dev/null
+++ b/js/3rdparty/resources/dijit/form/ComboBoxMixin.js
@@ -0,0 +1,59 @@
+//>>built
+require({cache:{"url:dijit/form/templates/DropDownBox.html":"<div class=\"dijit dijitReset dijitInline dijitLeft\"\n\tid=\"widget_${id}\"\n\trole=\"combobox\"\n\taria-haspopup=\"true\"\n\tdata-dojo-attach-point=\"_popupStateNode\"\n\t><div class='dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer'\n\t\tdata-dojo-attach-point=\"_buttonNode\" role=\"presentation\"\n\t\t><input class=\"dijitReset dijitInputField dijitArrowButtonInner\" value=\"&#9660; \" type=\"text\" tabIndex=\"-1\" readonly=\"readonly\" role=\"button presentation\" aria-hidden=\"true\"\n\t\t\t${_buttonInputDisabled}\n\t/></div\n\t><div class='dijitReset dijitValidationContainer'\n\t\t><input class=\"dijitReset dijitInputField dijitValidationIcon dijitValidationInner\" value=\"&#935; \" type=\"text\" tabIndex=\"-1\" readonly=\"readonly\" role=\"presentation\"\n\t/></div\n\t><div class=\"dijitReset dijitInputField dijitInputContainer\"\n\t\t><input class='dijitReset dijitInputInner' ${!nameAttrSetting} type=\"text\" autocomplete=\"off\"\n\t\t\tdata-dojo-attach-point=\"textbox,focusNode\" role=\"textbox\"\n\t/></div\n></div>\n"}});
+define("dijit/form/ComboBoxMixin",["dojo/_base/declare","dojo/Deferred","dojo/_base/kernel","dojo/_base/lang","dojo/store/util/QueryResults","./_AutoCompleterMixin","./_ComboBoxMenu","../_HasDropDown","dojo/text!./templates/DropDownBox.html"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9){
+return _1("dijit.form.ComboBoxMixin",[_8,_6],{dropDownClass:_7,hasDownArrow:true,templateString:_9,baseClass:"dijitTextBox dijitComboBox",cssStateNodes:{"_buttonNode":"dijitDownArrowButton"},_setHasDownArrowAttr:function(_a){
+this._set("hasDownArrow",_a);
+this._buttonNode.style.display=_a?"":"none";
+},_showResultList:function(){
+this.displayMessage("");
+this.inherited(arguments);
+},_setStoreAttr:function(_b){
+if(!_b.get){
+_4.mixin(_b,{_oldAPI:true,get:function(id){
+var _c=new _2();
+this.fetchItemByIdentity({identity:id,onItem:function(_d){
+_c.resolve(_d);
+},onError:function(_e){
+_c.reject(_e);
+}});
+return _c.promise;
+},query:function(_f,_10){
+var _11=new _2(function(){
+_12.abort&&_12.abort();
+});
+_11.total=new _2();
+var _12=this.fetch(_4.mixin({query:_f,onBegin:function(_13){
+_11.total.resolve(_13);
+},onComplete:function(_14){
+_11.resolve(_14);
+},onError:function(_15){
+_11.reject(_15);
+}},_10));
+return _5(_11);
+}});
+}
+this._set("store",_b);
+},postMixInProperties:function(){
+var _16=this.params.store||this.store;
+if(_16){
+this._setStoreAttr(_16);
+}
+this.inherited(arguments);
+if(!this.params.store&&this.store&&!this.store._oldAPI){
+var _17=this.declaredClass;
+_4.mixin(this.store,{getValue:function(_18,_19){
+_3.deprecated(_17+".store.getValue(item, attr) is deprecated for builtin store. Use item.attr directly","","2.0");
+return _18[_19];
+},getLabel:function(_1a){
+_3.deprecated(_17+".store.getLabel(item) is deprecated for builtin store. Use item.label directly","","2.0");
+return _1a.name;
+},fetch:function(_1b){
+_3.deprecated(_17+".store.fetch() is deprecated for builtin store.","Use store.query()","2.0");
+var _1c=["dojo/data/ObjectStore"];
+require(_1c,_4.hitch(this,function(_1d){
+new _1d({objectStore:this}).fetch(_1b);
+}));
+}});
+}
+}});
+});
diff --git a/js/3rdparty/resources/dijit/form/DataList.js b/js/3rdparty/resources/dijit/form/DataList.js
new file mode 100644
index 00000000..c7aa04ad
--- /dev/null
+++ b/js/3rdparty/resources/dijit/form/DataList.js
@@ -0,0 +1,20 @@
+//>>built
+define("dijit/form/DataList",["dojo/_base/declare","dojo/dom","dojo/_base/lang","dojo/query","dojo/store/Memory","../registry"],function(_1,_2,_3,_4,_5,_6){
+function _7(_8){
+return {id:_8.value,value:_8.value,name:_3.trim(_8.innerText||_8.textContent||"")};
+};
+return _1("dijit.form.DataList",_5,{constructor:function(_9,_a){
+this.domNode=_2.byId(_a);
+_3.mixin(this,_9);
+if(this.id){
+_6.add(this);
+}
+this.domNode.style.display="none";
+this.inherited(arguments,[{data:_4("option",this.domNode).map(_7)}]);
+},destroy:function(){
+_6.remove(this.id);
+},fetchSelectedItem:function(){
+var _b=_4("> option[selected]",this.domNode)[0]||_4("> option",this.domNode)[0];
+return _b&&_7(_b);
+}});
+});
diff --git a/js/3rdparty/resources/dijit/form/_AutoCompleterMixin.js b/js/3rdparty/resources/dijit/form/_AutoCompleterMixin.js
new file mode 100644
index 00000000..20f67f91
--- /dev/null
+++ b/js/3rdparty/resources/dijit/form/_AutoCompleterMixin.js
@@ -0,0 +1,273 @@
+//>>built
+define("dijit/form/_AutoCompleterMixin",["dojo/aspect","dojo/_base/declare","dojo/dom-attr","dojo/keys","dojo/_base/lang","dojo/query","dojo/regexp","dojo/sniff","./DataList","./_TextBoxMixin","./_SearchMixin"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b){
+var _c=_2("dijit.form._AutoCompleterMixin",_b,{item:null,autoComplete:true,highlightMatch:"first",labelAttr:"",labelType:"text",maxHeight:-1,_stopClickEvents:false,_getCaretPos:function(_d){
+var _e=0;
+if(typeof (_d.selectionStart)=="number"){
+_e=_d.selectionStart;
+}else{
+if(_8("ie")){
+var tr=_d.ownerDocument.selection.createRange().duplicate();
+var _f=_d.createTextRange();
+tr.move("character",0);
+_f.move("character",0);
+try{
+_f.setEndPoint("EndToEnd",tr);
+_e=String(_f.text).replace(/\r/g,"").length;
+}
+catch(e){
+}
+}
+}
+return _e;
+},_setCaretPos:function(_10,_11){
+_11=parseInt(_11);
+_a.selectInputText(_10,_11,_11);
+},_setDisabledAttr:function(_12){
+this.inherited(arguments);
+this.domNode.setAttribute("aria-disabled",_12?"true":"false");
+},_onKey:function(evt){
+if(evt.charCode>=32){
+return;
+}
+var key=evt.charCode||evt.keyCode;
+if(key==_4.ALT||key==_4.CTRL||key==_4.META||key==_4.SHIFT){
+return;
+}
+var pw=this.dropDown;
+var _13=null;
+this._abortQuery();
+this.inherited(arguments);
+if(evt.altKey||evt.ctrlKey||evt.metaKey){
+return;
+}
+if(this._opened){
+_13=pw.getHighlightedOption();
+}
+switch(key){
+case _4.PAGE_DOWN:
+case _4.DOWN_ARROW:
+case _4.PAGE_UP:
+case _4.UP_ARROW:
+if(this._opened){
+this._announceOption(_13);
+}
+evt.stopPropagation();
+evt.preventDefault();
+break;
+case _4.ENTER:
+if(_13){
+if(_13==pw.nextButton){
+this._nextSearch(1);
+evt.stopPropagation();
+evt.preventDefault();
+break;
+}else{
+if(_13==pw.previousButton){
+this._nextSearch(-1);
+evt.stopPropagation();
+evt.preventDefault();
+break;
+}
+}
+evt.stopPropagation();
+evt.preventDefault();
+}else{
+this._setBlurValue();
+this._setCaretPos(this.focusNode,this.focusNode.value.length);
+}
+case _4.TAB:
+var _14=this.get("displayedValue");
+if(pw&&(_14==pw._messages["previousMessage"]||_14==pw._messages["nextMessage"])){
+break;
+}
+if(_13){
+this._selectOption(_13);
+}
+case _4.ESCAPE:
+if(this._opened){
+this._lastQuery=null;
+this.closeDropDown();
+}
+break;
+}
+},_autoCompleteText:function(_15){
+var fn=this.focusNode;
+_a.selectInputText(fn,fn.value.length);
+var _16=this.ignoreCase?"toLowerCase":"substr";
+if(_15[_16](0).indexOf(this.focusNode.value[_16](0))==0){
+var _17=this.autoComplete?this._getCaretPos(fn):fn.value.length;
+if((_17+1)>fn.value.length){
+fn.value=_15;
+_a.selectInputText(fn,_17);
+}
+}else{
+fn.value=_15;
+_a.selectInputText(fn);
+}
+},_openResultList:function(_18,_19,_1a){
+var _1b=this.dropDown.getHighlightedOption();
+this.dropDown.clearResultList();
+if(!_18.length&&_1a.start==0){
+this.closeDropDown();
+return;
+}
+this._nextSearch=this.dropDown.onPage=_5.hitch(this,function(_1c){
+_18.nextPage(_1c!==-1);
+this.focus();
+});
+this.dropDown.createOptions(_18,_1a,_5.hitch(this,"_getMenuLabelFromItem"));
+this._showResultList();
+if("direction" in _1a){
+if(_1a.direction){
+this.dropDown.highlightFirstOption();
+}else{
+if(!_1a.direction){
+this.dropDown.highlightLastOption();
+}
+}
+if(_1b){
+this._announceOption(this.dropDown.getHighlightedOption());
+}
+}else{
+if(this.autoComplete&&!this._prev_key_backspace&&!/^[*]+$/.test(_19[this.searchAttr].toString())){
+this._announceOption(this.dropDown.containerNode.firstChild.nextSibling);
+}
+}
+},_showResultList:function(){
+this.closeDropDown(true);
+this.openDropDown();
+this.domNode.setAttribute("aria-expanded","true");
+},loadDropDown:function(){
+this._startSearchAll();
+},isLoaded:function(){
+return false;
+},closeDropDown:function(){
+this._abortQuery();
+if(this._opened){
+this.inherited(arguments);
+this.domNode.setAttribute("aria-expanded","false");
+}
+},_setBlurValue:function(){
+var _1d=this.get("displayedValue");
+var pw=this.dropDown;
+if(pw&&(_1d==pw._messages["previousMessage"]||_1d==pw._messages["nextMessage"])){
+this._setValueAttr(this._lastValueReported,true);
+}else{
+if(typeof this.item=="undefined"){
+this.item=null;
+this.set("displayedValue",_1d);
+}else{
+if(this.value!=this._lastValueReported){
+this._handleOnChange(this.value,true);
+}
+this._refreshState();
+}
+}
+this.focusNode.removeAttribute("aria-activedescendant");
+},_setItemAttr:function(_1e,_1f,_20){
+var _21="";
+if(_1e){
+if(!_20){
+_20=this.store._oldAPI?this.store.getValue(_1e,this.searchAttr):_1e[this.searchAttr];
+}
+_21=this._getValueField()!=this.searchAttr?this.store.getIdentity(_1e):_20;
+}
+this.set("value",_21,_1f,_20,_1e);
+},_announceOption:function(_22){
+if(!_22){
+return;
+}
+var _23;
+if(_22==this.dropDown.nextButton||_22==this.dropDown.previousButton){
+_23=_22.innerHTML;
+this.item=undefined;
+this.value="";
+}else{
+var _24=this.dropDown.items[_22.getAttribute("item")];
+_23=(this.store._oldAPI?this.store.getValue(_24,this.searchAttr):_24[this.searchAttr]).toString();
+this.set("item",_24,false,_23);
+}
+this.focusNode.value=this.focusNode.value.substring(0,this._lastInput.length);
+this.focusNode.setAttribute("aria-activedescendant",_3.get(_22,"id"));
+this._autoCompleteText(_23);
+},_selectOption:function(_25){
+this.closeDropDown();
+if(_25){
+this._announceOption(_25);
+}
+this._setCaretPos(this.focusNode,this.focusNode.value.length);
+this._handleOnChange(this.value,true);
+this.focusNode.removeAttribute("aria-activedescendant");
+},_startSearchAll:function(){
+this._startSearch("");
+},_startSearchFromInput:function(){
+this.item=undefined;
+this.inherited(arguments);
+},_startSearch:function(key){
+if(!this.dropDown){
+var _26=this.id+"_popup",_27=_5.isString(this.dropDownClass)?_5.getObject(this.dropDownClass,false):this.dropDownClass;
+this.dropDown=new _27({onChange:_5.hitch(this,this._selectOption),id:_26,dir:this.dir,textDir:this.textDir});
+}
+this._lastInput=key;
+this.inherited(arguments);
+},_getValueField:function(){
+return this.searchAttr;
+},postMixInProperties:function(){
+this.inherited(arguments);
+if(!this.store&&this.srcNodeRef){
+var _28=this.srcNodeRef;
+this.store=new _9({},_28);
+if(!("value" in this.params)){
+var _29=(this.item=this.store.fetchSelectedItem());
+if(_29){
+var _2a=this._getValueField();
+this.value=this.store._oldAPI?this.store.getValue(_29,_2a):_29[_2a];
+}
+}
+}
+},postCreate:function(){
+var _2b=_6("label[for=\""+this.id+"\"]");
+if(_2b.length){
+if(!_2b[0].id){
+_2b[0].id=this.id+"_label";
+}
+this.domNode.setAttribute("aria-labelledby",_2b[0].id);
+}
+this.inherited(arguments);
+_1.after(this,"onSearch",_5.hitch(this,"_openResultList"),true);
+},_getMenuLabelFromItem:function(_2c){
+var _2d=this.labelFunc(_2c,this.store),_2e=this.labelType;
+if(this.highlightMatch!="none"&&this.labelType=="text"&&this._lastInput){
+_2d=this.doHighlight(_2d,this._lastInput);
+_2e="html";
+}
+return {html:_2e=="html",label:_2d};
+},doHighlight:function(_2f,_30){
+var _31=(this.ignoreCase?"i":"")+(this.highlightMatch=="all"?"g":""),i=this.queryExpr.indexOf("${0}");
+_30=_7.escapeString(_30);
+return this._escapeHtml(_2f.replace(new RegExp((i==0?"^":"")+"("+_30+")"+(i==(this.queryExpr.length-4)?"$":""),_31),"\uffff$1\uffff")).replace(/\uFFFF([^\uFFFF]+)\uFFFF/g,"<span class=\"dijitComboBoxHighlightMatch\">$1</span>");
+},_escapeHtml:function(str){
+str=String(str).replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;").replace(/"/gm,"&quot;");
+return str;
+},reset:function(){
+this.item=null;
+this.inherited(arguments);
+},labelFunc:function(_32,_33){
+return (_33._oldAPI?_33.getValue(_32,this.labelAttr||this.searchAttr):_32[this.labelAttr||this.searchAttr]).toString();
+},_setValueAttr:function(_34,_35,_36,_37){
+this._set("item",_37||null);
+if(_34==null){
+_34="";
+}
+this.inherited(arguments);
+}});
+if(_8("dojo-bidi")){
+_c.extend({_setTextDirAttr:function(_38){
+this.inherited(arguments);
+if(this.dropDown){
+this.dropDown._set("textDir",_38);
+}
+}});
+}
+return _c;
+});
diff --git a/js/3rdparty/resources/dijit/form/_ComboBoxMenu.js b/js/3rdparty/resources/dijit/form/_ComboBoxMenu.js
new file mode 100644
index 00000000..af918864
--- /dev/null
+++ b/js/3rdparty/resources/dijit/form/_ComboBoxMenu.js
@@ -0,0 +1,65 @@
+//>>built
+define("dijit/form/_ComboBoxMenu",["dojo/_base/declare","dojo/dom-class","dojo/dom-style","dojo/keys","../_WidgetBase","../_TemplatedMixin","./_ComboBoxMenuMixin","./_ListMouseMixin"],function(_1,_2,_3,_4,_5,_6,_7,_8){
+return _1("dijit.form._ComboBoxMenu",[_5,_6,_8,_7],{templateString:"<div class='dijitReset dijitMenu' data-dojo-attach-point='containerNode' style='overflow: auto; overflow-x: hidden;' role='listbox'>"+"<div class='dijitMenuItem dijitMenuPreviousButton' data-dojo-attach-point='previousButton' role='option'></div>"+"<div class='dijitMenuItem dijitMenuNextButton' data-dojo-attach-point='nextButton' role='option'></div>"+"</div>",baseClass:"dijitComboBoxMenu",postCreate:function(){
+this.inherited(arguments);
+if(!this.isLeftToRight()){
+_2.add(this.previousButton,"dijitMenuItemRtl");
+_2.add(this.nextButton,"dijitMenuItemRtl");
+}
+this.containerNode.setAttribute("role","listbox");
+},_createMenuItem:function(){
+var _9=this.ownerDocument.createElement("div");
+_9.className="dijitReset dijitMenuItem"+(this.isLeftToRight()?"":" dijitMenuItemRtl");
+_9.setAttribute("role","option");
+return _9;
+},onHover:function(_a){
+_2.add(_a,"dijitMenuItemHover");
+},onUnhover:function(_b){
+_2.remove(_b,"dijitMenuItemHover");
+},onSelect:function(_c){
+_2.add(_c,"dijitMenuItemSelected");
+},onDeselect:function(_d){
+_2.remove(_d,"dijitMenuItemSelected");
+},_page:function(up){
+var _e=0;
+var _f=this.domNode.scrollTop;
+var _10=_3.get(this.domNode,"height");
+if(!this.getHighlightedOption()){
+this.selectNextNode();
+}
+while(_e<_10){
+var _11=this.getHighlightedOption();
+if(up){
+if(!_11.previousSibling||_11.previousSibling.style.display=="none"){
+break;
+}
+this.selectPreviousNode();
+}else{
+if(!_11.nextSibling||_11.nextSibling.style.display=="none"){
+break;
+}
+this.selectNextNode();
+}
+var _12=this.domNode.scrollTop;
+_e+=(_12-_f)*(up?-1:1);
+_f=_12;
+}
+},handleKey:function(evt){
+switch(evt.keyCode){
+case _4.DOWN_ARROW:
+this.selectNextNode();
+return false;
+case _4.PAGE_DOWN:
+this._page(false);
+return false;
+case _4.UP_ARROW:
+this.selectPreviousNode();
+return false;
+case _4.PAGE_UP:
+this._page(true);
+return false;
+default:
+return true;
+}
+}});
+});
diff --git a/js/3rdparty/resources/dijit/form/_ComboBoxMenuMixin.js b/js/3rdparty/resources/dijit/form/_ComboBoxMenuMixin.js
new file mode 100644
index 00000000..be1c50b2
--- /dev/null
+++ b/js/3rdparty/resources/dijit/form/_ComboBoxMenuMixin.js
@@ -0,0 +1,98 @@
+//>>built
+define("dijit/form/_ComboBoxMenuMixin",["dojo/_base/array","dojo/_base/declare","dojo/dom-attr","dojo/has","dojo/i18n","dojo/i18n!./nls/ComboBox"],function(_1,_2,_3,_4,_5){
+var _6=_2("dijit.form._ComboBoxMenuMixin"+(_4("dojo-bidi")?"_NoBidi":""),null,{_messages:null,postMixInProperties:function(){
+this.inherited(arguments);
+this._messages=_5.getLocalization("dijit.form","ComboBox",this.lang);
+},buildRendering:function(){
+this.inherited(arguments);
+this.previousButton.innerHTML=this._messages["previousMessage"];
+this.nextButton.innerHTML=this._messages["nextMessage"];
+},_setValueAttr:function(_7){
+this._set("value",_7);
+this.onChange(_7);
+},onClick:function(_8){
+if(_8==this.previousButton){
+this._setSelectedAttr(null);
+this.onPage(-1);
+}else{
+if(_8==this.nextButton){
+this._setSelectedAttr(null);
+this.onPage(1);
+}else{
+this.onChange(_8);
+}
+}
+},onChange:function(){
+},onPage:function(){
+},onClose:function(){
+this._setSelectedAttr(null);
+},_createOption:function(_9,_a){
+var _b=this._createMenuItem();
+var _c=_a(_9);
+if(_c.html){
+_b.innerHTML=_c.label;
+}else{
+_b.appendChild(_b.ownerDocument.createTextNode(_c.label));
+}
+if(_b.innerHTML==""){
+_b.innerHTML="&#160;";
+}
+return _b;
+},createOptions:function(_d,_e,_f){
+this.items=_d;
+this.previousButton.style.display=(_e.start==0)?"none":"";
+_3.set(this.previousButton,"id",this.id+"_prev");
+_1.forEach(_d,function(_10,i){
+var _11=this._createOption(_10,_f);
+_11.setAttribute("item",i);
+_3.set(_11,"id",this.id+i);
+this.nextButton.parentNode.insertBefore(_11,this.nextButton);
+},this);
+var _12=false;
+if(_d.total&&!_d.total.then&&_d.total!=-1){
+if((_e.start+_e.count)<_d.total){
+_12=true;
+}else{
+if((_e.start+_e.count)>_d.total&&_e.count==_d.length){
+_12=true;
+}
+}
+}else{
+if(_e.count==_d.length){
+_12=true;
+}
+}
+this.nextButton.style.display=_12?"":"none";
+_3.set(this.nextButton,"id",this.id+"_next");
+},clearResultList:function(){
+var _13=this.containerNode;
+while(_13.childNodes.length>2){
+_13.removeChild(_13.childNodes[_13.childNodes.length-2]);
+}
+this._setSelectedAttr(null);
+},highlightFirstOption:function(){
+this.selectFirstNode();
+},highlightLastOption:function(){
+this.selectLastNode();
+},selectFirstNode:function(){
+this.inherited(arguments);
+if(this.getHighlightedOption()==this.previousButton){
+this.selectNextNode();
+}
+},selectLastNode:function(){
+this.inherited(arguments);
+if(this.getHighlightedOption()==this.nextButton){
+this.selectPreviousNode();
+}
+},getHighlightedOption:function(){
+return this.selected;
+}});
+if(_4("dojo-bidi")){
+_6=_2("dijit.form._ComboBoxMenuMixin",_6,{_createOption:function(){
+var _14=this.inherited(arguments);
+this.applyTextDir(_14);
+return _14;
+}});
+}
+return _6;
+});
diff --git a/js/3rdparty/resources/dijit/form/_ListBase.js b/js/3rdparty/resources/dijit/form/_ListBase.js
new file mode 100644
index 00000000..5dde3065
--- /dev/null
+++ b/js/3rdparty/resources/dijit/form/_ListBase.js
@@ -0,0 +1,71 @@
+//>>built
+define("dijit/form/_ListBase",["dojo/_base/declare","dojo/on","dojo/window"],function(_1,on,_2){
+return _1("dijit.form._ListBase",null,{selected:null,_listConnect:function(_3,_4){
+var _5=this;
+return _5.own(on(_5.containerNode,on.selector(function(_6,_7,_8){
+return _6.parentNode==_8;
+},_3),function(_9){
+_5[_4](_9,this);
+}));
+},selectFirstNode:function(){
+var _a=this.containerNode.firstChild;
+while(_a&&_a.style.display=="none"){
+_a=_a.nextSibling;
+}
+this._setSelectedAttr(_a,true);
+},selectLastNode:function(){
+var _b=this.containerNode.lastChild;
+while(_b&&_b.style.display=="none"){
+_b=_b.previousSibling;
+}
+this._setSelectedAttr(_b,true);
+},selectNextNode:function(){
+var _c=this.selected;
+if(!_c){
+this.selectFirstNode();
+}else{
+var _d=_c.nextSibling;
+while(_d&&_d.style.display=="none"){
+_d=_d.nextSibling;
+}
+if(!_d){
+this.selectFirstNode();
+}else{
+this._setSelectedAttr(_d,true);
+}
+}
+},selectPreviousNode:function(){
+var _e=this.selected;
+if(!_e){
+this.selectLastNode();
+}else{
+var _f=_e.previousSibling;
+while(_f&&_f.style.display=="none"){
+_f=_f.previousSibling;
+}
+if(!_f){
+this.selectLastNode();
+}else{
+this._setSelectedAttr(_f,true);
+}
+}
+},_setSelectedAttr:function(_10,_11){
+if(this.selected!=_10){
+var _12=this.selected;
+if(_12){
+this.onDeselect(_12);
+}
+if(_10){
+if(_11){
+_2.scrollIntoView(_10);
+}
+this.onSelect(_10);
+}
+this._set("selected",_10);
+}else{
+if(_10){
+this.onSelect(_10);
+}
+}
+}});
+});
diff --git a/js/3rdparty/resources/dijit/form/_ListMouseMixin.js b/js/3rdparty/resources/dijit/form/_ListMouseMixin.js
new file mode 100644
index 00000000..81e94f50
--- /dev/null
+++ b/js/3rdparty/resources/dijit/form/_ListMouseMixin.js
@@ -0,0 +1,64 @@
+//>>built
+define("dijit/form/_ListMouseMixin",["dojo/_base/declare","dojo/on","dojo/touch","./_ListBase"],function(_1,on,_2,_3){
+return _1("dijit.form._ListMouseMixin",_3,{postCreate:function(){
+this.inherited(arguments);
+this.domNode.dojoClick=true;
+this._listConnect("click","_onClick");
+this._listConnect("mousedown","_onMouseDown");
+this._listConnect("mouseup","_onMouseUp");
+this._listConnect("mouseover","_onMouseOver");
+this._listConnect("mouseout","_onMouseOut");
+},_onClick:function(_4,_5){
+this._setSelectedAttr(_5,false);
+if(this._deferredClick){
+this._deferredClick.remove();
+}
+this._deferredClick=this.defer(function(){
+this._deferredClick=null;
+this.onClick(_5);
+});
+},_onMouseDown:function(_6,_7){
+if(this._hoveredNode){
+this.onUnhover(this._hoveredNode);
+this._hoveredNode=null;
+}
+this._isDragging=true;
+this._setSelectedAttr(_7,false);
+},_onMouseUp:function(_8,_9){
+this._isDragging=false;
+var _a=this.selected;
+var _b=this._hoveredNode;
+if(_a&&_9==_a){
+this.defer(function(){
+this._onClick(_8,_a);
+});
+}else{
+if(_b){
+this.defer(function(){
+this._onClick(_8,_b);
+});
+}
+}
+},_onMouseOut:function(_c,_d){
+if(this._hoveredNode){
+this.onUnhover(this._hoveredNode);
+this._hoveredNode=null;
+}
+if(this._isDragging){
+this._cancelDrag=(new Date()).getTime()+1000;
+}
+},_onMouseOver:function(_e,_f){
+if(this._cancelDrag){
+var _10=(new Date()).getTime();
+if(_10>this._cancelDrag){
+this._isDragging=false;
+}
+this._cancelDrag=null;
+}
+this._hoveredNode=_f;
+this.onHover(_f);
+if(this._isDragging){
+this._setSelectedAttr(_f,false);
+}
+}});
+});
diff --git a/js/3rdparty/resources/dijit/form/_SearchMixin.js b/js/3rdparty/resources/dijit/form/_SearchMixin.js
new file mode 100644
index 00000000..560c8b25
--- /dev/null
+++ b/js/3rdparty/resources/dijit/form/_SearchMixin.js
@@ -0,0 +1,130 @@
+//>>built
+define("dijit/form/_SearchMixin",["dojo/_base/declare","dojo/keys","dojo/_base/lang","dojo/query","dojo/string","dojo/when","../registry"],function(_1,_2,_3,_4,_5,_6,_7){
+return _1("dijit.form._SearchMixin",null,{pageSize:Infinity,store:null,fetchProperties:{},query:{},list:"",_setListAttr:function(_8){
+this._set("list",_8);
+},searchDelay:200,searchAttr:"name",queryExpr:"${0}*",ignoreCase:true,_patternToRegExp:function(_9){
+return new RegExp("^"+_9.replace(/(\\.)|(\*)|(\?)|\W/g,function(_a,_b,_c,_d){
+return _c?".*":_d?".":_b?_b:"\\"+_a;
+})+"$",this.ignoreCase?"mi":"m");
+},_abortQuery:function(){
+if(this.searchTimer){
+this.searchTimer=this.searchTimer.remove();
+}
+if(this._queryDeferHandle){
+this._queryDeferHandle=this._queryDeferHandle.remove();
+}
+if(this._fetchHandle){
+if(this._fetchHandle.abort){
+this._cancelingQuery=true;
+this._fetchHandle.abort();
+this._cancelingQuery=false;
+}
+if(this._fetchHandle.cancel){
+this._cancelingQuery=true;
+this._fetchHandle.cancel();
+this._cancelingQuery=false;
+}
+this._fetchHandle=null;
+}
+},_processInput:function(_e){
+if(this.disabled||this.readOnly){
+return;
+}
+var _f=_e.charOrCode;
+if("type" in _e&&_e.type.substring(0,3)=="key"&&(_e.altKey||((_e.ctrlKey||_e.metaKey)&&(_f!="x"&&_f!="v"))||_f==_2.SHIFT)){
+return;
+}
+var _10=false;
+this._prev_key_backspace=false;
+switch(_f){
+case _2.DELETE:
+case _2.BACKSPACE:
+this._prev_key_backspace=true;
+this._maskValidSubsetError=true;
+_10=true;
+break;
+default:
+_10=typeof _f=="string"||_f==229;
+}
+if(_10){
+if(!this.store){
+this.onSearch();
+}else{
+this.searchTimer=this.defer("_startSearchFromInput",1);
+}
+}
+},onSearch:function(){
+},_startSearchFromInput:function(){
+this._startSearch(this.focusNode.value);
+},_startSearch:function(_11){
+this._abortQuery();
+var _12=this,_4=_3.clone(this.query),_13={start:0,count:this.pageSize,queryOptions:{ignoreCase:this.ignoreCase,deep:true}},qs=_5.substitute(this.queryExpr,[_11.replace(/([\\\*\?])/g,"\\$1")]),q,_14=function(){
+var _15=_12._fetchHandle=_12.store.query(_4,_13);
+if(_12.disabled||_12.readOnly||(q!==_12._lastQuery)){
+return;
+}
+_6(_15,function(res){
+_12._fetchHandle=null;
+if(!_12.disabled&&!_12.readOnly&&(q===_12._lastQuery)){
+_6(_15.total,function(_16){
+res.total=_16;
+var _17=_12.pageSize;
+if(isNaN(_17)||_17>res.total){
+_17=res.total;
+}
+res.nextPage=function(_18){
+_13.direction=_18=_18!==false;
+_13.count=_17;
+if(_18){
+_13.start+=res.length;
+if(_13.start>=res.total){
+_13.count=0;
+}
+}else{
+_13.start-=_17;
+if(_13.start<0){
+_13.count=Math.max(_17+_13.start,0);
+_13.start=0;
+}
+}
+if(_13.count<=0){
+res.length=0;
+_12.onSearch(res,_4,_13);
+}else{
+_14();
+}
+};
+_12.onSearch(res,_4,_13);
+});
+}
+},function(err){
+_12._fetchHandle=null;
+if(!_12._cancelingQuery){
+console.error(_12.declaredClass+" "+err.toString());
+}
+});
+};
+_3.mixin(_13,this.fetchProperties);
+if(this.store._oldAPI){
+q=qs;
+}else{
+q=this._patternToRegExp(qs);
+q.toString=function(){
+return qs;
+};
+}
+this._lastQuery=_4[this.searchAttr]=q;
+this._queryDeferHandle=this.defer(_14,this.searchDelay);
+},constructor:function(){
+this.query={};
+this.fetchProperties={};
+},postMixInProperties:function(){
+if(!this.store){
+var _19=this.list;
+if(_19){
+this.store=_7.byId(_19);
+}
+}
+this.inherited(arguments);
+}});
+});
diff --git a/js/3rdparty/resources/dojo/store/Memory.js b/js/3rdparty/resources/dojo/store/Memory.js
new file mode 100644
index 00000000..d86a463a
--- /dev/null
+++ b/js/3rdparty/resources/dojo/store/Memory.js
@@ -0,0 +1,56 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+//>>built
+define("dojo/store/Memory",["../_base/declare","./util/QueryResults","./util/SimpleQueryEngine"],function(_1,_2,_3){
+var _4=null;
+return _1("dojo.store.Memory",_4,{constructor:function(_5){
+for(var i in _5){
+this[i]=_5[i];
+}
+this.setData(this.data||[]);
+},data:null,idProperty:"id",index:null,queryEngine:_3,get:function(id){
+return this.data[this.index[id]];
+},getIdentity:function(_6){
+return _6[this.idProperty];
+},put:function(_7,_8){
+var _9=this.data,_a=this.index,_b=this.idProperty;
+var id=_7[_b]=(_8&&"id" in _8)?_8.id:_b in _7?_7[_b]:Math.random();
+if(id in _a){
+if(_8&&_8.overwrite===false){
+throw new Error("Object already exists");
+}
+_9[_a[id]]=_7;
+}else{
+_a[id]=_9.push(_7)-1;
+}
+return id;
+},add:function(_c,_d){
+(_d=_d||{}).overwrite=false;
+return this.put(_c,_d);
+},remove:function(id){
+var _e=this.index;
+var _f=this.data;
+if(id in _e){
+_f.splice(_e[id],1);
+this.setData(_f);
+return true;
+}
+},query:function(_10,_11){
+return _2(this.queryEngine(_10,_11)(this.data));
+},setData:function(_12){
+if(_12.items){
+this.idProperty=_12.identifier||this.idProperty;
+_12=this.data=_12.items;
+}else{
+this.data=_12;
+}
+this.index={};
+for(var i=0,l=_12.length;i<l;i++){
+this.index[_12[i][this.idProperty]]=i;
+}
+}});
+});
diff --git a/js/3rdparty/resources/dojo/store/util/SimpleQueryEngine.js b/js/3rdparty/resources/dojo/store/util/SimpleQueryEngine.js
new file mode 100644
index 00000000..09238847
--- /dev/null
+++ b/js/3rdparty/resources/dojo/store/util/SimpleQueryEngine.js
@@ -0,0 +1,66 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+//>>built
+define("dojo/store/util/SimpleQueryEngine",["../../_base/array"],function(_1){
+return function(_2,_3){
+switch(typeof _2){
+default:
+throw new Error("Can not query with a "+typeof _2);
+case "object":
+case "undefined":
+var _4=_2;
+_2=function(_5){
+for(var _6 in _4){
+var _7=_4[_6];
+if(_7&&_7.test){
+if(!_7.test(_5[_6],_5)){
+return false;
+}
+}else{
+if(_7!=_5[_6]){
+return false;
+}
+}
+}
+return true;
+};
+break;
+case "string":
+if(!this[_2]){
+throw new Error("No filter function "+_2+" was found in store");
+}
+_2=this[_2];
+case "function":
+}
+function _8(_9){
+var _a=_1.filter(_9,_2);
+var _b=_3&&_3.sort;
+if(_b){
+_a.sort(typeof _b=="function"?_b:function(a,b){
+for(var _c,i=0;_c=_b[i];i++){
+var _d=a[_c.attribute];
+var _e=b[_c.attribute];
+_d=_d!=null?_d.valueOf():_d;
+_e=_e!=null?_e.valueOf():_e;
+if(_d!=_e){
+return !!_c.descending==(_d==null||_d>_e)?-1:1;
+}
+}
+return 0;
+});
+}
+if(_3&&(_3.start||_3.count)){
+var _f=_a.length;
+_a=_a.slice(_3.start||0,(_3.start||0)+(_3.count||Infinity));
+_a.total=_f;
+}
+return _a;
+};
+_8.matches=_2;
+return _8;
+};
+});
diff --git a/js/3rdparty/webodf/editor/Tools.js b/js/3rdparty/webodf/editor/Tools.js
index 0f43d205..f2da402d 100644
--- a/js/3rdparty/webodf/editor/Tools.js
+++ b/js/3rdparty/webodf/editor/Tools.js
@@ -52,9 +52,9 @@ define("webodf/editor/Tools", [
"webodf/editor/widgets/editHyperlinks",
"webodf/editor/widgets/imageInserter",
"webodf/editor/widgets/paragraphStylesDialog",
- "owncloud/widgets/zoomSelect",
+ "owncloud/widgets/zoomCombo",
"webodf/editor/EditorSession"],
- function (ready, MenuItem, DropDownMenu, Button, DropDownButton, Toolbar, ParagraphAlignment, SimpleStyles, UndoRedoMenu, CurrentStyle, AnnotationControl, EditHyperlinks, ImageInserter, ParagraphStylesDialog, ZoomSelect, EditorSession) {
+ function (ready, MenuItem, DropDownMenu, Button, DropDownButton, Toolbar, ParagraphAlignment, SimpleStyles, UndoRedoMenu, CurrentStyle, AnnotationControl, EditHyperlinks, ImageInserter, ParagraphStylesDialog, ZoomCombo, EditorSession) {
"use strict";
return function Tools(args) {
@@ -67,7 +67,7 @@ define("webodf/editor/Tools", [
loadButton, saveButton, closeButton,
formatDropDownMenu, formatMenuButton,
paragraphStylesMenuItem, paragraphStylesDialog, simpleStyles, currentStyle,
- zoomSelect,
+ zoomCombo,
undoRedoMenu,
editorSession,
paragraphAlignment,
@@ -171,12 +171,12 @@ define("webodf/editor/Tools", [
currentStyle.onToolDone = onToolDone;
// Zoom Level Selector
- zoomSelect = new ZoomSelect(function (widget) {
+ zoomCombo = new ZoomCombo(function (widget) {
widget.placeAt(toolbar);
widget.startup();
});
- sessionSubscribers.push(zoomSelect);
- zoomSelect.onToolDone = onToolDone;
+ sessionSubscribers.push(zoomCombo);
+ zoomCombo.onToolDone = onToolDone;
// Load
if (loadOdtFile) {
diff --git a/js/widgets/zoomCombo.js b/js/widgets/zoomCombo.js
new file mode 100644
index 00000000..67dbf94b
--- /dev/null
+++ b/js/widgets/zoomCombo.js
@@ -0,0 +1,123 @@
+/*global define,require */
+
+define("owncloud/widgets/zoomCombo",
+ ["webodf/editor/EditorSession"],
+
+ function (EditorSession) {
+ "use strict";
+ /**
+ * @constructor
+ */
+ return function ZoomCombo(callback) {
+ var self = this,
+ editorSession,
+ zoomStore,
+ combo,
+ canZoomTo = [
+ {name: "25%", id: "0.25"},
+ {name: "50%", id: "0.5"},
+ {name: "75%", id: "0.75"},
+ {name: "100%", id: "1"},
+ {name: "125%", id: "1.25"},
+ {name: "150%", id: "1.5"},
+ {name: "200%", id: "2"},
+ {name: "250%", id: "2.5"},
+ {name: "300%", id: "3"},
+ {name: "350%", id: "3.5"},
+ {name: "400%", id: "4"}
+ ],
+ defaultZoom = "100%";
+
+ function makeWidget(callback) {
+ require(["dijit/form/ComboBox", "dojo/store/Memory"], function (ComboBox, Memory) {
+ zoomStore = new Memory({
+ data: canZoomTo
+ });
+
+ combo = new ComboBox({
+ name: 'ZoomCombo',
+ maxHeight: 200,
+ store: zoomStore,
+ searchAttr: "name",
+ value: defaultZoom,
+ style: {
+ height: '21px',
+ width: '60px',
+ margin: "2px 10px 0 0",
+ float: 'right'
+ }
+ });
+
+ combo.onChange = function (value) {
+ if (editorSession && value && !isNaN(parseInt(value))) {
+ editorSession.getOdfCanvas().getZoomHelper().setZoomLevel(parseInt(value)/100);
+ }
+ self.onToolDone();
+ };
+
+ return callback(combo);
+ });
+ }
+
+ function updateComboBox(zoomLevel) {
+ if (combo) {
+ self.setValue(zoomLevel);
+ }
+ }
+
+ this.setValue = function (value) {
+ if (value === "") {
+ value = defaultZoom;
+ } else {
+ value = value * 100 + "%";
+ }
+ combo.set('value', value, false);
+ };
+
+ this.onAdd = null;
+ this.onRemove = null;
+ this.onChange = function () {};
+ this.onToolDone = function () {};
+
+ function addValue(option) {
+ if (combo) {
+ combo.addOption({
+ label: option.label,
+ value: option.value
+ });
+ }
+
+ if (self.onAdd) {
+ self.onAdd(option.label);
+ }
+ }
+
+ function removeValue(option) {
+ if (combo) {
+ combo.removeOption(option.value);
+ }
+
+ if (self.onRemove) {
+ self.onRemove(option.value);
+ }
+ }
+
+ this.setEditorSession = function(session) {
+ var zoomHelper;
+ if (editorSession) {
+ editorSession.getOdfCanvas().getZoomHelper().unsubscribe(gui.ZoomHelper.signalZoomChanged, updateComboBox);
+ }
+ editorSession = session;
+ if (editorSession) {
+ zoomHelper = editorSession.getOdfCanvas().getZoomHelper();
+ zoomHelper.subscribe(gui.ZoomHelper.signalZoomChanged, updateComboBox);
+ updateComboBox(zoomHelper.getZoomLevel());
+ }
+ };
+
+ // init
+ makeWidget(function (widget) {
+ return callback(widget);
+ });
+ };
+});