Permalink
Browse files

remove old search from the toolbar

remove the old system toolbar and searchbar
  • Loading branch information...
1 parent 5c0c3ef commit 9770360e7cdb548ad42fe248e357a9e21d08dd87 @exi exi committed May 9, 2012
@@ -205,12 +205,8 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
dojo.subscribe(module + ".changeProject", this, "changeProject");
dojo.subscribe(module + ".reload", this, "reload");
dojo.subscribe(module + ".openForm", this, "openForm");
- dojo.subscribe(module + ".showSuggest", this, "showSuggest");
- dojo.subscribe(module + ".hideSuggest", this, "hideSuggest");
- dojo.subscribe(module + ".setSuggest", this, "setSuggest");
dojo.subscribe(module + ".showSearchResults", this, "showSearchResults");
dojo.subscribe(module + ".showTagsResults", this, "showTagsResults");
- dojo.subscribe(module + ".clickResult", this, "clickResult");
dojo.subscribe(module + ".updateCacheData", this, "updateCacheData");
dojo.subscribe(module + ".loadResult", this, "loadResult");
dojo.subscribe(module + ".setLanguage", this, "setLanguage");
@@ -358,7 +354,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
var view = phpr.viewManager.useDefaultView({blank: true});
phpr.InitialScreen.start();
- this.hideSuggest();
// Get all configuration.php vars for the front
var config = new phpr.Default.System.Store.Config();
@@ -455,8 +450,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
phpr.tree.fadeIn();
this.setSubmoduleNavigation();
}
- this.hideSuggest();
- this.setSearchForm();
},
rebuildGrid: function(includeSubentries) {
@@ -510,7 +503,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
setGlobalModulesNavigation: function() {
var view = phpr.viewManager.getView();
var toolbar = view.mainNavigation;
- var systemToolbar = view.systemNavigation;
var globalModules = phpr.DataStore.getData({url: phpr.globalModuleUrl});
var isAdmin = phpr.DataStore.getMetaData({url: phpr.globalModuleUrl});
var button = null;
@@ -519,7 +511,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
var that = this;
toolbar.destroyDescendants();
- systemToolbar.destroyDescendants();
for (var i in globalModules) {
@@ -545,23 +536,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
button = null;
}
- // Setting
- button = new dijit.form.Button({
- label: phpr.nls.get('Setting'),
- showLabel: true,
- onClick: dojo.hitch(this, function() {
- phpr.currentProjectId = phpr.rootProjectId;
- phpr.pageManager.modifyCurrentState(
- dojo.mixin(dojo.clone(this._emptyState), { moduleName: "Setting" }),
- { forceModuleReload: true }
- );
- })
- });
-
- this.globalModuleNavigationButtons.Setting = button;
- toolbar.addChild(button);
- button = null;
-
if (isAdmin > 0) {
// Administration
button = new dijit.form.Button({
@@ -578,7 +552,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
toolbar.addChild(button);
this.globalModuleNavigationButtons.Administration = button;
- button = null;
}
// Help
@@ -588,10 +561,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
onClick: dojo.hitch(this, "showHelp")
});
- phpr.tutorialAnchors.helpButton = button;
-
- systemToolbar.addChild(button);
- button = null;
// Logout
button = new dijit.form.Button({
@@ -602,12 +571,9 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
})
});
- systemToolbar.addChild(button);
- button = null;
// destroy cyclic refs
toolbar = null;
- systemToolbar = null;
this._registerGlobalModuleNavigationListener();
},
@@ -944,46 +910,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
});
},
- setSearchForm: function() {
- // Summary:
- // Add the onkeyup to the search field
- if (this._searchEvent === null) {
- var searchfield = phpr.viewManager.getView().searchfield;
- this._searchEvent = dojo.connect(searchfield.domNode, "onkeyup",
- dojo.hitch(this, "waitForSubmitSearchForm"));
- this.garbageCollector.addEvent(this._searchEvent);
- }
- },
-
- waitForSubmitSearchForm: function(event) {
- // Summary:
- // This function call the search itself After 1000ms of the last letter
- // Description:
- // The function will wait for 1000 ms on each keyup for try to
- // call the search query when the user finish to write the text
- // If the enter is presses, the suggest disapear.
- // If some "user" key is presses, the function don't run.
- key = event.keyCode;
- if (key == dojo.keys.ENTER || key == dojo.keys.NUMPAD_ENTER) {
- // hide the suggestBox and delete the time
- // for not show the suggest
- if (window.mytimeout) {
- window.clearTimeout(window.mytimeout);
- }
- this.hideSuggest();
- var words = phpr.viewManager.getView().searchfield.get('value');
- phpr.pageManager.getActiveModule().clickResult("search");
- phpr.pageManager.modifyCurrentState({search: words});
- } else if (phpr.isValidInputKey(key)) {
- if (window.mytimeout) {
- window.clearTimeout(window.mytimeout);
- }
- if (phpr.viewManager.getView().searchfield.isValid()) {
- window.mytimeout = window.setTimeout(dojo.hitch(this, "showSearchSuggest"), 500);
- }
- }
- },
-
showSearchSuggest: function() {
// Summary:
// This function show a box with suggest or quick result of the search
@@ -1042,12 +968,10 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
search += "</div>";
}
- this.setSuggest(search);
- this.showSuggest();
}
}));
} else {
- this.hideSuggest();
+ this.searchButton.hideSuggest();
}
},
@@ -1068,26 +992,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
}
},
- clickResult: function(/*String*/type) {
- if (type == 'search') {
- this.hideSuggest();
- }
- },
-
- showSuggest: function() {
- if (phpr.viewManager.getView().searchsuggest.innerHTML !== '') {
- phpr.viewManager.getView().searchsuggest.style.display = 'inline';
- }
- },
-
- hideSuggest: function() {
- phpr.viewManager.getView().searchsuggest.style.display = 'none';
- },
-
- setSuggest: function(html) {
- phpr.viewManager.getView().searchsuggest.innerHTML = html;
- },
-
showTagsResults: function(/*String*/tag) {
// Summary:
// This function reload the grid place with the result of the tag search
@@ -1107,8 +1011,6 @@ dojo.declare("phpr.Default.Main", phpr.Default.System.Component, {
// Clean the navigation and forms buttons
phpr.tree.fadeIn();
- this.hideSuggest();
- this.setSearchForm();
phpr.send({
url: getDataUrl,
@@ -130,7 +130,6 @@ dojo.declare(
return new dijit.MenuItem({
label: html,
onClick: function() {
- dojo.publish(item.moduleName + ".clickResult", [item.resultType]);
dojo.publish(item.moduleName + ".loadResult", [item.id, item.moduleName, item.projectId]);
}
});
@@ -20,17 +20,6 @@
style="height: 60px; overflow: hidden;" class="header">
<img class="left PHProjektLogo" src="{{webpath}}img/logo.png" alt="PHProjekt 6" dojoAttachPoint="PHProjektLogo"
onClick='phpr.currentProjectId = 1; dojo.publish("Project.setUrlHash", ["Project"])' />
- <form dojoType="dijit.form.Form" dojoAttachPoint="searchform" name="searchform"
- onsubmit='phpr.pageManager.getActiveModule().showSearchResults(phpr.viewManager.getView().searchfield.get("value"));
- return false;'
- style="display: inline">
- <div dojoAttachPoint="searchBar" class="last right align-right searchBar">
- <input dojoAttachPoint="searchfield" class="searchfield" name="searchfield" dojoType="dijit.form.ValidationTextBox"
- onmousedown='this.focus(); phpr.pageManager.getActiveModule().showSuggest();' />
- <div dojoAttachPoint="systemNavigation" class="systemNavigation" dojoType="dijit.Toolbar">
- </div>
- </div>
- </form>
<div dojoAttachPoint="mainNavigation" class="right align-right mainNavigation" dojoType="dijit.Toolbar">
</div>
<div dojoAttachPoint="loadingIcon" class="right align-right loadingIcon"
@@ -82,10 +71,6 @@
</div>
</div>
</div>
- <!-- Suggest seacrh -->
- <div dojoAttachPoint="searchsuggest"
- style="z-index: 100; display: inline" class="searchsuggest">
- </div>
<!-- Help -->
<div dojoType="dijit.Dialog" dojoAttachPoint="helpDialog" class="helpDialog" title="" draggable="false"
style="background-color: white; width: auto; height: auto;">
@@ -1,6 +0,0 @@
-<div class="searchsuggesttitle" dojoType="dijit.layout.ContentPane">
- {{moduleLabel}}
-</div>
-<div class="searchsuggestcontent" dojoType="dijit.layout.ContentPane">
- {{results|safe}}
-</div>
@@ -58,8 +58,6 @@ dojo.declare("phpr.Project.Main", phpr.Default.Main, {
this.destroyGrid();
this.setSubmoduleNavigation('BasicData');
- this.hideSuggest();
- this.setSearchForm();
phpr.tree.fadeIn();
this.form = new this.formBasicDataWidget(this, phpr.currentProjectId, phpr.module, {}, view.centerMainContent);
@@ -348,13 +348,6 @@ h1,h2,h3,h4,h5,h6 {
background-color: #fff;
}
-.phprojekt .results a {
- font-weight: bold;
- color: #294064;
- text-decoration: none;
- margin-left: 10px;
- margin-top: 10px;
- margin-bottom: 10px;
}
.phprojekt .results span {
@@ -1,10 +0,0 @@
-/* Menu */
-
-.dijitRtl .phprojekt .dijitMenuItem .dijitMenuItemIcon {
- padding-left: 3px;
- padding-right: 0px;
-}
-
-.dijitRtl .phprojekt .dijitMenuItem .dijitMenuExpand {
- background-position: left top;
-}
Oops, something went wrong.

0 comments on commit 9770360

Please sign in to comment.